hg annotate confused by branches

Benoit Boissinot benoit.boissinot at ens-lyon.org
Tue Mar 11 19:07:38 CDT 2008

On Tue, Mar 11, 2008 at 06:10:42PM +0100, Stefan Ring wrote:
> Hello all,
> maybe this is already known (I doubt that I'm the first one to notice) but 
> a quick scan of the archives and the bugtracker didn't show up anything.
> The following script does not behave the way I would expect it to:
> mkdir hg-annotate-bug
> cd hg-annotate-bug
> hg init
> echo "This line has been there since the beginning." > a.txt
> hg addremove
> hg commit -m base
> echo "Second line" >> a.txt
> hg commit -m trunk
> hg update -Cv 0
> echo "Second line" >> a.txt
> hg commit -m branch
> hg annotate a.txt
> The result is
> 0: This line has been there since the beginning.
> 1: Second line

If you use debugindex: "hg debugindex .hg/store/data/a.txt.i" you will
notice that there is only one entry. Since the entry is only dependant
on the parents ([nullid, nullid]) and the content ("Second line"), nothing
will be added for the second commit.

Using the slow path (reading changelog+manifest) could correct this, but
it would be *slow* for big repos. Otherwise I think it is possible to
store duplicates entries in the index and have a DAG based on rev
numbers (the nodeid might be shared by different rev numbers). But it
involves some important modifications in hg.




More information about the Mercurial mailing list