[issue2967] hg tag inserts duplicate entries with the same changeset number
Tatham Oddie
bugs at mercurial.selenic.com
Mon Aug 22 21:03:35 CDT 2011
New submission from Tatham Oddie <tatham at oddie.com.au>:
Two symptoms:
1) hg tag -f duplicates a previous entry in addition to adding the new
one. That is, if you had one line in .hgtags before, you end up with 3.
2) hg tag --remove also duplicates the last entry, then writes an entry of
all zeros.
I would expect this series of commands to negate itself:
hg tag foo
hg tag foo -f
hg tag foo --remove
At the very least, I'd expect it not to have duplicate entries for the same
changeset number and tag name.
Instead, I'm left with 5 extra lines in the .hgtags file.
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\tatham.oddie>cd \temp
C:\Temp>hg version
Mercurial Distributed SCM (version 1.9.1)
(see http://mercurial.selenic.com for more information)
Copyright (C) 2005-2011 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
C:\Temp>hg init tag-zeroing-test
C:\Temp>cd tag-zeroing-test
C:\Temp\tag-zeroing-test>echo abc > foo.txt
C:\Temp\tag-zeroing-test>hg addr
adding foo.txt
C:\Temp\tag-zeroing-test>hg com -m "Added foo.
C:\Temp\tag-zeroing-test>hg tag test-tag
C:\Temp\tag-zeroing-test>echo def > foo.txt
C:\Temp\tag-zeroing-test>hg com -m "Updated foo.
C:\Temp\tag-zeroing-test>hg tag test-tag -f
C:\Temp\tag-zeroing-test>type .hgtags
69924af1be7e5727b797197bcd935f0f47599aad test-tag
69924af1be7e5727b797197bcd935f0f47599aad test-tag
5149ff7c592f5a323e6c55f01ad8520697a22084 test-tag
C:\Temp\tag-zeroing-test>hg tags
tip 3:7d09cdff8719
test-tag 2:5149ff7c592f
C:\Temp\tag-zeroing-test>hg tag test-tag --remove
C:\Temp\tag-zeroing-test>type .hgtags
69924af1be7e5727b797197bcd935f0f47599aad test-tag
69924af1be7e5727b797197bcd935f0f47599aad test-tag
5149ff7c592f5a323e6c55f01ad8520697a22084 test-tag
5149ff7c592f5a323e6c55f01ad8520697a22084 test-tag
0000000000000000000000000000000000000000 test-tag
C:\Temp\tag-zeroing-test>hg tags
tip 4:337089c85594
C:\Temp\tag-zeroing-test>cd ..
C:\Temp>rmdir tag-zeroing-test /s /q
----------
messages: 17204
nosy: tatham.oddie
priority: bug
status: unread
title: hg tag inserts duplicate entries with the same changeset number
topic: tags
____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2967>
____________________________________________________
More information about the Mercurial-devel
mailing list