##// 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 # Set of revs available to delta against.
396 # Set of revs available to delta against.
397 available = set()
397 available = set()
398 parents = []
398
399
399 def is_usable_base(rev):
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 for rev in revs:
412 for rev in revs:
403 if rev == nullrev:
413 if rev == nullrev:
@@ -408,7 +418,7 b' def emitrevisions('
408 debug_info['revision-total'] += 1
418 debug_info['revision-total'] += 1
409
419
410 node = fnode(rev)
420 node = fnode(rev)
411 p1rev, p2rev = store.parentrevs(rev)
421 parents[:] = p1rev, p2rev = store.parentrevs(rev)
412
422
413 if debug_info is not None:
423 if debug_info is not None:
414 if p1rev != p2rev and p1rev != nullrev and p2rev != nullrev:
424 if p1rev != p2rev and p1rev != nullrev and p2rev != nullrev:
@@ -446,19 +456,11 b' def emitrevisions('
446 # amounts to effectively copying data from storage and is
456 # amounts to effectively copying data from storage and is
447 # therefore the fastest.
457 # therefore the fastest.
448 elif deltaparentrev != nullrev:
458 elif deltaparentrev != nullrev:
449 # Base revision was already emitted in this group. We can
459 # If the stored delta works, let us use it !
450 # always safely use the delta.
451 if is_usable_base(deltaparentrev):
460 if is_usable_base(deltaparentrev):
452 if debug_info is not None:
461 if debug_info is not None:
453 debug_delta_source = "storage"
462 debug_delta_source = "storage"
454 baserev = deltaparentrev
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 # No guarantee the receiver has the delta parent. Send delta
464 # No guarantee the receiver has the delta parent. Send delta
463 # against last revision (if possible), which in the common case
465 # against last revision (if possible), which in the common case
464 # should be similar enough to this revision that the delta is
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