emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-bug-tracker] bug#5961: marked as done (23.1 regression: vc-hg doe


From: GNU bug Tracking System
Subject: [Emacs-bug-tracker] bug#5961: marked as done (23.1 regression: vc-hg does not show 0 version number for 'added files)
Date: Sat, 17 Apr 2010 16:11:02 +0000

Your message dated Sat, 17 Apr 2010 12:10:53 -0400
with message-id <address@hidden>
and subject line Re: bug#5961: 23.1 regression: vc-hg does not show 0 version 
number for 'added files
has caused the GNU bug report #5961,
regarding 23.1 regression: vc-hg does not show 0 version number for 'added files
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact address@hidden
immediately.)


-- 
5961: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=5961
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 23.1 regression: vc-hg does not show 0 version number for 'added files Date: Fri, 16 Apr 2010 16:06:57 -0400 User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)
After this change:

  Show working revision correctly for mercurial.
  * vc-hg.el (vc-hg-working-revision): Use hg parent instead of
  hg log as suggested by Alex Harsanyi <address@hidden>,


the mode-line show Hg@ instead of address@hidden for files in the VC 'added 
state.  This is a regression from 23.1.

The problem is that the "hg parent " command does not distinguish
between the 'added and 'unregistered files.

Should the patch below go into the 23.2 branch?

=== modified file 'lisp/vc-hg.el'
--- lisp/vc-hg.el       2010-04-07 05:56:35 +0000
+++ lisp/vc-hg.el       2010-04-16 19:36:29 +0000
@@ -196,16 +196,16 @@ If nil, use the value of `vc-diff-switch
   (let*
       ((status nil)
        (default-directory (file-name-directory file))
+       ;; Avoid localization of messages so we can parse the output.
+       (avoid-local-env (append (list "TERM=dumb" "LANGUAGE=C" "HGRC=")
+                                    process-environment))
        (out
         (with-output-to-string
           (with-current-buffer
               standard-output
             (setq status
                   (condition-case nil
-                     (let ((process-environment
-                            ;; Avoid localization of messages so we can parse 
the output.
-                            (append (list "TERM=dumb" "LANGUAGE=C" "HGRC=")
-                                    process-environment)))
+                     (let ((process-environment avoid-local-env))
                        ;; Ignore all errors.
                        (process-file
                         "hg" nil t nil
@@ -213,7 +213,21 @@ If nil, use the value of `vc-diff-switch
                     ;; Some problem happened.  E.g. We can't find an `hg'
                     ;; executable.
                     (error nil)))))))
-    (when (eq 0 status) out)))
+    (if (eq 0 status)
+       out
+      ;; Check if the file is in the 'added state, the above hg
+      ;; command does not distinguish between 'added and 'unregistered.
+      (setq status
+           (condition-case nil
+               (let ((process-environment avoid-local-env))
+                 ;; Ignore all errors.
+                 (process-file
+                  "hg" nil nil nil
+                  "log" "-l1" (file-relative-name file)))
+             ;; Some problem happened.  E.g. We can't find an `hg'
+             ;; executable.
+             (error nil)))
+      (when (eq 0 status) "0"))))
 
 ;;; History functions
 





--- End Message ---
--- Begin Message --- Subject: Re: bug#5961: 23.1 regression: vc-hg does not show 0 version number for 'added files Date: Sat, 17 Apr 2010 12:10:53 -0400 User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)
Chong Yidong <address@hidden> writes:

> Dan Nicolaescu <address@hidden> writes:
>
>> After this change:
>>
>>   Show working revision correctly for mercurial.
>>   * vc-hg.el (vc-hg-working-revision): Use hg parent instead of
>>   hg log as suggested by Alex Harsanyi <address@hidden>,
>>
>> the mode-line show Hg@ instead of address@hidden for files in the VC 'added
>> state.  This is a regression from 23.1.
>>
>> The problem is that the "hg parent " command does not distinguish
>> between the 'added and 'unregistered files.
>>
>> Should the patch below go into the 23.2 branch?
>
> Yes please.  I don't have hg installed at the moment, so it's
> inconvenient for me to double check your work, but if you're confident
> it's correct then please go ahead and commit it.

Thanks, done.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]