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

login
register
mail settings
Submitter Sean Farley
Date March 28, 2014, 5:53 p.m.
Message ID <1f94af880a792dd8997b.1396029196@laptop.local>
Download mbox | patch
Permalink /patch/4102/
State Superseded
Headers show

Comments

Sean Farley - March 28, 2014, 5:53 p.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 1f94af880a792dd8997bebea7b64f58e0eb4fb33
# Parent  f51c9fb7d5e024e9c200787f06bb7409d7ce785c
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.