[PATCH 3 of 7 V2] localrepo: add localtags method to mimic tags method

Sean Farley sean.michael.farley at gmail.com
Fri Mar 28 12:53:17 CDT 2014


# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1395969042 18000
#      Thu Mar 27 20:10:42 2014 -0500
# Node ID 7ec54f5a811e6858baf78025cb654434eedd5347
# Parent  1f94af880a792dd8997bebea7b64f58e0eb4fb33
localrepo: add localtags method to mimic tags method

This is just a wrapper for localrepo._findlocaltags that returns a dict, just
as localrepo.tags.

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -641,10 +641,14 @@ class localrepository(object):
                 tags[encoding.tolocal(name)] = node
         tagtypes = dict([(encoding.tolocal(name), value)
                          for (name, value) in tagtypes.iteritems()])
         return (tags, tagtypes)
 
+    def localtags(self):
+        '''return a mapping of local tag to node'''
+        return self._findlocaltags()[0]
+
     def tagtype(self, tagname):
         '''
         return the type of the given tag. result can be:
 
         'local'  : a local tag


More information about the Mercurial-devel mailing list