From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: Patch to make vc-hg.el work with remote files Date: Mon, 2 Nov 2009 13:58:07 -0800 (PST) Message-ID: <200911022158.nA2Lw7eG018645@godzilla.ics.uci.edu> References: <200910251856.04156.bernhard.herzog@intevation.de> <200910281905.12147.bernhard.herzog@intevation.de> <200911022234.46656.bernhard.herzog@intevation.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1257199252 8774 80.91.229.12 (2 Nov 2009 22:00:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Nov 2009 22:00:52 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: Bernhard Herzog Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 02 23:00:44 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 1N54xA-0003ni-0G for ged-emacs-devel@m.gmane.org; Mon, 02 Nov 2009 23:00:44 +0100 Original-Received: from localhost ([127.0.0.1]:49499 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N54x9-0007B2-Kw for ged-emacs-devel@m.gmane.org; Mon, 02 Nov 2009 17:00:43 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N54wI-0006d6-Ub for emacs-devel@gnu.org; Mon, 02 Nov 2009 16:59:50 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N54wD-0006b0-7b for emacs-devel@gnu.org; Mon, 02 Nov 2009 16:59:49 -0500 Original-Received: from [199.232.76.173] (port=33089 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N54wD-0006ao-2X for emacs-devel@gnu.org; Mon, 02 Nov 2009 16:59:45 -0500 Original-Received: from john-pertwee-v0.ics.uci.edu ([128.195.1.165]:45437) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N54wC-0007fd-EM for emacs-devel@gnu.org; Mon, 02 Nov 2009 16:59:44 -0500 Original-Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by john-pertwee-v0.ics.uci.edu (8.13.8/8.13.8) with ESMTP id nA2Lw8IJ005839 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 2 Nov 2009 13:58:08 -0800 Original-Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id nA2Lw7eG018645; Mon, 2 Nov 2009 13:58:07 -0800 (PST) In-Reply-To: <200911022234.46656.bernhard.herzog@intevation.de> (Bernhard Herzog's message of "Mon, 2 Nov 2009 22:34:46 +0100") Original-Lines: 47 X-ICS-MailScanner-Information: Please send mail to helpdesk@ics.uci.edu or more information X-ICS-MailScanner-ID: nA2Lw8IJ005839 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-0.34, required 5, autolearn=disabled, ALL_TRUSTED -1.44, FM_MULTI_ODD2 1.10) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu 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:116588 Archived-At: Bernhard Herzog writes: > 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: Was this tested with filesets that contain: multiple files, multiple directories and a mix of files and directories. And starting from a subdirectory of the Hg root? The previous change caused this regression: http://permalink.gmane.org/gmane.emacs.devel/116585 does this patch fix it? > 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