From unknown Thu Jun 19 13:55:09 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#5961 <5961@debbugs.gnu.org> To: bug#5961 <5961@debbugs.gnu.org> Subject: Status: 23.1 regression: vc-hg does not show 0 version number for 'added files Reply-To: bug#5961 <5961@debbugs.gnu.org> Date: Thu, 19 Jun 2025 20:55:09 +0000 retitle 5961 23.1 regression: vc-hg does not show 0 version number for 'add= ed files reassign 5961 emacs submitter 5961 Dan Nicolaescu severity 5961 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 16 16:07:19 2010 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 From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 16 20:30:44 2010 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 To: Dan Nicolaescu Subject: Re: bug#5961: 23.1 regression: vc-hg does not show 0 version number for 'added files 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-Debbugs-Envelope-To: 5961 Cc: 5961@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: -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 debbugs-submit-bounces@debbugs.gnu.org Sat Apr 17 12:11:01 2010 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. From unknown Thu Jun 19 13:55:09 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 16 May 2010 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator