--- a/tests/test-annotate.t Fri Jan 24 12:01:12 2025 -0500
+++ b/tests/test-annotate.t Fri Feb 07 16:40:22 2025 -0500
@@ -1217,6 +1217,60 @@
$ cd ..
+Annotate should use the starting revision (-r) as base for ancestor checks.
+TODO: Fix Python, which calls introfilectx() first and uses that for ancestor checks.
+
+ $ hg init repo-base
+ $ cd repo-base
+ $ echo A > file
+ $ hg commit -Am "initial"
+ adding file
+ $ echo B >> file
+ $ hg commit -m "linkrev"
+ $ hg up 0
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ echo B >> file
+ $ hg ci -m "linkrev alias"
+ created new head
+ $ echo C >> file
+ $ hg commit -m "change"
+ $ hg merge 1 --tool :local
+ 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+ $ hg commit -m "merge"
+ $ hg debugindex file
+ rev linkrev nodeid p1-nodeid p2-nodeid
+ 0 0 45f17b21388f 000000000000 000000000000
+ 1 1 e338fefefb89 45f17b21388f 000000000000
+ 2 3 b2f3b2eded93 e338fefefb89 000000000000
+ $ hg log -G --template '{rev}: {desc}'
+ @ 4: merge
+ |\
+ | o 3: change
+ | |
+ | o 2: linkrev alias
+ | |
+ o | 1: linkrev
+ |/
+ o 0: initial
+
+Line B should be attributed to the linkrev 1, because we base ancestor checks
+from 4 (starting revision), not from 3 (most recent change to the file).
+ $ hg annotate file
+ 0: A
+ 2: B (no-rhg known-bad-output !)
+ 1: B (rhg !)
+ 3: C
+ $ echo D >> file
+ $ hg commit -m "another change"
+ $ hg annotate file
+ 0: A
+ 1: B
+ 3: C
+ 5: D
+
+ $ cd ..
+
Issue5360: Deleted chunk in p1 of a merge changeset
$ hg init repo-5360