Show More
@@ -379,6 +379,7 b' def emitrevisions(' | |||||
379 |
|
379 | |||
380 | fnode = store.node |
|
380 | fnode = store.node | |
381 | frev = store.rev |
|
381 | frev = store.rev | |
|
382 | parents = store.parentrevs | |||
382 |
|
383 | |||
383 | if nodesorder == b'nodes': |
|
384 | if nodesorder == b'nodes': | |
384 | revs = [frev(n) for n in nodes] |
|
385 | revs = [frev(n) for n in nodes] | |
@@ -391,23 +392,21 b' def emitrevisions(' | |||||
391 | prevrev = None |
|
392 | prevrev = None | |
392 |
|
393 | |||
393 | if deltamode == repository.CG_DELTAMODE_PREV or assumehaveparentrevisions: |
|
394 | if deltamode == repository.CG_DELTAMODE_PREV or assumehaveparentrevisions: | |
394 |
prevrev = |
|
395 | prevrev = parents(revs[0])[0] | |
395 |
|
396 | |||
396 | # Set of revs available to delta against. |
|
397 | # Sets of revs available to delta against. | |
|
398 | emitted = set() | |||
397 | available = set() |
|
399 | available = set() | |
398 | parents = [] |
|
400 | if assumehaveparentrevisions: | |
|
401 | common_heads = set(p for r in revs for p in parents(r)) | |||
|
402 | common_heads.difference_update(revs) | |||
|
403 | available = store.ancestors(common_heads, inclusive=True) | |||
399 |
|
404 | |||
400 | def is_usable_base(rev): |
|
405 | def is_usable_base(rev): | |
401 | """Is a delta against this revision usable over the wire""" |
|
406 | """Is a delta against this revision usable over the wire""" | |
402 | if rev == nullrev: |
|
407 | if rev == nullrev: | |
403 | return False |
|
408 | return False | |
404 | # Base revision was already emitted in this group. |
|
409 | return rev in emitted or rev in available | |
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 |
|
|||
411 |
|
410 | |||
412 | for rev in revs: |
|
411 | for rev in revs: | |
413 | if rev == nullrev: |
|
412 | if rev == nullrev: | |
@@ -418,7 +417,7 b' def emitrevisions(' | |||||
418 | debug_info['revision-total'] += 1 |
|
417 | debug_info['revision-total'] += 1 | |
419 |
|
418 | |||
420 | node = fnode(rev) |
|
419 | node = fnode(rev) | |
421 |
|
|
420 | p1rev, p2rev = parents(rev) | |
422 |
|
421 | |||
423 | if debug_info is not None: |
|
422 | if debug_info is not None: | |
424 | if p1rev != p2rev and p1rev != nullrev and p2rev != nullrev: |
|
423 | if p1rev != p2rev and p1rev != nullrev and p2rev != nullrev: | |
@@ -531,7 +530,7 b' def emitrevisions(' | |||||
531 | debug_info['computed-delta'] += 1 # close enough |
|
530 | debug_info['computed-delta'] += 1 # close enough | |
532 | debug_info['delta-full'] += 1 |
|
531 | debug_info['delta-full'] += 1 | |
533 | revision = store.rawdata(node) |
|
532 | revision = store.rawdata(node) | |
534 |
|
|
533 | emitted.add(rev) | |
535 | else: |
|
534 | else: | |
536 | if revdifffn: |
|
535 | if revdifffn: | |
537 | if debug_info is not None: |
|
536 | if debug_info is not None: | |
@@ -571,7 +570,7 b' def emitrevisions(' | |||||
571 | store.rawdata(baserev), store.rawdata(rev) |
|
570 | store.rawdata(baserev), store.rawdata(rev) | |
572 | ) |
|
571 | ) | |
573 |
|
572 | |||
574 |
|
|
573 | emitted.add(rev) | |
575 |
|
574 | |||
576 | serialized_sidedata = None |
|
575 | serialized_sidedata = None | |
577 | sidedata_flags = (0, 0) |
|
576 | sidedata_flags = (0, 0) |
General Comments 0
You need to be logged in to leave comments.
Login now