From patchwork Sat Sep 8 10:56:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [01,of,19] revlog: drop duplicated code From: Boris Feld X-Patchwork-Id: 34425 Message-Id: To: mercurial-devel@mercurial-scm.org Cc: gregory.szorc@gmail.com Date: Sat, 08 Sep 2018 12:56:55 +0200 # HG changeset patch # User Boris Feld # Date 1536087921 -7200 # Tue Sep 04 21:05:21 2018 +0200 # Node ID bdcfd96d87254a508e85a6eb502ffe4c57845bc8 # Parent 6268fed317d04dd8f0430468818ea5d0529b6503 # EXP-Topic sparse-snapshot # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r bdcfd96d8725 revlog: drop duplicated code This code probably got duplicated by a rebase/evolve conflict. We drop the extra copy, the other copy is right below. This had no real effects since other logic ensure that we never test the same revision twice. diff --git a/mercurial/revlogutils/deltas.py b/mercurial/revlogutils/deltas.py --- a/mercurial/revlogutils/deltas.py +++ b/mercurial/revlogutils/deltas.py @@ -621,19 +621,6 @@ def _rawgroups(revlog, p1, p2, cachedelt curr = len(revlog) prev = curr - 1 - # should we try to build a delta? - if prev != nullrev and revlog._storedeltachains: - tested = set() - # This condition is true most of the time when processing - # changegroup data into a generaldelta repo. The only time it - # isn't true is if this is the first revision in a delta chain - # or if ``format.generaldelta=true`` disabled ``lazydeltabase``. - if cachedelta and gdelta and revlog._lazydeltabase: - # Assume what we received from the server is a good choice - # build delta will reuse the cache - yield (cachedelta[0],) - tested.add(cachedelta[0]) - # This condition is true most of the time when processing # changegroup data into a generaldelta repo. The only time it # isn't true is if this is the first revision in a delta chain