[PATCH 6 of 7] revlog: indent block to make review easier
Ryan McElroy
rm at fb.com
Wed Mar 29 08:41:27 EDT 2017
On 3/28/17 8:49 AM, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark at fb.com>
> # Date 1490683470 25200
> # Mon Mar 27 23:44:30 2017 -0700
> # Node ID d3d803ed16fe8e9d43f7a4daeca079e4022c297a
> # Parent aecce2adbd64b25325e559798baa617e7311e85f
> revlog: indent block to make review easier
Heh, thanks for this a lot actually. This patch is incredibly difficult
to read but I verified that it is indeed only an indent, haha.
> This patch indents a block in revlog.revision to make reviewing the next
> patch easier.
>
> diff --git a/mercurial/revlog.py b/mercurial/revlog.py
> --- a/mercurial/revlog.py
> +++ b/mercurial/revlog.py
> @@ -1277,17 +1277,18 @@ class revlog(object):
> rev = self.rev(node)
>
> - chain, stopped = self._deltachain(rev, stoprev=cachedrev)
> - if stopped:
> - text = self._cache[2]
> -
> - # drop cache to save memory
> - self._cache = None
> + if text is None:
> + chain, stopped = self._deltachain(rev, stoprev=cachedrev)
> + if stopped:
> + text = self._cache[2]
>
> - bins = self._chunks(chain, df=_df)
> - if text is None:
> - text = bytes(bins[0])
> - bins = bins[1:]
> + # drop cache to save memory
> + self._cache = None
>
> - text = mdiff.patches(text, bins)
> + bins = self._chunks(chain, df=_df)
> + if text is None:
> + text = bytes(bins[0])
> + bins = bins[1:]
> +
> + text = mdiff.patches(text, bins)
>
> if flags is None:
>
More information about the Mercurial-devel
mailing list