GNU bug report logs - #17570
* lisp/vc/vc-hg.el (vc-hg-working-revision): Fix returning working revision instead of last revision.

Previous Next

Package: emacs;

Reported by: Santiago Payà i Miralta <santiagopim <at> gmail.com>

Date: Fri, 23 May 2014 22:58:01 UTC

Severity: normal

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 17570-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Santiago Payà i Miralta <santiagopim <at> gmail.com>
Cc: 17570-done <at> debbugs.gnu.org
Subject: Re: bug#17570: * lisp/vc/vc-hg.el (vc-hg-working-revision): Fix
 returning working revision instead of last revision.
Date: Fri, 06 Jun 2014 12:29:47 -0400
> I wish to fix the lisp/vc/vc-hg.el (vc-hg-working-revision) function with
> the `hg parent' command.

Good idea, thanks.  But your patch's indentation was completely messed
up (as well as placement of line breaks).
I installed a cleaned up version into `emacs-24' (contrary to the
previous patch which I installed into `trunk' since it was a new
feature rather than a bug-fix).


        Stefan


=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog	2014-06-06 14:25:39 +0000
+++ lisp/ChangeLog	2014-06-06 16:27:21 +0000
@@ -1,3 +1,8 @@
+2014-06-06  Santiago Payà i Miralta  <santiagopim <at> gmail.com>
+
+	* vc/vc-hg.el (vc-hg-working-revision): Use "hg parent" and
+	vc-hg-command (bug#17570).
+
 2014-06-06  Stefan Monnier  <monnier <at> iro.umontreal.ca>
 
 	* international/mule-cmds.el (ucs-names): Add special entry for BEL

=== modified file 'lisp/vc/vc-hg.el'
--- lisp/vc/vc-hg.el	2014-05-11 02:01:08 +0000
+++ lisp/vc/vc-hg.el	2014-06-06 16:26:37 +0000
@@ -227,14 +227,11 @@
 
 (defun vc-hg-working-revision (file)
   "Hg-specific version of `vc-working-revision'."
-  (let ((default-directory (if (file-directory-p file)
-                               (file-name-as-directory file)
-                             (file-name-directory file))))
-    (ignore-errors
+  (or (ignore-errors
       (with-output-to-string
-        (process-file vc-hg-program nil standard-output nil
-                      "log" "-l" "1" "--template" "{rev}"
-                      (file-relative-name file))))))
+          (vc-hg-command standard-output 0 file
+                         "parent" "--template" "{rev}")))
+      "0"))
 
 ;;; History functions
 





This bug report was last modified 11 years and 65 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.