Mercurial > hg > mercurial-crew-with-dirclash
changeset 4272:fe7f38dda34b
tags: fix abababa case, with test case
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 22 Mar 2007 23:52:50 -0500 |
parents | 89075f106414 |
children | 8185a1ca8628 |
files | mercurial/localrepo.py tests/test-tags tests/test-tags.out |
diffstat | 3 files changed, 27 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -288,10 +288,10 @@ class localrepository(repo.repository): warn(_("tag '%s' refers to unknown node") % key) continue - h = {} + h = [] if key in filetags: n, h = filetags[key] - h[n] = True + h.append(n) filetags[key] = (bin_n, h) for k,nh in filetags.items(): @@ -307,7 +307,7 @@ class localrepository(repo.repository): if bn != an and an in bh and \ (bn not in ah or len(bh) > len(ah)): an = bn - ah.update(bh) + ah.append([n for n in bh if n not in ah]) globaltags[k] = an, ah # read the tags file from each head, ending with the tip
--- a/tests/test-tags +++ b/tests/test-tags @@ -80,6 +80,25 @@ echo >> foo hg ci -m 'change foo 2' -d '1000000 0' # rev 4 hg tags +# test tag removal hg tag --remove -d '1000000 0' bar hg tip hg tags + +# test tag rank +cd .. +hg init t3 +cd t3 +echo foo > foo +hg add foo +hg ci -m 'add foo' -d '1000000 0' # rev 0 +hg tag -d '1000000 0' bar # rev 1 bar -> 0 +hg tag -d '1000000 0' bar # rev 2 bar -> 1 +hg tag -d '1000000 0' -r 0 bar # rev 3 bar -> 0 +hg tag -d '1000000 0' -r 1 bar # rev 3 bar -> 1 +hg tag -d '1000000 0' -r 0 bar # rev 4 bar -> 0 +hg tags +hg co 3 +echo barbar > foo +hg ci -m 'change foo' -d '1000000 0' # rev 0 +hg tags