From debbugs-submit-bounces@debbugs.gnu.org Fri May 23 18:57:36 2014 Received: (at submit) by debbugs.gnu.org; 23 May 2014 22:57:36 +0000 Received: from localhost ([127.0.0.1]:58336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WnyP9-0008Pm-T3 for submit@debbugs.gnu.org; Fri, 23 May 2014 18:57:36 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40205) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WnyP7-0008PZ-M8 for submit@debbugs.gnu.org; Fri, 23 May 2014 18:57:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WnyP1-0002Qc-7X for submit@debbugs.gnu.org; Fri, 23 May 2014 18:57:28 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:41839) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnyP1-0002QY-4U for submit@debbugs.gnu.org; Fri, 23 May 2014 18:57:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnyOz-0002ya-Rv for bug-gnu-emacs@gnu.org; Fri, 23 May 2014 18:57:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WnyOw-0002Q2-6F for bug-gnu-emacs@gnu.org; Fri, 23 May 2014 18:57:25 -0400 Received: from mail-la0-x22a.google.com ([2a00:1450:4010:c03::22a]:62140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnyOv-0002Po-Oe for bug-gnu-emacs@gnu.org; Fri, 23 May 2014 18:57:22 -0400 Received: by mail-la0-f42.google.com with SMTP id el20so4679216lab.1 for ; Fri, 23 May 2014 15:57:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=i9LTDfGxTh5QrFG4aTpV/0soWFoMaGrv2QrM71uFVQE=; b=tzme0JQNdx/OU6D6A7zIlI0wxKdnNedvujD3LbqIHf5M23KU8SpFnHWcVOFB4FBNkd 4jTi9lUcmU3hhDAPWUetElbJLxXqqYrslzje1BJmNwbpZ3GURhS5wwQFQxzqYbS4rPNw x4PeJRiuHp0HEjcznYJDaMy0Q5XS3WJ6A1FET9PQtbym70q0LGgBFzzxQ+41LJU3qhNQ cidbJaNprnX/J59NorHMYx8/OMu5oR9ZUSiwSNwpeIryUYQU1bx5cMsyZbPXK5lWOuzq 9jUEMX+TxjcG798POginb5lbTn4BCYWeOc6EUtRWXv1HOdGJJu+Ff46Zh+P3wvLo0Wn5 GaFQ== MIME-Version: 1.0 X-Received: by 10.112.62.231 with SMTP id b7mr3652465lbs.65.1400885839297; Fri, 23 May 2014 15:57:19 -0700 (PDT) Received: by 10.112.20.106 with HTTP; Fri, 23 May 2014 15:57:19 -0700 (PDT) Date: Sat, 24 May 2014 00:57:19 +0200 Message-ID: Subject: * lisp/vc/vc-hg.el (vc-hg-working-revision): Fix returning working revision instead of last revision. From: =?UTF-8?Q?Santiago_Pay=C3=A0_i_Miralta?= To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary=001a11c3c442d2822e04fa1926c3 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --001a11c3c442d2822e04fa1926c3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi emacs, I wish to fix the lisp/vc/vc-hg.el (vc-hg-working-revision) function with the `hg parent' command. Actually this function uses the `hg log -l 1' command that returns the last commited revision, not the last checked out revision. When checking out a specified revision with `hg update REV' the actual revision of FILE is returned by `hg parent'. vc.el: ;; * working-revision (file) ;; ;; Return the working revision of FILE. This is the revision fetched ;; by the last checkout or update, not necessarily the same thing as the ;; head or tip revision. Should return "0" for a file added but not yet ;; committed. On success `hg parent' command returns 0 and prints the parent of FILE. For not registered, as added but not commited files, throws error code and prints a message, so could check the returning value to substitute the printed message with "0" as vc.el requires. Here it is proposed the catch/throw mechanism. 2014-05-24 Santiago Pay=C3=A0 i Miralta * lisp/vc/vc-hg.el (vc-hg-working-revision): Fix returning working revision instead of last revision. >From 426ae4ae2f4ed6f26fc65bb5023fe79ba79686ae Mon Sep 17 00:00:00 2001 From: Santiago Pay=C3=A0 i Miralta Date: Sat, 24 May 2014 00:20:19 +0200 Subject: [PATCH] * lisp/vc/vc-hg.el (vc-hg-working-revision): Fix returning working revision instead of last revision. Actually this function uses the `hg log -l 1' command that returns the last commited revision, not the last checked out revision. When checking out a specified revision with `hg update REV' the actual revision of FILE is returned by `hg parent'. vc.el: ;; * working-revision (file) ;; ;; Return the working revision of FILE. This is the revision fetched ;; by the last checkout or update, not necessarily the same thing as the ;; head or tip revision. Should return "0" for a file added but not yet ;; committed. On success `hg parent' command returns 0 and prints the parent of FILE. For not registered, as added but not commited files, throws error code and prints a message, so could check the returning value to substitute the printed message with "0" as vc.el requires. Here it is proposed the catch/throw mechanism. --- lisp/vc/vc-hg.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 05b53a3..0326456 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -230,11 +230,14 @@ highlighting the Log View buffer." (let ((default-directory (if (file-directory-p file) (file-name-as-directory file) (file-name-directory file)))) - (ignore-errors - (with-output-to-string - (process-file vc-hg-program nil standard-output nil - "log" "-l" "1" "--template" "{rev}" - (file-relative-name file)))))) + (catch 'wrap + (ignore-errors + (with-output-to-string + (if (/=3D 0 + (process-file vc-hg-program nil standard-output nil + "parent" "--template" "{rev}" + (file-relative-name file)) + )(throw 'wrap "0"))))))) ;;; History functions --=20 1.7.9.5 --001a11c3c442d2822e04fa1926c3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi emacs,

I wish to fix the lisp/vc/vc-hg.el (vc-hg-working-re= vision) function with the `hg parent' command.

Actually this function uses the `hg log -l 1' command that retu= rns the last commited revision, not the last checked out revision. When che= cking out a specified revision with `hg update REV' the actual revision= of FILE is returned by `hg parent'.

vc.el:
;; * working-revisi= on (file)
;;
;; =C2=A0 Return t= he working revision of FILE. =C2=A0This is the revision fetched
;; =C2=A0 by the last checkout or update, not necessarily the sam= e thing as the
;; =C2=A0 head or tip revision. =C2=A0= Should return "0" for a file added but not yet
;; =C2=A0 committed.

On success `hg pare= nt' command returns 0 and prints the parent of FILE. For not registered= , as added but not commited files, throws error code and prints a message, = so could check the returning value to substitute the printed message with &= quot;0" as vc.el requires. Here it is proposed the catch/throw mechani= sm.

2014-05-24 = Santiago Pay=C3=A0 i Miralta <s= antiagopim@gmail.com>

=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0* lisp/vc/vc-hg.e= l (vc-hg-working-revision): Fix
=C2=A0 =C2=A0 =C2=A0 =C2=A0 returning working revision inst= ead of last revision.

From 426ae4ae2f4ed6= f26fc65bb5023fe79ba79686ae Mon Sep 17 00:00:00 2001
From: Santiago Pay=C3=A0 i Miralta <santiagopim@gmail.com>
Date: Sat, 24 May 2014 00:20:19 +0200
Subject: [PATCH] * lisp/vc/vc-hg.el (vc-hg-working-revision): Fix re= turning
=C2=A0working revision instead of last revision.

Actually this function = uses the `hg log -l 1' command that returns the last commited revision,= not the last checked out revision. When checking out a specified revision = with `hg update REV' the actual revision of FILE is returned by `hg par= ent'.

<= font color=3D"#000066" face=3D"courier new, monospace">vc.el:
<= div class=3D"gmail_default" style> ;; * working-revisi= on (file)
;;
;; =C2=A0 Return th= e working revision of FILE. =C2=A0This is the revision fetched
=
;; =C2=A0 by the last checkout or update, not necessarily t= he same thing as the
;; =C2=A0 head or tip revision. =C2=A0Should return "0= " for a file added but not yet
;; =C2=A0 c= ommitted.

On success `hg parent'= command returns 0 and prints the parent of FILE. For not registered, as ad= ded but not commited files, throws error code and prints a message, so coul= d check the returning value to substitute the printed message with "0&= quot; as vc.el requires. Here it is proposed the catch/throw mechanism.
---
=C2=A0lisp/vc/vc-hg.el | = =C2=A0 13 ++++++++-----
=C2=A01 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.= el
index 05b53a3..0326456 100644
--- a/lisp/vc/vc-hg.el
+++ b/li= sp/vc/vc-hg.el
@@ -230,11 +230,14 @@ highlighting the Log View buffer.&quo= t;
=C2=A0 =C2=A0(let ((default-directory (if (f= ile-directory-p file)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (file-name-as-director= y file)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (file-na= me-directory file))))
- =C2=A0 =C2=A0(ignore-errors
-= =C2=A0 =C2=A0 =C2=A0(with-output-to-string
- =C2=A0 =C2=A0 =C2=A0 =C2=A0(process-file vc-hg-program ni= l standard-output nil
- =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"log" &quo= t;-l" "1" "--template" "{rev}"
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(file-relative-name file))))))
+ =C2=A0 =C2=A0(catch 'wrap
+ =C2=A0 =C2=A0 =C2=A0(ignore-errors
+ (with-output-to-s= tring
+ =C2=A0= (if (/=3D 0
+ =C2=A0(process-file vc-hg-program nil standard-output ni= l
+ &quo= t;parent" "--template" "{rev}"
+ (file-relative-name file))
=
+ =C2= =A0)(throw 'wrap "0")))))))
=C2=A0
=C2=A0;;; History functi= ons
=C2=A0
=
--=C2=A0
1.7.9.5

--001a11c3c442d2822e04fa1926c3-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 06 12:29:56 2014 Received: (at 17570-done) by debbugs.gnu.org; 6 Jun 2014 16:29:56 +0000 Received: from localhost ([127.0.0.1]:39761 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wsx1g-0001KK-DK for submit@debbugs.gnu.org; Fri, 06 Jun 2014 12:29:56 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:43110) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wsx1e-0001K8-3d for 17570-done@debbugs.gnu.org; Fri, 06 Jun 2014 12:29:55 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArUGAIDvNVPO+IOj/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBViMFCws0BwsUDQsNJBOHZQMJCMpdDYcvF4xeghwHhDgElmGOWINggWqBcYFbIQ X-IPAS-Result: ArUGAIDvNVPO+IOj/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBViMFCws0BwsUDQsNJBOHZQMJCMpdDYcvF4xeghwHhDgElmGOWINggWqBcYFbIQ X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="66041921" Received: from 206-248-131-163.dsl.teksavvy.com (HELO pastel.home) ([206.248.131.163]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 06 Jun 2014 12:29:48 -0400 Received: by pastel.home (Postfix, from userid 20848) id 32930600D1; Fri, 6 Jun 2014 12:29:48 -0400 (EDT) From: Stefan Monnier To: Santiago =?windows-1252?Q?Pay=E0?= i Miralta Subject: Re: bug#17570: * lisp/vc/vc-hg.el (vc-hg-working-revision): Fix returning working revision instead of last revision. Message-ID: References: Date: Fri, 06 Jun 2014 12:29:47 -0400 In-Reply-To: ("Santiago =?windows-1252?Q?Pay=E0?= i Miralta"'s message of "Sat, 24 May 2014 00:57:19 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 17570-done Cc: 17570-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > 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 =3D=3D=3D 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=E0 i Miralta + + * vc/vc-hg.el (vc-hg-working-revision): Use "hg parent" and + vc-hg-command (bug#17570). + 2014-06-06 Stefan Monnier =20 * international/mule-cmds.el (ucs-names): Add special entry for BEL =3D=3D=3D 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 @@ =20 (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")) =20 ;;; History functions =20 From unknown Thu Aug 21 12:11:50 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 05 Jul 2014 11:24:05 +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