[PATCH 3 of 4 V2] subrepo: add revdetails() method

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu May 15 02:10:39 CDT 2014



On 05/10/2014 04:38 PM, Angel Ezquerra wrote:
> # HG changeset patch
> # User Angel Ezquerra <angel.ezquerra at gmail.com>
> # Date 1399414642 -7200
> #      Wed May 07 00:17:22 2014 +0200
> # Node ID 6860a9cad193936489dcb0ddf0c9db5867545222
> # Parent  e2a1cd702ae0871c5d3269bedb82db857804d316
> subrepo: add revdetails() method
>
> This method is able to show the "revision details" for a given revision.
> Currently for mercurial subrepos it returns a string which resembles a lot what
> the default template writes to the console when doing hg log. For all other
> types of subrepos we just return the revision id as a string.
>
> We could not use the templater to get this info because the templater writes to
> the console (i.e. it does not return a string that we can use).

I believe this paragraph is outdated


>
> This method will be used on the next revision.
>
> diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
> --- a/mercurial/subrepo.py
> +++ b/mercurial/subrepo.py
> @@ -505,6 +505,9 @@
>       def shortid(self, revid):
>           return revid
>
> +    def revdetails(self, revid):

This function could use a small docstring about its goal, role and usage.

> +        return 'changeset:   %s' % str(revid)
> +
>   class hgsubrepo(abstractsubrepo):
>       def __init__(self, ctx, path, state):
>           self._path = path
> @@ -873,6 +876,15 @@
>       def shortid(self, revid):
>           return revid[:12]
>
> +    @annotatesubrepoerror
> +    def revdetails(self, revid):

Same here.

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list