From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: nickrob@snap.net.nz (Nick Roberts) Newsgroups: gmane.emacs.devel Subject: incorrect working revision for the mercurial VC backend Date: Wed, 30 Dec 2009 15:31:19 +1300 Message-ID: <19258.47991.673928.374725@totara.tehura.co.nz> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1262141805 16672 80.91.229.12 (30 Dec 2009 02:56:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Dec 2009 02:56:45 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alex Harsanyi Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 30 03:56:38 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NPojl-0001Ij-5f for ged-emacs-devel@m.gmane.org; Wed, 30 Dec 2009 03:56:37 +0100 Original-Received: from localhost ([127.0.0.1]:46140 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NPojl-0007ey-Im for ged-emacs-devel@m.gmane.org; Tue, 29 Dec 2009 21:56:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NPojg-0007ea-Qn for emacs-devel@gnu.org; Tue, 29 Dec 2009 21:56:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NPojc-0007Y6-5G for emacs-devel@gnu.org; Tue, 29 Dec 2009 21:56:32 -0500 Original-Received: from [199.232.76.173] (port=37598 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NPojb-0007Xq-Ul for emacs-devel@gnu.org; Tue, 29 Dec 2009 21:56:27 -0500 Original-Received: from mail10.snap.net.nz ([202.37.101.41]:48703 helo=viper.snap.net.nz) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NPojb-0004sC-Ae for emacs-devel@gnu.org; Tue, 29 Dec 2009 21:56:27 -0500 Original-Received: from totara (60.60.255.123.dynamic.snap.net.nz [123.255.60.60]) by viper.snap.net.nz (Postfix) with ESMTP id E57923DB06C; Wed, 30 Dec 2009 15:31:20 +1300 (NZDT) Original-Received: by totara (Postfix, from userid 1000) id ABCF0C167; Wed, 30 Dec 2009 15:31:19 +1300 (NZDT) In-Reply-To: X-Mailer: VM 7.19 under Emacs 22.2.1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:119001 Archived-At: > I believe using the "hg parent" command is more accurate in computing > the working revision: > > hg parent --template "{rev}" FILE > > Also by using the --template option, the command will return just the > revision number, making the `string-match' call unnecessary. To get some practice with bzr, I've pushed the change below. Can you please tell me if it DTRT for you? -- Nick http://users.snap.net.nz/~nickrob 2009-12-30 Nick Roberts 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 , === modified file 'lisp/vc-hg.el' *** lisp/vc-hg.el 2009-12-14 17:12:18 +0000 --- lisp/vc-hg.el 2009-12-30 02:22:45 +0000 *************** If nil, use the value of `vc-diff-switch *** 209,222 **** ;; Ignore all errors. (process-file "hg" nil t 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) ! (if (string-match "changeset: *\\([0-9]*\\)" out) ! (match-string 1 out) ! "0")))) ;;; History functions --- 209,219 ---- ;; Ignore all errors. (process-file "hg" nil t nil ! "parent" "--template" "\"{rev}\"" (file-relative-name file))) ;; Some problem happened. E.g. We can't find an `hg' ;; executable. (error nil))))))) ! (when (eq 0 status) (read out)))) ;;; History functions