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

Sean Farley sean.michael.farley at gmail.com
Thu Mar 27 20:15:38 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 28d2fa6ccef8f6f50b93a810e0fe811d6639d930
# Parent  b4dc63afdaed291555dedbdf541ed15a83e97075
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
@@ -635,10 +635,13 @@ 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 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