[PATCH "] revlog: preserve `_lazydelta` attribute in `revlog.clone`
Yuya Nishihara
yuya at tcha.org
Tue Mar 5 08:40:18 EST 2019
On Mon, 04 Mar 2019 15:55:42 +0100, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at octobus.net>
> # Date 1551710814 -3600
> # Mon Mar 04 15:46:54 2019 +0100
> # Node ID bbe72376f2a91b383370619b3a0f66cf4a5d8178
> # Parent 82d9728ace9535057d77df6c920385861ec00072
> # EXP-Topic lazydelta
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r bbe72376f2a9
> revlog: preserve `_lazydelta` attribute in `revlog.clone`
>
> The attribute was introduce in 688fc33e105d, Yuya Nishihara pointed out that
> this preservation was missing. This should be fixed by this changesets.
>
> diff --git a/mercurial/revlog.py b/mercurial/revlog.py
> --- a/mercurial/revlog.py
> +++ b/mercurial/revlog.py
> @@ -2396,7 +2396,9 @@ class revlog(object):
> if getattr(destrevlog, 'filteredrevs', None):
> raise ValueError(_('destination revlog has filtered revisions'))
>
> - # lazydeltabase controls whether to reuse a cached delta, if possible.
> + # lazydelta and lazydeltabase controls whether to reuse a cached delta,
> + # if possible.
> + oldlazydelta = destrevlog._lazydelta
> oldlazydeltabase = destrevlog._lazydeltabase
> oldamd = destrevlog._deltabothparents
IIUC, we need to override destrevlog._lazydelta flag depending on deltareuse
option.
> @@ -2460,6 +2462,7 @@ class revlog(object):
> if addrevisioncb:
> addrevisioncb(self, rev, node)
> finally:
> + destrevlog._lazydelta = oldlazydelta
> destrevlog._lazydeltabase = oldlazydeltabase
> destrevlog._deltabothparents = oldamd
More information about the Mercurial-devel
mailing list