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

login
register
mail settings
Submitter Sean Farley
Date March 28, 2014, 1:15 a.m.
Message ID <28d2fa6ccef8f6f50b93.1395969338@laptop.local>
Download mbox | patch
Permalink /patch/4092/
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 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.

Patch

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