Mercurial > hg
changeset 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 | 9bb700223f00 |
children | d9ed7c5e915d |
files | mercurial/tags.py tests/test-tags.t |
diffstat | 2 files changed, 56 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/tags.py Mon Mar 28 17:24:41 2022 +0200 +++ b/mercurial/tags.py Tue Mar 29 18:15:49 2022 +0900 @@ -808,7 +808,7 @@ # There is some no-merge changeset where p1 is null and p2 is set # Processing them as merge is just slower, but still gives a good # result. - p2node = cl.node(p1rev) + p2node = cl.node(p2rev) p2fnode = self.getfnode(p2node, computemissing=False) if p1fnode != p2fnode: # we cannot rely on readfast because we don't know against what
--- 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 ..