##// END OF EJS Templates
emitrevision: simplify the fallback to computed delta...
marmoute -
r50564:f064b03d default
parent child Browse files
Show More
@@ -455,40 +455,28 b' def emitrevisions('
455 # There is a delta in storage. We try to use that because it
455 # There is a delta in storage. We try to use that because it
456 # amounts to effectively copying data from storage and is
456 # amounts to effectively copying data from storage and is
457 # therefore the fastest.
457 # therefore the fastest.
458 elif deltaparentrev != nullrev:
458 elif is_usable_base(deltaparentrev):
459 # If the stored delta works, let us use it !
459 if debug_info is not None:
460 if is_usable_base(deltaparentrev):
460 debug_delta_source = "storage"
461 if debug_info is not None:
461 baserev = deltaparentrev
462 debug_delta_source = "storage"
462 else:
463 baserev = deltaparentrev
463 # No guarantee the receiver has the delta parent, or Storage has a
464 # No guarantee the receiver has the delta parent. Send delta
464 # fulltext revision.
465 # against last revision (if possible), which in the common case
465 #
466 # should be similar enough to this revision that the delta is
466 # Send delta against last revision (if possible), which in the
467 # reasonable.
467 # common case should be similar enough to this revision that the
468 # delta is reasonable.
469 if deltaparentrev != nullrev and debug_info is not None:
470 debug_info['denied-base-not-available'] += 1
468 elif prevrev is not None:
471 elif prevrev is not None:
469 if debug_info is not None:
472 if debug_info is not None:
470 debug_info['denied-base-not-available'] += 1
471 debug_delta_source = "prev"
473 debug_delta_source = "prev"
472 baserev = prevrev
474 baserev = prevrev
473 else:
475 else:
474 if debug_info is not None:
476 if debug_info is not None:
475 debug_info['denied-base-not-available'] += 1
476 debug_delta_source = "full"
477 debug_delta_source = "full"
477 baserev = nullrev
478 baserev = nullrev
478
479
479 # Storage has a fulltext revision.
480
481 # Let's use the previous revision, which is as good a guess as any.
482 # There is definitely room to improve this logic.
483 elif prevrev is not None:
484 if debug_info is not None:
485 debug_delta_source = "prev"
486 baserev = prevrev
487 else:
488 if debug_info is not None:
489 debug_delta_source = "full"
490 baserev = nullrev
491
492 # But we can't actually use our chosen delta base for whatever
480 # But we can't actually use our chosen delta base for whatever
493 # reason. Reset to fulltext.
481 # reason. Reset to fulltext.
494 if (
482 if (
General Comments 0
You need to be logged in to leave comments. Login now