[issue1839] annotate ignores topology of changelog graph (sometimes?)

Greg Ward bugs at mercurial.selenic.com
Wed Sep 23 16:23:40 UTC 2009


New submission from Greg Ward <greg-hg at gerg.ca>:

It appears that 'hg annotate' ignores topology and simply iterates
over revisions.  Consider this history:

"""
@  changeset:  3:36b0380f33d2
|  summary:    unrelated change
|
|  diff --git a/hello.txt b/hello.txt
|  --- a/hello.txt
|  +++ b/hello.txt
|  @@ -1,2 +1,2 @@
|  -hello
|  +goodbye
|   world
|
o  changeset:  2:5bb8f2b05956
|  summary:    duplicate (not merge) patch from branch
|
|  diff --git a/hello.txt b/hello.txt
|  --- a/hello.txt
|  +++ b/hello.txt
|  @@ -1,1 +1,2 @@
|   hello
|  +world
|
| o  changeset:  1:0e02d370eb6f
|/   summary:    edit on branch (will not merge)
|
|    diff --git a/hello.txt b/hello.txt
|    --- a/hello.txt
|    +++ b/hello.txt
|    @@ -1,1 +1,2 @@
|     hello
|    +world
|
o  changeset:  0:62107b5aea16
  summary:    init

  diff --git a/hello.txt b/hello.txt
  new file mode 100644
  --- /dev/null
  +++ b/hello.txt
  @@ -0,0 +1,1 @@
  +hello
"""

If I run

  hg annotate -r3 hello.txt

then I want to know "how did each line get into revision 3?", not "how
did each line get into the repository as a whole?".  But it seems like
I'm getting the answer to the latter question:

"""
$ hg annotate -r3 hello.txt
3: goodbye
1: world
"""

The problem is that rev 1 is not an ancestor of rev 3, since it never
got merged.  So changes in 1 cannot affect what's in 3.  Instead, the
patch in 1 was duplicated in 2, and *that* is the changeset I wanted
"annotate" to pinpoint.

----------
messages: 10554
nosy: gward
priority: bug
status: unread
title: annotate ignores topology of changelog graph (sometimes?)

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue1839>
____________________________________________________



More information about the Mercurial-devel mailing list