Comments
Patch
@@ -434,6 +434,7 @@
self.ui.warn(_("warning: tag %s conflicts with existing"
" branch name\n") % name)
+ tagtype = local and 'local' or 'global'
def writetags(fp, names, munge, prevtags):
fp.seek(0, 2)
if prevtags and prevtags[-1] != '\n':
@@ -441,7 +442,7 @@
for name in names:
m = munge and munge(name) or name
if (self._tagscache.tagtypes and
- name in self._tagscache.tagtypes):
+ self._tagscache.tagtypes.get(name) == tagtype):
old = self.tags().get(name, nullid)
fp.write('%s %s\n' % (hex(old), m))
fp.write('%s %s\n' % (hex(node), m))
@@ -389,4 +389,18 @@
localtag 0:bbd179dfa0a7 local
globaltag 0:bbd179dfa0a7
+Test that the global tag overwriting local one is created without
+historical information about local one.
+
+ $ cat .hgtags
+ bbd179dfa0a71671c253b3ae0aa1513b60d199fa globaltag
+ $ hg tag -f -r 1 localtag
+ $ hg tags -v
+ tip 2:17637385ece3
+ localtag 1:a0b6fe111088
+ globaltag 0:bbd179dfa0a7
+ $ cat .hgtags
+ bbd179dfa0a71671c253b3ae0aa1513b60d199fa globaltag
+ a0b6fe111088c8c29567d3876cc466aa02927cae localtag
+
$ cd ..