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

login
register
mail settings
Submitter Sean Farley
Date March 28, 2014, 5:53 p.m.
Message ID <7ec54f5a811e6858baf7.1396029197@laptop.local>
Download mbox | patch
Permalink /patch/4103/
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 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.

Patch

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