unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Patch to make vc-hg.el work with remote files
@ 2009-10-25 17:56 Bernhard Herzog
  2009-10-26  2:00 ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Bernhard Herzog @ 2009-10-25 17:56 UTC (permalink / raw)
  To: emacs-devel

Hi,

vc-hg.el doesn't work properly with remote files accessed via tramp.  Emacs 
doesn't even recognize correctly whether files are managed by hg in those 
cases.  The patch below fixes this for me.

Regards,

   Bernhard


Index: lisp/vc-hg.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/vc-hg.el,v
retrieving revision 1.104
diff -c -u -r1.104 vc-hg.el
--- lisp/vc-hg.el	19 Oct 2009 05:04:28 -0000	1.104
+++ lisp/vc-hg.el	25 Oct 2009 17:52:46 -0000
@@ -159,6 +159,7 @@
   "Hg-specific version of `vc-state'."
   (let*
       ((status nil)
+       (default-directory (file-name-directory file))
        (out
         (with-output-to-string
           (with-current-buffer
@@ -166,8 +167,8 @@
             (setq status
                   (condition-case nil
                       ;; Ignore all errors.
-                      (call-process
-                       "hg" nil t nil "--cwd" (file-name-directory file)
+                      (process-file
+                       "hg" nil t nil
                        "status" "-A" (file-name-nondirectory file))
                     ;; Some problem happened.  E.g. We can't find an `hg'
                     ;; executable.
@@ -190,6 +191,7 @@
   "Hg-specific version of `vc-working-revision'."
   (let*
       ((status nil)
+       (default-directory (file-name-directory file))
        (out
         (with-output-to-string
           (with-current-buffer
@@ -197,8 +199,8 @@
             (setq status
                   (condition-case nil
                       ;; Ignore all errors.
-                      (call-process
-                       "hg" nil t nil "--cwd" (file-name-directory file)
+                      (process-file
+                       "hg" nil t nil
                        "log" "-l1" (file-name-nondirectory file))
                     ;; Some problem happened.  E.g. We can't find an `hg'
                     ;; executable.
@@ -286,7 +288,6 @@
       (setq oldvers working))
     (apply #'vc-hg-command (or buffer "*vc-diff*") nil
            (mapcar (lambda (file) (file-relative-name file cwd)) files)
-           "--cwd" cwd
            "diff"
            (append
             (vc-switches 'hg 'diff)




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-11-02 23:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-25 17:56 Patch to make vc-hg.el work with remote files Bernhard Herzog
2009-10-26  2:00 ` Stefan Monnier
2009-10-27 12:01   ` Bernhard Herzog
2009-10-28  2:07     ` Stefan Monnier
2009-10-28 18:05       ` Bernhard Herzog
2009-11-02 21:34         ` Bernhard Herzog
2009-11-02 21:58           ` Dan Nicolaescu
2009-11-02 23:52             ` Bernhard Herzog
2009-11-02 22:00       ` Sam Steingold

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).