Patchwork [2,of,4] localrepo: use _findlocaltags in _findtags

login
register
mail settings
Submitter Sean Farley
Date March 28, 2014, 1:15 a.m.
Message ID <b4dc63afdaed291555de.1395969337@laptop.local>
Download mbox | patch
Permalink /patch/4091/
State Superseded
Headers show

Comments

Sean Farley - March 28, 2014, 1:15 a.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1395964989 18000
#      Thu Mar 27 19:03:09 2014 -0500
# Node ID b4dc63afdaed291555dedbdf541ed15a83e97075
# Parent  795f649f5a9fabb7bf05d51bb8a2f82451a80512
localrepo: use _findlocaltags in _findtags

This makes the only caller of tags.readlocaltags localrepo._findlocaltags now.

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -597,11 +597,16 @@  class localrepository(object):
 
         alltags = {}                    # map tag name to (node, hist)
         tagtypes = {}
 
         tagsmod.findglobaltags(self.ui, self, alltags, tagtypes)
-        tagsmod.readlocaltags(self.ui, self, alltags, tagtypes)
+
+        tags, ltagtypes = self._findlocaltags()
+        # global tags take precedence, so we only update distinct local tags
+        ltagtypes = dict([(name, type) for name, type in ltagtypes.iteritems()
+                          if name not in tagtypes])
+        tagtypes.update(ltagtypes)
 
         # Build the return dicts.  Have to re-encode tag names because
         # the tags module always uses UTF-8 (in order not to lose info
         # writing to the cache), but the rest of Mercurial wants them in
         # local encoding.