Show More
@@ -517,12 +517,12 b' class revisiondeltarequest(object):' | |||||
517 | p1node = attr.ib() |
|
517 | p1node = attr.ib() | |
518 | p2node = attr.ib() |
|
518 | p2node = attr.ib() | |
519 |
|
519 | |||
520 |
# Base revision that delta should be generated against. If null |
|
520 | # Base revision that delta should be generated against. If nullid, | |
521 | # the full revision data should be populated. If None, the delta |
|
521 | # the full revision data should be populated. If None, the delta | |
522 | # may be generated against any base revision that is an ancestor of |
|
522 | # may be generated against any base revision that is an ancestor of | |
523 |
# this revision. If any other |
|
523 | # this revision. If any other value, the delta should be produced | |
524 |
# |
|
524 | # against that revision. | |
525 |
base |
|
525 | basenode = attr.ib() | |
526 |
|
526 | |||
527 | # Whether this should be marked as an ellipsis revision. |
|
527 | # Whether this should be marked as an ellipsis revision. | |
528 | ellipsis = attr.ib(default=False) |
|
528 | ellipsis = attr.ib(default=False) | |
@@ -613,18 +613,18 b' def _sortnodesellipsis(store, nodes, cl,' | |||||
613 | key = lambda n: cl.rev(lookup(n)) |
|
613 | key = lambda n: cl.rev(lookup(n)) | |
614 | return [store.rev(n) for n in sorted(nodes, key=key)] |
|
614 | return [store.rev(n) for n in sorted(nodes, key=key)] | |
615 |
|
615 | |||
616 | def _handlerevisiondeltarequest(store, request, prev): |
|
616 | def _handlerevisiondeltarequest(store, request, prevnode): | |
617 | """Obtain a revisiondelta from a revisiondeltarequest""" |
|
617 | """Obtain a revisiondelta from a revisiondeltarequest""" | |
618 |
|
618 | |||
619 | node = request.node |
|
619 | node = request.node | |
620 | rev = store.rev(node) |
|
620 | rev = store.rev(node) | |
621 |
|
621 | |||
622 | # Requesting a full revision. |
|
622 | # Requesting a full revision. | |
623 |
if request.base |
|
623 | if request.basenode == nullid: | |
624 | base = nullrev |
|
624 | baserev = nullrev | |
625 | # Requesting an explicit revision. |
|
625 | # Requesting an explicit revision. | |
626 |
elif request.base |
|
626 | elif request.basenode is not None: | |
627 |
base = request.base |
|
627 | baserev = store.rev(request.basenode) | |
628 | # Allowing us to choose. |
|
628 | # Allowing us to choose. | |
629 | else: |
|
629 | else: | |
630 | p1, p2 = store.parentrevs(rev) |
|
630 | p1, p2 = store.parentrevs(rev) | |
@@ -638,37 +638,37 b' def _handlerevisiondeltarequest(store, r' | |||||
638 | # expensive. The revlog caches should have prev cached, meaning |
|
638 | # expensive. The revlog caches should have prev cached, meaning | |
639 | # less CPU for changegroup generation. There is likely room to add |
|
639 | # less CPU for changegroup generation. There is likely room to add | |
640 | # a flag and/or config option to control this behavior. |
|
640 | # a flag and/or config option to control this behavior. | |
641 | base = prev |
|
641 | baserev = store.rev(prevnode) | |
642 | elif dp == nullrev: |
|
642 | elif dp == nullrev: | |
643 | # revlog is configured to use full snapshot for a reason, |
|
643 | # revlog is configured to use full snapshot for a reason, | |
644 | # stick to full snapshot. |
|
644 | # stick to full snapshot. | |
645 | base = nullrev |
|
645 | baserev = nullrev | |
646 | elif dp not in (p1, p2, prev): |
|
646 | elif dp not in (p1, p2, store.rev(prevnode)): | |
647 | # Pick prev when we can't be sure remote has the base revision. |
|
647 | # Pick prev when we can't be sure remote has the base revision. | |
648 | base = prev |
|
648 | baserev = store.rev(prevnode) | |
649 | else: |
|
649 | else: | |
650 | base = dp |
|
650 | baserev = dp | |
651 |
|
651 | |||
652 | if base != nullrev and not store.candelta(base, rev): |
|
652 | if baserev != nullrev and not store.candelta(baserev, rev): | |
653 | base = nullrev |
|
653 | baserev = nullrev | |
654 |
|
654 | |||
655 | revision = None |
|
655 | revision = None | |
656 | delta = None |
|
656 | delta = None | |
657 | baserevisionsize = None |
|
657 | baserevisionsize = None | |
658 |
|
658 | |||
659 | if store.iscensored(base) or store.iscensored(rev): |
|
659 | if store.iscensored(baserev) or store.iscensored(rev): | |
660 | try: |
|
660 | try: | |
661 | revision = store.revision(node, raw=True) |
|
661 | revision = store.revision(node, raw=True) | |
662 | except error.CensoredNodeError as e: |
|
662 | except error.CensoredNodeError as e: | |
663 | revision = e.tombstone |
|
663 | revision = e.tombstone | |
664 |
|
664 | |||
665 | if base != nullrev: |
|
665 | if baserev != nullrev: | |
666 | baserevisionsize = store.rawsize(base) |
|
666 | baserevisionsize = store.rawsize(baserev) | |
667 |
|
667 | |||
668 | elif base == nullrev: |
|
668 | elif baserev == nullrev: | |
669 | revision = store.revision(node, raw=True) |
|
669 | revision = store.revision(node, raw=True) | |
670 | else: |
|
670 | else: | |
671 | delta = store.revdiff(base, rev) |
|
671 | delta = store.revdiff(baserev, rev) | |
672 |
|
672 | |||
673 | extraflags = revlog.REVIDX_ELLIPSIS if request.ellipsis else 0 |
|
673 | extraflags = revlog.REVIDX_ELLIPSIS if request.ellipsis else 0 | |
674 |
|
674 | |||
@@ -677,7 +677,7 b' def _handlerevisiondeltarequest(store, r' | |||||
677 | p1node=request.p1node, |
|
677 | p1node=request.p1node, | |
678 | p2node=request.p2node, |
|
678 | p2node=request.p2node, | |
679 | linknode=request.linknode, |
|
679 | linknode=request.linknode, | |
680 | basenode=store.node(base), |
|
680 | basenode=store.node(baserev), | |
681 | flags=store.flags(rev) | extraflags, |
|
681 | flags=store.flags(rev) | extraflags, | |
682 | baserevisionsize=baserevisionsize, |
|
682 | baserevisionsize=baserevisionsize, | |
683 | revision=revision, |
|
683 | revision=revision, | |
@@ -767,7 +767,7 b' def _makenarrowdeltarequest(cl, store, i' | |||||
767 | p1node=p1node, |
|
767 | p1node=p1node, | |
768 | p2node=p2node, |
|
768 | p2node=p2node, | |
769 | linknode=linknode, |
|
769 | linknode=linknode, | |
770 |
base |
|
770 | basenode=nullid, | |
771 | ellipsis=True, |
|
771 | ellipsis=True, | |
772 | ) |
|
772 | ) | |
773 |
|
773 | |||
@@ -824,7 +824,7 b' def deltagroup(repo, revs, store, ischan' | |||||
824 | p1node=p1node, |
|
824 | p1node=p1node, | |
825 | p2node=p2node, |
|
825 | p2node=p2node, | |
826 | linknode=linknode, |
|
826 | linknode=linknode, | |
827 |
base |
|
827 | basenode=None, | |
828 | )) |
|
828 | )) | |
829 |
|
829 | |||
830 | elif linkrev not in precomputedellipsis: |
|
830 | elif linkrev not in precomputedellipsis: | |
@@ -840,7 +840,7 b' def deltagroup(repo, revs, store, ischan' | |||||
840 | p1node=p1node, |
|
840 | p1node=p1node, | |
841 | p2node=p2node, |
|
841 | p2node=p2node, | |
842 | linknode=linknode, |
|
842 | linknode=linknode, | |
843 |
base |
|
843 | basenode=store.node(prev) if forcedeltaparentprev else None, | |
844 | )) |
|
844 | )) | |
845 |
|
845 | |||
846 | # We expect the first pass to be fast, so we only engage the progress |
|
846 | # We expect the first pass to be fast, so we only engage the progress | |
@@ -850,16 +850,16 b' def deltagroup(repo, revs, store, ischan' | |||||
850 | progress = repo.ui.makeprogress(_('bundling'), unit=units, |
|
850 | progress = repo.ui.makeprogress(_('bundling'), unit=units, | |
851 | total=len(requests)) |
|
851 | total=len(requests)) | |
852 |
|
852 | |||
853 |
prev |
|
853 | prevnode = store.node(revs[0]) | |
854 | for i, request in enumerate(requests): |
|
854 | for i, request in enumerate(requests): | |
855 | if progress: |
|
855 | if progress: | |
856 | progress.update(i + 1) |
|
856 | progress.update(i + 1) | |
857 |
|
857 | |||
858 |
delta = _handlerevisiondeltarequest(store, request, prev |
|
858 | delta = _handlerevisiondeltarequest(store, request, prevnode) | |
859 |
|
859 | |||
860 | yield delta |
|
860 | yield delta | |
861 |
|
861 | |||
862 |
prev |
|
862 | prevnode = request.node | |
863 |
|
863 | |||
864 | if progress: |
|
864 | if progress: | |
865 | progress.complete() |
|
865 | progress.complete() |
General Comments 0
You need to be logged in to leave comments.
Login now