GNU bug report logs - #5232
23.1.90; vc-hg-working-revision always gives latest revision in which file changed

Previous Next

Package: emacs;

Reported by: Magnus Henoch <magnus <at> erlang-consulting.com>

Date: Wed, 16 Dec 2009 17:20:06 UTC

Severity: normal

Done: Dan Nicolaescu <dann <at> ics.uci.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dan Nicolaescu <dann <at> ics.uci.edu>
To: Magnus Henoch <magnus <at> erlang-consulting.com>
Cc: 5232 <at> debbugs.gnu.org
Subject: bug#5232: 23.1.90; vc-hg-working-revision always gives latest revision in which file changed
Date: Thu, 17 Dec 2009 08:24:36 -0800 (PST)
Dan Nicolaescu <dann <at> ics.uci.edu> writes:

  > Magnus Henoch <magnus <at> erlang-consulting.com> writes:
  > 
  >   > When the revision currently checked out is not the latest revision that
  >   > touched the file in question, vc-hg-working-revision gives the wrong
  >   > result.  This can happen in two cases: you have checked out a non-head
  >   > revision, or the file has been changed in another branch.  Two test
  >   > cases:
  >   > 
  >   > /tmp $ mkdir hgtest
  >   > /tmp $ cd hgtest
  >   > /tmp/hgtest $ hg init
  >   > /tmp/hgtest $ echo foo > foo.txt
  >   > /tmp/hgtest $ hg add foo.txt
  >   > /tmp/hgtest $ hg commit -m "Added foo.txt"
  >   > /tmp/hgtest $ echo bar > foo.txt
  >   > /tmp/hgtest $ hg commit -m "Changed foo to bar"
  >   > /tmp/hgtest $ hg up -r 0
  >   > 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  >   > 
  >   > /tmp $ mkdir hgtest2
  >   > /tmp $ cd hgtest2
  >   > /tmp/hgtest2 $ hg init
  >   > /tmp/hgtest2 $ echo foo > foo.txt
  >   > /tmp/hgtest2 $ hg add foo.txt
  >   > /tmp/hgtest2 $ hg commit -m "Added foo.txt"
  >   > /tmp/hgtest2 $ hg branch bar
  >   > marked working directory as branch bar
  >   > /tmp/hgtest2 $ echo bar > foo.txt
  >   > /tmp/hgtest2 $ hg commit -m "Changed foo to bar"
  >   > /tmp/hgtest2 $ hg update -r default
  >   > 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  >   > /tmp/hgtest2 $ echo frobozz > frobozz.txt
  >   > /tmp/hgtest2 $ hg add frobozz.txt 
  >   > /tmp/hgtest2 $ hg commit -m "Added frobozz.txt"
  >   > created new head
  >   > 
  >   > In either case, the symptoms are the same: if you open foo.txt in emacs,
  >   > the mode line says "Hg-1" instead of the expected "Hg-0", and if you hit
  > 
  > Do you get this behavior with "emacs -Q" ?
  > 
  > I can't reproduce this, I get Hg-0.  And the command used to get the version:
  > hg log -l1 foo.txt 
  > outputs version 0

Doh, never mind, I have my shell set to not clobber files, so
the file was not overwritten.

Your change seems to work fine for /tmp/hgtest/foo.txt

It does not for /tmp/hgtest2/foo.txt.  C-x v g quite likely does not
work because it tries to annotate version "1".

Not sure how to get the correct version.  Can it be obtained with 
"log --template" ?




This bug report was last modified 15 years and 132 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.