From: Bernhard Herzog <bernhard.herzog@intevation.de>
To: emacs-devel@gnu.org
Subject: Re: Patch to make vc-hg.el work with remote files
Date: Tue, 27 Oct 2009 13:01:24 +0100 [thread overview]
Message-ID: <200910271301.24348.bernhard.herzog@intevation.de> (raw)
In-Reply-To: <jwvws2iykxy.fsf-monnier+emacs@gnu.org>
On 26.10.2009, Stefan Monnier wrote:
> > + (process-file
> > + "hg" nil t nil
> > "status" "-A" (file-name-nondirectory file))
>
> The canonical way to use process-file is to pass args of the form
> (file-relative-name).
Indeed. Here's a new patch.
Regards,
Bernhard
Index: lisp/vc-hg.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/vc-hg.el,v
retrieving revision 1.104
diff -u -r1.104 vc-hg.el
--- lisp/vc-hg.el 19 Oct 2009 05:04:28 -0000 1.104
+++ lisp/vc-hg.el 26 Oct 2009 23:33:04 -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,9 +167,9 @@
(setq status
(condition-case nil
;; Ignore all errors.
- (call-process
- "hg" nil t nil "--cwd" (file-name-directory file)
- "status" "-A" (file-name-nondirectory file))
+ (process-file
+ "hg" nil t nil
+ "status" "-A" (file-relative-name file))
;; Some problem happened. E.g. We can't find an `hg'
;; executable.
(error nil)))))))
@@ -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,9 +199,9 @@
(setq status
(condition-case nil
;; Ignore all errors.
- (call-process
- "hg" nil t nil "--cwd" (file-name-directory file)
- "log" "-l1" (file-name-nondirectory file))
+ (process-file
+ "hg" nil t nil
+ "log" "-l1" (file-relative-name file))
;; Some problem happened. E.g. We can't find an `hg'
;; executable.
(error nil)))))))
@@ -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)
next prev parent reply other threads:[~2009-10-27 12:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200910271301.24348.bernhard.herzog@intevation.de \
--to=bernhard.herzog@intevation.de \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).