##// END OF EJS Templates
emitrevision: also check the parents in the availability closure...
marmoute -
r50681:0bda07f3 stable
parent child Browse files
Show More
@@ -390,16 +390,26 b' def emitrevisions('
390
390
391 # Set of revs available to delta against.
391 # Set of revs available to delta against.
392 available = set()
392 available = set()
393 parents = []
393
394
394 def is_usable_base(rev):
395 def is_usable_base(rev):
395 return rev != nullrev and rev in available
396 """Is a delta against this revision usable over the wire"""
397 if rev == nullrev:
398 return False
399 # Base revision was already emitted in this group.
400 if rev in available:
401 return True
402 # Base revision is a parent that hasn't been emitted already.
403 if assumehaveparentrevisions and rev in parents:
404 return True
405 return False
396
406
397 for rev in revs:
407 for rev in revs:
398 if rev == nullrev:
408 if rev == nullrev:
399 continue
409 continue
400
410
401 node = fnode(rev)
411 node = fnode(rev)
402 p1rev, p2rev = store.parentrevs(rev)
412 parents[:] = p1rev, p2rev = store.parentrevs(rev)
403
413
404 if deltaparentfn:
414 if deltaparentfn:
405 deltaparentrev = deltaparentfn(rev)
415 deltaparentrev = deltaparentfn(rev)
@@ -421,16 +431,9 b' def emitrevisions('
421 # amounts to effectively copying data from storage and is
431 # amounts to effectively copying data from storage and is
422 # therefore the fastest.
432 # therefore the fastest.
423 elif deltaparentrev != nullrev:
433 elif deltaparentrev != nullrev:
424 # Base revision was already emitted in this group. We can
434 # If the stored delta works, let us use it !
425 # always safely use the delta.
426 if is_usable_base(deltaparentrev):
435 if is_usable_base(deltaparentrev):
427 baserev = deltaparentrev
436 baserev = deltaparentrev
428
429 # Base revision is a parent that hasn't been emitted already.
430 # Use it if we can assume the receiver has the parent revision.
431 elif assumehaveparentrevisions and deltaparentrev in (p1rev, p2rev):
432 baserev = deltaparentrev
433
434 # No guarantee the receiver has the delta parent. Send delta
437 # No guarantee the receiver has the delta parent. Send delta
435 # against last revision (if possible), which in the common case
438 # against last revision (if possible), which in the common case
436 # should be similar enough to this revision that the delta is
439 # 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