mercurial/localrepo.py
changeset 4272 fe7f38dda34b
parent 4229 24c22a3f2ef8
child 4274 f38f90a177dc
child 4329 cea5ba038a1d
equal deleted inserted replaced
4249:89075f106414 4272:fe7f38dda34b
   286                     continue
   286                     continue
   287                 if bin_n not in self.changelog.nodemap:
   287                 if bin_n not in self.changelog.nodemap:
   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():
   298                 if k not in globaltags:
   298                 if k not in globaltags:
   299                     globaltags[k] = nh
   299                     globaltags[k] = nh
   305                 an, ah = nh
   305                 an, ah = nh
   306                 bn, bh = globaltags[k]
   306                 bn, bh = globaltags[k]
   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
   314         f = None
   314         f = None
   315         for rev, node, fnode in self._hgtagsnodes():
   315         for rev, node, fnode in self._hgtagsnodes():