From: nickrob@snap.net.nz (Nick Roberts)
To: Alex Harsanyi <alexharsanyi@gmail.com>
Cc: emacs-devel@gnu.org
Subject: incorrect working revision for the mercurial VC backend
Date: Wed, 30 Dec 2009 15:31:19 +1300 [thread overview]
Message-ID: <19258.47991.673928.374725@totara.tehura.co.nz> (raw)
In-Reply-To: <cf628bc60912291753q6df29db7ra4a1825a89766384@mail.gmail.com>
> 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 <nickrob@snap.net.nz>
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 <alexharsanyi@gmail.com>,
=== 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
next prev parent reply other threads:[~2009-12-30 2:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-30 1:53 incorrect working revision for the mercurial VC backend Alex Harsanyi
2009-12-30 2:31 ` Nick Roberts [this message]
[not found] ` <cf628bc60912291930x46faaa61j488e15cc5b953689@mail.gmail.com>
2009-12-30 3:42 ` Nick Roberts
2009-12-30 6:15 ` Alex Harsanyi
2009-12-30 7:02 ` Nick Roberts
2009-12-30 8:02 ` Eli Zaretskii
2009-12-30 9:37 ` Alex Harsanyi
2009-12-30 3:29 ` Dan Nicolaescu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=19258.47991.673928.374725@totara.tehura.co.nz \
--to=nickrob@snap.net.nz \
--cc=alexharsanyi@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).