diff tests/test-tags.t @ 48989:d4b66dc500c5 stable

tags: fix typo in fast path detection of fnode resolution (issue6673) If I understand it, mctx.readfast() is unreliable here if p1/p2 .hgtags nodes differ, and tags on that branch would be randomly discarded depending on which parent were picked. The test case added by this patch would fail only on zstd-compressed repository. I didn't try hard to stabilize the failure case.
author Yuya Nishihara <yuya@tcha.org>
date Tue, 29 Mar 2022 18:15:49 +0900
parents abbecb5cd6f3
children 1dd01023649d
line wrap: on
line diff
--- a/tests/test-tags.t	Mon Mar 28 17:24:41 2022 +0200
+++ b/tests/test-tags.t	Tue Mar 29 18:15:49 2022 +0900
@@ -933,3 +933,58 @@
   a8a82d372bb35b42ff736e74f07c23bcd99c371f a
   a8a82d372bb35b42ff736e74f07c23bcd99c371f a
   0000000000000000000000000000000000000000 a
+
+  $ cd ..
+
+.hgtags fnode should be properly resolved at merge revision (issue6673)
+
+  $ hg init issue6673
+  $ cd issue6673
+
+  $ touch a
+  $ hg ci -qAm a
+  $ hg branch -q stable
+  $ hg ci -m branch
+
+  $ hg up -q default
+  $ hg merge -q stable
+  $ hg ci -m merge
+
+ add tag to stable branch:
+
+  $ hg up -q stable
+  $ echo a >> a
+  $ hg ci -m a
+  $ hg tag whatever
+  $ hg log -GT'{rev} {tags}\n'
+  @  4 tip
+  |
+  o  3 whatever
+  |
+  | o  2
+  |/|
+  o |  1
+  |/
+  o  0
+  
+
+ merge tagged stable into default:
+
+  $ hg up -q default
+  $ hg merge -q  stable
+  $ hg ci -m merge
+  $ hg log -GT'{rev} {tags}\n'
+  @    5 tip
+  |\
+  | o  4
+  | |
+  | o  3 whatever
+  | |
+  o |  2
+  |\|
+  | o  1
+  |/
+  o  0
+  
+
+  $ cd ..