From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bernhard Herzog Newsgroups: gmane.emacs.devel Subject: Re: Patch to make vc-hg.el work with remote files Date: Tue, 27 Oct 2009 13:01:24 +0100 Message-ID: <200910271301.24348.bernhard.herzog@intevation.de> References: <200910251856.04156.bernhard.herzog@intevation.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1256660619 16233 80.91.229.12 (27 Oct 2009 16:23:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 27 Oct 2009 16:23:39 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 27 17:23:32 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N2opP-0001fy-44 for ged-emacs-devel@m.gmane.org; Tue, 27 Oct 2009 17:23:23 +0100 Original-Received: from localhost ([127.0.0.1]:34828 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N2opO-0000XZ-7D for ged-emacs-devel@m.gmane.org; Tue, 27 Oct 2009 12:23:22 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N2kk3-000194-He for emacs-devel@gnu.org; Tue, 27 Oct 2009 08:01:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N2kjy-00016p-6Z for emacs-devel@gnu.org; Tue, 27 Oct 2009 08:01:34 -0400 Original-Received: from [199.232.76.173] (port=57220 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N2kjx-00016c-R2 for emacs-devel@gnu.org; Tue, 27 Oct 2009 08:01:30 -0400 Original-Received: from aktaia.intevation.org ([212.95.126.10]:43871 helo=kolab.intevation.de) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N2kjw-0007wL-Fb for emacs-devel@gnu.org; Tue, 27 Oct 2009 08:01:28 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by kolab.intevation.de (Postfix) with ESMTP id 9C1F494D143 for ; Tue, 27 Oct 2009 13:01:25 +0100 (CET) X-Virus-Scanned: by amavisd-new at intevation.de Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by kolab.intevation.de (Postfix) with ESMTP id 291FA94D144 for ; Tue, 27 Oct 2009 13:01:25 +0100 (CET) Original-Received: from euarne.hq.intevation.de (euarne.hq.intevation.de [192.168.11.56]) (Authenticated sender: bernhard.herzog@intevation.de) by kolab.intevation.de (Postfix) with ESMTP id 17ED894D143 for ; Tue, 27 Oct 2009 13:01:25 +0100 (CET) User-Agent: KMail/1.9.10 (enterprise35 20091010.1035632) In-Reply-To: X-KMail-QuotePrefix: > Content-Disposition: inline X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Tue, 27 Oct 2009 12:23:16 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:116422 Archived-At: 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)