   ;; when running svn on a remote host: expand local file names to get full names to access the file on the remote host via emacs
   (if (file-remote-p default-directory)
       (concat (file-remote-p default-directory) file-name)
+    file-name))
+
+(defun svn-local-filename-for-remote-access (file-name)
+  "Convert a full file name to a local file name that can be used for a local svn invocation."
+  (if (file-remote-p file-name)
+      (tramp-file-name-localname (tramp-dissect-file-name file-name))
     file-name))
 
 (defun svn-process-environment ()

          (while (re-search-forward search-string (point-max) t)
            (replace-match (replace-regexp-in-string " " "-" (match-string 1)) nil nil nil 1)))))))

(defun svn-status-parse-fixup-tramp-exit ()
  "Helper function to handle tramp connections stopping with an exit output.
Add this function to the `svn-pre-parse-status-hook'."
  (goto-char (point-max))
  (when (eq (svn-point-at-bol) (svn-point-at-eol))
    (forward-line -1))
  (beginning-of-line)
  (when (looking-at "exit")
    (delete-region (point) (svn-point-at-eol))))
;;(add-hook 'svn-pre-parse-status-hook 'svn-status-parse-fixup-tramp-exit)

(defun svn-parse-status-result ()
  "Parse the `svn-process-buffer-name' buffer.
The results are used to build the `svn-status-info' variable."

;; (put 'svn-log-edit-done-hook 'risky-local-variable t)
;; already implied by "-hook" suffix

(defvar svn-post-process-svn-output-hook 'svn-fixup-tramp-output-maybe "Hook that can be used to preprocess the output from svn.
The function `svn-status-remove-control-M' can be useful for that hook")

(when (eq system-type 'windows-nt)
