mercurial/revlogutils/deltas.py
changeset 39501 993d7e2c8b79
parent 39500 cc85ebb68ff9
child 39502 e4d4361d0bcd
equal deleted inserted replaced
39500:cc85ebb68ff9 39501:993d7e2c8b79
   628         if issnapshot(rev):
   628         if issnapshot(rev):
   629             cache[deltaparent(rev)].append(rev)
   629             cache[deltaparent(rev)].append(rev)
   630 
   630 
   631 def _refinedgroups(revlog, p1, p2, cachedelta):
   631 def _refinedgroups(revlog, p1, p2, cachedelta):
   632     good = None
   632     good = None
       
   633     # First we try to reuse a the delta contained in the bundle.
       
   634     # (or from the source revlog)
       
   635     #
       
   636     # This logic only applies to general delta repositories and can be disabled
       
   637     # through configuration. Disabling reuse source delta is useful when
       
   638     # we want to make sure we recomputed "optimal" deltas.
       
   639     if cachedelta and revlog._generaldelta and revlog._lazydeltabase:
       
   640         # Assume what we received from the server is a good choice
       
   641         # build delta will reuse the cache
       
   642         good = yield (cachedelta[0],)
       
   643         if good is not None:
       
   644             yield None
       
   645             return
   633     for candidates in _rawgroups(revlog, p1, p2, cachedelta):
   646     for candidates in _rawgroups(revlog, p1, p2, cachedelta):
   634         good = yield candidates
   647         good = yield candidates
   635         if good is not None:
   648         if good is not None:
   636             break
   649             break
   637     # we have found nothing
   650     # we have found nothing
   648     gdelta = revlog._generaldelta
   661     gdelta = revlog._generaldelta
   649     sparse = revlog._sparserevlog
   662     sparse = revlog._sparserevlog
   650     curr = len(revlog)
   663     curr = len(revlog)
   651     prev = curr - 1
   664     prev = curr - 1
   652     deltachain = lambda rev: revlog._deltachain(rev)[0]
   665     deltachain = lambda rev: revlog._deltachain(rev)[0]
   653 
       
   654     # First we try to reuse a the delta contained in the bundle.
       
   655     # (or from the source revlog)
       
   656     #
       
   657     # This logic only applies to general delta repositories and can be disabled
       
   658     # through configuration. Disabling reuse of source delta is useful when
       
   659     # we want to make sure we recomputed "optimal" deltas.
       
   660     if cachedelta and gdelta and revlog._lazydeltabase:
       
   661         # Assume what we received from the server is a good choice
       
   662         # build delta will reuse the cache
       
   663         yield (cachedelta[0],)
       
   664 
   666 
   665     if gdelta:
   667     if gdelta:
   666         # exclude already lazy tested base if any
   668         # exclude already lazy tested base if any
   667         parents = [p for p in (p1, p2) if p != nullrev]
   669         parents = [p for p in (p1, p2) if p != nullrev]
   668 
   670