##// END OF EJS Templates
tags: fix abababa case, with test case
Matt Mackall -
r4266:fe7f38dd default
parent child Browse files
Show More
@@ -288,10 +288,10 b' class localrepository(repo.repository):'
288 warn(_("tag '%s' refers to unknown node") % key)
288 warn(_("tag '%s' refers to unknown node") % key)
289 continue
289 continue
290
290
291 h = {}
291 h = []
292 if key in filetags:
292 if key in filetags:
293 n, h = filetags[key]
293 n, h = filetags[key]
294 h[n] = True
294 h.append(n)
295 filetags[key] = (bin_n, h)
295 filetags[key] = (bin_n, h)
296
296
297 for k,nh in filetags.items():
297 for k,nh in filetags.items():
@@ -307,7 +307,7 b' class localrepository(repo.repository):'
307 if bn != an and an in bh and \
307 if bn != an and an in bh and \
308 (bn not in ah or len(bh) > len(ah)):
308 (bn not in ah or len(bh) > len(ah)):
309 an = bn
309 an = bn
310 ah.update(bh)
310 ah.append([n for n in bh if n not in ah])
311 globaltags[k] = an, ah
311 globaltags[k] = an, ah
312
312
313 # read the tags file from each head, ending with the tip
313 # read the tags file from each head, ending with the tip
@@ -80,6 +80,25 b' echo >> foo'
80 hg ci -m 'change foo 2' -d '1000000 0' # rev 4
80 hg ci -m 'change foo 2' -d '1000000 0' # rev 4
81 hg tags
81 hg tags
82
82
83 # test tag removal
83 hg tag --remove -d '1000000 0' bar
84 hg tag --remove -d '1000000 0' bar
84 hg tip
85 hg tip
85 hg tags
86 hg tags
87
88 # test tag rank
89 cd ..
90 hg init t3
91 cd t3
92 echo foo > foo
93 hg add foo
94 hg ci -m 'add foo' -d '1000000 0' # rev 0
95 hg tag -d '1000000 0' bar # rev 1 bar -> 0
96 hg tag -d '1000000 0' bar # rev 2 bar -> 1
97 hg tag -d '1000000 0' -r 0 bar # rev 3 bar -> 0
98 hg tag -d '1000000 0' -r 1 bar # rev 3 bar -> 1
99 hg tag -d '1000000 0' -r 0 bar # rev 4 bar -> 0
100 hg tags
101 hg co 3
102 echo barbar > foo
103 hg ci -m 'change foo' -d '1000000 0' # rev 0
104 hg tags
@@ -49,3 +49,8 b' date: Mon Jan 12 13:46:40 1970 +0'
49 summary: Removed tag bar
49 summary: Removed tag bar
50
50
51 tip 5:57e1983b4a60
51 tip 5:57e1983b4a60
52 tip 5:d8bb4d1eff25
53 bar 0:b409d9da318e
54 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
55 tip 6:b5ff9d142648
56 bar 0:b409d9da318e
General Comments 0
You need to be logged in to leave comments. Login now