[PATCH 5 of 9 V3] localrepo: add localtags method to mimic tags method
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Tue Apr 1 03:07:37 UTC 2014
On 03/28/2014 03:06 PM, Sean Farley wrote:
> # 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 2545603a2724a97dd78b17c207b188e9cef414a0
> # Parent ee90b9a274e93bf091e9c00f9bfc916eb98e2408
> 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
> @@ -638,10 +638,14 @@ class localrepository(object):
> tagtypes = {}
>
> tagsmod.readlocaltags(self.ui, self, alltags, tagtypes)
> return self._encodetags(alltags, tagtypes)
>
> + def localtags(self):
> + '''return a mapping of local tag to node'''
> + return self._findlocaltags()[0]
> +
This may had a chance to live on localrepo, however it has a single
planned caller so it will go in the tag module with its buddies.
--
Pierre-Yves
More information about the Mercurial-devel
mailing list