comparison mercurial/revlogutils/deltas.py @ 39487:931386a0b108

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.
author Boris Feld <boris.feld@octobus.net>
date Tue, 04 Sep 2018 21:05:21 +0200
parents 37957e07138c
children d629b6d2f05a
comparison
equal deleted inserted replaced
39486:43d92d68ac88 39487:931386a0b108
619 """ 619 """
620 gdelta = revlog._generaldelta 620 gdelta = revlog._generaldelta
621 curr = len(revlog) 621 curr = len(revlog)
622 prev = curr - 1 622 prev = curr - 1
623 623
624 # should we try to build a delta?
625 if prev != nullrev and revlog._storedeltachains:
626 tested = set()
627 # This condition is true most of the time when processing
628 # changegroup data into a generaldelta repo. The only time it
629 # isn't true is if this is the first revision in a delta chain
630 # or if ``format.generaldelta=true`` disabled ``lazydeltabase``.
631 if cachedelta and gdelta and revlog._lazydeltabase:
632 # Assume what we received from the server is a good choice
633 # build delta will reuse the cache
634 yield (cachedelta[0],)
635 tested.add(cachedelta[0])
636
637 # This condition is true most of the time when processing 624 # This condition is true most of the time when processing
638 # changegroup data into a generaldelta repo. The only time it 625 # changegroup data into a generaldelta repo. The only time it
639 # isn't true is if this is the first revision in a delta chain 626 # isn't true is if this is the first revision in a delta chain
640 # or if ``format.generaldelta=true`` disabled ``lazydeltabase``. 627 # or if ``format.generaldelta=true`` disabled ``lazydeltabase``.
641 if cachedelta and gdelta and revlog._lazydeltabase: 628 if cachedelta and gdelta and revlog._lazydeltabase: