From unknown Sat Aug 16 18:37:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#5961: 23.1 regression: vc-hg does not show 0 version number for 'added files Resent-From: Dan Nicolaescu Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Apr 2010 20:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 5961 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 5961@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.127144844012588 (code B ref -1); Fri, 16 Apr 2010 20:08:02 +0000 Received: (at submit) by debbugs.gnu.org; 16 Apr 2010 20:07:20 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2rot-0003Gz-5f for submit@debbugs.gnu.org; Fri, 16 Apr 2010 16:07:19 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2rop-0003Gu-0j for submit@debbugs.gnu.org; Fri, 16 Apr 2010 16:07:17 -0400 Received: from lists.gnu.org ([199.232.76.165]:57966) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1O2roj-0004Up-G0 for submit@debbugs.gnu.org; Fri, 16 Apr 2010 16:07:09 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O2roi-0008ML-6G for bug-gnu-emacs@gnu.org; Fri, 16 Apr 2010 16:07:08 -0400 Received: from [199.232.76.173] (port=47293 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O2roh-0008M4-H7 for bug-gnu-emacs@gnu.org; Fri, 16 Apr 2010 16:07:07 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1O2roZ-0004UN-B4 for bug-gnu-emacs@gnu.org; Fri, 16 Apr 2010 16:07:02 -0400 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on monty-python X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Received: from fencepost.gnu.org ([140.186.70.10]:49101) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1O2roY-0004UH-P1 for bug-gnu-emacs@gnu.org; Fri, 16 Apr 2010 16:06:59 -0400 Received: from dann by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1O2roX-0001lr-Ig for bug-gnu-emacs@gnu.org; Fri, 16 Apr 2010 16:06:57 -0400 From: Dan Nicolaescu Date: Fri, 16 Apr 2010 16:06:57 -0400 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -6.6 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) 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 , the mode-line show Hg@ instead of Hg@0 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 From unknown Sat Aug 16 18:37:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#5961: 23.1 regression: vc-hg does not show 0 version number for 'added files Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Apr 2010 00:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5961 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dan Nicolaescu Cc: 5961@debbugs.gnu.org Received: via spool by 5961-submit@debbugs.gnu.org id=B5961.127146424419010 (code B ref 5961); Sat, 17 Apr 2010 00:31:02 +0000 Received: (at 5961) by debbugs.gnu.org; 17 Apr 2010 00:30:44 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2vvo-0004wZ-CN for submit@debbugs.gnu.org; Fri, 16 Apr 2010 20:30:44 -0400 Received: from pantheon-po25.its.yale.edu ([130.132.50.119]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2vvn-0004wU-6p for 5961@debbugs.gnu.org; Fri, 16 Apr 2010 20:30:43 -0400 Received: from furry (dhcp128036014140.central.yale.edu [128.36.14.140]) (authenticated bits=0) by pantheon-po25.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o3H0UdGo004367 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 16 Apr 2010 20:30:39 -0400 Received: by furry (Postfix, from userid 1000) id CC0A7C055; Fri, 16 Apr 2010 20:30:39 -0400 (EDT) From: Chong Yidong References: Date: Fri, 16 Apr 2010 20:30:39 -0400 In-Reply-To: (Dan Nicolaescu's message of "Fri, 16 Apr 2010 16:06:57 -0400") Message-ID: <87y6gmsyxc.fsf@stupidchicken.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -2.8 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.8 (--) Dan Nicolaescu 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 , > > the mode-line show Hg@ instead of Hg@0 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. From unknown Sat Aug 16 18:37:12 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Dan Nicolaescu Subject: bug#5961 closed by Dan Nicolaescu (Re: bug#5961: 23.1 regression: vc-hg does not show 0 version number for 'added files) Message-ID: References: X-Gnu-PR-Message: they-closed 5961 X-Gnu-PR-Package: emacs Reply-To: 5961@debbugs.gnu.org Date: Sat, 17 Apr 2010 16:11:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1271520662-11855-1" This is a multi-part message in MIME format... ------------=_1271520662-11855-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is an automatic notification regarding your bug report which was filed against the emacs package: #5961: 23.1 regression: vc-hg does not show 0 version number for 'added fil= es It has been closed by Dan Nicolaescu . Their explanation is attached below along with your original report. If this explanation is unsatisfactory and you have not received a better one in a separate message then please contact Dan Nicolaescu by replying to this email. --=20 5961: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D5961 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1271520662-11855-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 5961-done) by debbugs.gnu.org; 17 Apr 2010 16:11:01 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O3Abk-000351-OE for submit@debbugs.gnu.org; Sat, 17 Apr 2010 12:11:01 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O3Abi-00034w-Rx for 5961-done@debbugs.gnu.org; Sat, 17 Apr 2010 12:10:59 -0400 Received: from dann by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1O3Abd-0002Pw-IS; Sat, 17 Apr 2010 12:10:53 -0400 To: Chong Yidong Subject: Re: bug#5961: 23.1 regression: vc-hg does not show 0 version number for 'added files References: <87y6gmsyxc.fsf@stupidchicken.com> From: Dan Nicolaescu Date: Sat, 17 Apr 2010 12:10:53 -0400 In-Reply-To: <87y6gmsyxc.fsf@stupidchicken.com> (Chong Yidong's message of "Fri\, 16 Apr 2010 20\:30\:39 -0400") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.6 (------) X-Debbugs-Envelope-To: 5961-done Cc: 5961-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) Chong Yidong writes: > Dan Nicolaescu 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 , >> >> the mode-line show Hg@ instead of Hg@0 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. ------------=_1271520662-11855-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 16 Apr 2010 20:07:20 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2rot-0003Gz-5f for submit@debbugs.gnu.org; Fri, 16 Apr 2010 16:07:19 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2rop-0003Gu-0j for submit@debbugs.gnu.org; Fri, 16 Apr 2010 16:07:17 -0400 Received: from lists.gnu.org ([199.232.76.165]:57966) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1O2roj-0004Up-G0 for submit@debbugs.gnu.org; Fri, 16 Apr 2010 16:07:09 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O2roi-0008ML-6G for bug-gnu-emacs@gnu.org; Fri, 16 Apr 2010 16:07:08 -0400 Received: from [199.232.76.173] (port=47293 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O2roh-0008M4-H7 for bug-gnu-emacs@gnu.org; Fri, 16 Apr 2010 16:07:07 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1O2roZ-0004UN-B4 for bug-gnu-emacs@gnu.org; Fri, 16 Apr 2010 16:07:02 -0400 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on monty-python X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Received: from fencepost.gnu.org ([140.186.70.10]:49101) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1O2roY-0004UH-P1 for bug-gnu-emacs@gnu.org; Fri, 16 Apr 2010 16:06:59 -0400 Received: from dann by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1O2roX-0001lr-Ig for bug-gnu-emacs@gnu.org; Fri, 16 Apr 2010 16:06:57 -0400 To: bug-gnu-emacs@gnu.org Subject: 23.1 regression: vc-hg does not show 0 version number for 'added files From: Dan Nicolaescu X-Debbugs-No-Ack: yes Date: Fri, 16 Apr 2010 16:06:57 -0400 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -6.6 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) 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 , the mode-line show Hg@ instead of Hg@0 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 ------------=_1271520662-11855-1--