[PATCH 02 of 15] revlog: deltachain() returns the chain of revisions to construct a given revision

Benoit Boissinot benoit.boissinot at ens-lyon.org
Tue Jul 13 08:02:26 CDT 2010


On Mon, Jul 12, 2010 at 04:19:44PM +0530, Pradeepkumar Gayam wrote:
> # HG changeset patch
> # User Pradeepkumar Gayam <in3xes at gmail.com>
> # Date 1278874604 -19800
> # Branch stable
> # Node ID 15579a3a578521f9bf3e3ad9db0e462c1ffba9f2
> # Parent  3dce03cd1a40cfc48a4de05c091fc8da277aa6c4
> revlog: deltachain() returns the chain of revisions to construct a given revision
> 
> diff -r 3dce03cd1a40 -r 15579a3a5785 mercurial/revlog.py
> --- a/mercurial/revlog.py	Mon Jul 12 00:16:19 2010 +0530
> +++ b/mercurial/revlog.py	Mon Jul 12 00:26:44 2010 +0530
> @@ -997,6 +997,15 @@
>      def _chunkclear(self):
>          self._chunkcache = (0, '')
>  
> +    def deltaparent(self, rev):
> +        '''return previous revision or parentrev according to flags'''
> +        if self.base(rev) == rev:
> +            return nullrev
> +        elif self.flags(rev) & REVLOG_PARENTDELTA_FLAGS:
> +            return self.parentrevs(rev)[0]
> +        else:
> +            return rev-1

spaces around operators (you can check the output of check-code for
other style issues)

cheers,

Benoit

-- 
:wq


More information about the Mercurial-devel mailing list