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