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: Mon, 2 Nov 2009 22:34:46 +0100 Message-ID: <200911022234.46656.bernhard.herzog@intevation.de> References: <200910251856.04156.bernhard.herzog@intevation.de> <200910281905.12147.bernhard.herzog@intevation.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1257197711 2836 80.91.229.12 (2 Nov 2009 21:35:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Nov 2009 21:35:11 +0000 (UTC) Cc: Stefan Monnier To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 02 22:35:04 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 1N54YJ-0007sG-V2 for ged-emacs-devel@m.gmane.org; Mon, 02 Nov 2009 22:35:04 +0100 Original-Received: from localhost ([127.0.0.1]:58568 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N54YJ-0003lB-1Y for ged-emacs-devel@m.gmane.org; Mon, 02 Nov 2009 16:35:03 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N54YB-0003k1-QS for emacs-devel@gnu.org; Mon, 02 Nov 2009 16:34:55 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N54Y7-0003jN-5x for emacs-devel@gnu.org; Mon, 02 Nov 2009 16:34:55 -0500 Original-Received: from [199.232.76.173] (port=34313 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N54Y7-0003jK-0U for emacs-devel@gnu.org; Mon, 02 Nov 2009 16:34:51 -0500 Original-Received: from aktaia.intevation.org ([212.95.126.10]:39133 helo=kolab.intevation.de) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N54Y6-000476-G1 for emacs-devel@gnu.org; Mon, 02 Nov 2009 16:34:50 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by kolab.intevation.de (Postfix) with ESMTP id 38C4394D143; Mon, 2 Nov 2009 22:34:48 +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 C4E8C94D144; Mon, 2 Nov 2009 22:34:47 +0100 (CET) Original-Received: from thoe.hq.intevation.de (thoe.hq.intevation.de [192.168.11.35]) (Authenticated sender: bernhard.herzog@intevation.de) by kolab.intevation.de (Postfix) with ESMTP id B336A94D143; Mon, 2 Nov 2009 22:34:47 +0100 (CET) User-Agent: KMail/1.9.10 (enterprise35 20090918.1030082) In-Reply-To: <200910281905.12147.bernhard.herzog@intevation.de> X-KMail-QuotePrefix: > Content-Disposition: inline X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:116586 Archived-At: On 28.10.2009, Bernhard Herzog wrote: > I've looked a bit closer at it now and AFAICT vc-hg-diff can be made even > simpler and probably more correct by passing files unmodified to > vc-hg-command. I don't have the time right now to test and produce a > better patch, though. I hope to get around to that tomorrow. It took a while longer, but here's the new patch: Index: lisp/vc-hg.el =================================================================== RCS file: /sources/emacs/emacs/lisp/vc-hg.el,v retrieving revision 1.105 diff -u -r1.105 vc-hg.el --- lisp/vc-hg.el 28 Oct 2009 02:05:50 -0000 1.105 +++ lisp/vc-hg.el 2 Nov 2009 21:16:15 -0000 @@ -279,16 +279,12 @@ (defun vc-hg-diff (files &optional oldvers newvers buffer) "Get a difference report using hg between two revisions of FILES." (let* ((firstfile (car files)) - (cwd (if firstfile (file-name-directory firstfile) - (expand-file-name default-directory))) (working (and firstfile (vc-working-revision firstfile)))) (when (and (equal oldvers working) (not newvers)) (setq oldvers nil)) (when (and (not oldvers) newvers) (setq oldvers working)) - (apply #'vc-hg-command (or buffer "*vc-diff*") nil - (mapcar (lambda (file) (file-relative-name file cwd)) files) - "diff" + (apply #'vc-hg-command (or buffer "*vc-diff*") nil files "diff" (append (vc-switches 'hg 'diff) (when oldvers regards Bernhard