##// END OF EJS Templates
emitrevision: also check the parents in the availability closure...
marmoute -
r50563:383c79f8 default
parent child Browse files
Show More
@@ -395,9 +395,19 b' def emitrevisions('
395 395
396 396 # Set of revs available to delta against.
397 397 available = set()
398 parents = []
398 399
399 400 def is_usable_base(rev):
400 return rev != nullrev and rev in available
401 """Is a delta against this revision usable over the wire"""
402 if rev == nullrev:
403 return False
404 # Base revision was already emitted in this group.
405 if rev in available:
406 return True
407 # Base revision is a parent that hasn't been emitted already.
408 if assumehaveparentrevisions and rev in parents:
409 return True
410 return False
401 411
402 412 for rev in revs:
403 413 if rev == nullrev:
@@ -408,7 +418,7 b' def emitrevisions('
408 418 debug_info['revision-total'] += 1
409 419
410 420 node = fnode(rev)
411 p1rev, p2rev = store.parentrevs(rev)
421 parents[:] = p1rev, p2rev = store.parentrevs(rev)
412 422
413 423 if debug_info is not None:
414 424 if p1rev != p2rev and p1rev != nullrev and p2rev != nullrev:
@@ -446,19 +456,11 b' def emitrevisions('
446 456 # amounts to effectively copying data from storage and is
447 457 # therefore the fastest.
448 458 elif deltaparentrev != nullrev:
449 # Base revision was already emitted in this group. We can
450 # always safely use the delta.
459 # If the stored delta works, let us use it !
451 460 if is_usable_base(deltaparentrev):
452 461 if debug_info is not None:
453 462 debug_delta_source = "storage"
454 463 baserev = deltaparentrev
455
456 # Base revision is a parent that hasn't been emitted already.
457 # Use it if we can assume the receiver has the parent revision.
458 elif assumehaveparentrevisions and deltaparentrev in (p1rev, p2rev):
459 if debug_info is not None:
460 debug_delta_source = "storage"
461 baserev = deltaparentrev
462 464 # No guarantee the receiver has the delta parent. Send delta
463 465 # against last revision (if possible), which in the common case
464 466 # should be similar enough to this revision that the delta is
General Comments 0
You need to be logged in to leave comments. Login now