Show More
@@ -533,7 +533,7 b' def _sortnodesnormal(store, nodes, reord' | |||
|
533 | 533 | else: |
|
534 | 534 | return sorted([store.rev(n) for n in nodes]) |
|
535 | 535 | |
|
536 |
def _sortnodesellipsis(store, nodes, cl |
|
|
536 | def _sortnodesellipsis(store, nodes, cl, lookup): | |
|
537 | 537 | """Sort nodes for changegroup generation and turn into revnums.""" |
|
538 | 538 | # Ellipses serving mode. |
|
539 | 539 | # |
@@ -551,7 +551,7 b' def _sortnodesellipsis(store, nodes, cln' | |||
|
551 | 551 | # order that they're introduced in dramatis personae by the |
|
552 | 552 | # changelog, so what we do is we sort the non-changelog histories |
|
553 | 553 | # by the order in which they are used by the changelog. |
|
554 |
key = lambda n: cl |
|
|
554 | key = lambda n: cl.rev(lookup(n)) | |
|
555 | 555 | return [store.rev(n) for n in sorted(nodes, key=key)] |
|
556 | 556 | |
|
557 | 557 | def _revisiondeltanormal(store, rev, prev, linknode, deltaparentfn): |
@@ -663,10 +663,6 b' class cgpacker(object):' | |||
|
663 | 663 | self._clrevtolocalrev = {} |
|
664 | 664 | self._nextclrevtolocalrev = {} |
|
665 | 665 | |
|
666 | # Maps changelog nodes to changelog revs. Filled in once | |
|
667 | # during changelog stage and then left unmodified. | |
|
668 | self._clnodetorev = {} | |
|
669 | ||
|
670 | 666 | def _close(self): |
|
671 | 667 | # Ellipses serving mode. |
|
672 | 668 | self._clrevtolocalrev.clear() |
@@ -695,6 +691,8 b' class cgpacker(object):' | |||
|
695 | 691 | yield self._close() |
|
696 | 692 | return |
|
697 | 693 | |
|
694 | cl = self._repo.changelog | |
|
695 | ||
|
698 | 696 | # add the parent of the first rev |
|
699 | 697 | p = store.parentrevs(revs[0])[0] |
|
700 | 698 | revs.insert(0, p) |
@@ -711,7 +709,7 b' class cgpacker(object):' | |||
|
711 | 709 | linknode = lookup(store.node(curr)) |
|
712 | 710 | |
|
713 | 711 | if self._ellipses: |
|
714 |
linkrev = |
|
|
712 | linkrev = cl.rev(linknode) | |
|
715 | 713 | self._clrevtolocalrev[linkrev] = curr |
|
716 | 714 | |
|
717 | 715 | # This is a node to send in full, because the changeset it |
@@ -864,8 +862,6 b' class cgpacker(object):' | |||
|
864 | 862 | clrevorder[x] = len(clrevorder) |
|
865 | 863 | |
|
866 | 864 | if self._ellipses: |
|
867 | self._clnodetorev[x] = cl.rev(x) | |
|
868 | ||
|
869 | 865 | # Only update mfs if x is going to be sent. Otherwise we |
|
870 | 866 | # end up with bogus linkrevs specified for manifests and |
|
871 | 867 | # we skip some manifest nodes that we should otherwise |
@@ -921,6 +917,7 b' class cgpacker(object):' | |||
|
921 | 917 | change what is sent based in pulls vs pushes, etc. |
|
922 | 918 | """ |
|
923 | 919 | repo = self._repo |
|
920 | cl = repo.changelog | |
|
924 | 921 | mfl = repo.manifestlog |
|
925 | 922 | dirlog = mfl._revlog.dirlog |
|
926 | 923 | tmfnodes = {'': mfs} |
@@ -976,8 +973,8 b' class cgpacker(object):' | |||
|
976 | 973 | lookupfn = makelookupmflinknode(dir, nodes) |
|
977 | 974 | |
|
978 | 975 | if self._ellipses: |
|
979 | revs = _sortnodesellipsis(store, prunednodes, | |
|
980 |
|
|
|
976 | revs = _sortnodesellipsis(store, prunednodes, cl, | |
|
977 | lookupfn) | |
|
981 | 978 | else: |
|
982 | 979 | revs = _sortnodesnormal(store, prunednodes, |
|
983 | 980 | self._reorder) |
@@ -1025,6 +1022,7 b' class cgpacker(object):' | |||
|
1025 | 1022 | |
|
1026 | 1023 | def _generatefiles(self, changedfiles, linknodes, commonrevs, source): |
|
1027 | 1024 | repo = self._repo |
|
1025 | cl = repo.changelog | |
|
1028 | 1026 | progress = repo.ui.makeprogress(_('bundling'), unit=_('files'), |
|
1029 | 1027 | total=len(changedfiles)) |
|
1030 | 1028 | for i, fname in enumerate(sorted(changedfiles)): |
@@ -1043,7 +1041,7 b' class cgpacker(object):' | |||
|
1043 | 1041 | if filenodes: |
|
1044 | 1042 | if self._ellipses: |
|
1045 | 1043 | revs = _sortnodesellipsis(filerevlog, filenodes, |
|
1046 |
|
|
|
1044 | cl, lookupfilelog) | |
|
1047 | 1045 | else: |
|
1048 | 1046 | revs = _sortnodesnormal(filerevlog, filenodes, |
|
1049 | 1047 | self._reorder) |
@@ -1074,14 +1072,6 b' class cgpacker(object):' | |||
|
1074 | 1072 | return nullrev |
|
1075 | 1073 | |
|
1076 | 1074 | if ischangelog: |
|
1077 | # If we're doing the changelog, it's possible that we | |
|
1078 | # have a parent that is already on the client, and we | |
|
1079 | # need to store some extra mapping information so that | |
|
1080 | # our contained ellipsis nodes will be able to resolve | |
|
1081 | # their parents. | |
|
1082 | if clrev not in self._clrevtolocalrev: | |
|
1083 | clnode = store.node(clrev) | |
|
1084 | self._clnodetorev[clnode] = clrev | |
|
1085 | 1075 | return clrev |
|
1086 | 1076 | |
|
1087 | 1077 | # Walk the ellipsis-ized changelog breadth-first looking for a |
General Comments 0
You need to be logged in to leave comments.
Login now