Show More
@@ -771,7 +771,8 b' def _makenarrowdeltarequest(cl, store, i' | |||||
771 | ellipsis=True, |
|
771 | ellipsis=True, | |
772 | ) |
|
772 | ) | |
773 |
|
773 | |||
774 |
def deltagroup(repo, re |
|
774 | def deltagroup(repo, store, nodes, ischangelog, lookup, forcedeltaparentprev, | |
|
775 | allowreorder, | |||
775 | units=None, |
|
776 | units=None, | |
776 | ellipses=False, clrevtolocalrev=None, fullclnodes=None, |
|
777 | ellipses=False, clrevtolocalrev=None, fullclnodes=None, | |
777 | precomputedellipsis=None): |
|
778 | precomputedellipsis=None): | |
@@ -782,7 +783,7 b' def deltagroup(repo, revs, store, ischan' | |||||
782 | If units is not None, progress detail will be generated, units specifies |
|
783 | If units is not None, progress detail will be generated, units specifies | |
783 | the type of revlog that is touched (changelog, manifest, etc.). |
|
784 | the type of revlog that is touched (changelog, manifest, etc.). | |
784 | """ |
|
785 | """ | |
785 |
if not |
|
786 | if not nodes: | |
786 | return |
|
787 | return | |
787 |
|
788 | |||
788 | # We perform two passes over the revisions whose data we will emit. |
|
789 | # We perform two passes over the revisions whose data we will emit. | |
@@ -797,6 +798,17 b' def deltagroup(repo, revs, store, ischan' | |||||
797 |
|
798 | |||
798 | cl = repo.changelog |
|
799 | cl = repo.changelog | |
799 |
|
800 | |||
|
801 | if ischangelog: | |||
|
802 | # Changelog doesn't benefit from reordering revisions. So send | |||
|
803 | # out revisions in store order. | |||
|
804 | # TODO the API would be cleaner if this were controlled by the | |||
|
805 | # store producing the deltas. | |||
|
806 | revs = sorted(cl.rev(n) for n in nodes) | |||
|
807 | elif ellipses: | |||
|
808 | revs = _sortnodesellipsis(store, nodes, cl, lookup) | |||
|
809 | else: | |||
|
810 | revs = _sortnodesnormal(store, nodes, allowreorder) | |||
|
811 | ||||
800 | # In the first pass, collect info about the deltas we'll be |
|
812 | # In the first pass, collect info about the deltas we'll be | |
801 | # generating. |
|
813 | # generating. | |
802 | requests = [] |
|
814 | requests = [] | |
@@ -1099,10 +1111,6 b' class cgpacker(object):' | |||||
1099 |
|
1111 | |||
1100 | return x |
|
1112 | return x | |
1101 |
|
1113 | |||
1102 | # Changelog doesn't benefit from reordering revisions. So send out |
|
|||
1103 | # revisions in store order. |
|
|||
1104 | revs = sorted(cl.rev(n) for n in nodes) |
|
|||
1105 |
|
||||
1106 | state = { |
|
1114 | state = { | |
1107 | 'clrevorder': clrevorder, |
|
1115 | 'clrevorder': clrevorder, | |
1108 | 'mfs': mfs, |
|
1116 | 'mfs': mfs, | |
@@ -1111,8 +1119,10 b' class cgpacker(object):' | |||||
1111 | } |
|
1119 | } | |
1112 |
|
1120 | |||
1113 | gen = deltagroup( |
|
1121 | gen = deltagroup( | |
1114 |
self._repo, |
|
1122 | self._repo, cl, nodes, True, lookupcl, | |
1115 | self._forcedeltaparentprev, |
|
1123 | self._forcedeltaparentprev, | |
|
1124 | # Reorder settings are currently ignored for changelog. | |||
|
1125 | True, | |||
1116 | ellipses=self._ellipses, |
|
1126 | ellipses=self._ellipses, | |
1117 | units=_('changesets'), |
|
1127 | units=_('changesets'), | |
1118 | clrevtolocalrev={}, |
|
1128 | clrevtolocalrev={}, | |
@@ -1129,7 +1139,6 b' class cgpacker(object):' | |||||
1129 | change what is sent based in pulls vs pushes, etc. |
|
1139 | change what is sent based in pulls vs pushes, etc. | |
1130 | """ |
|
1140 | """ | |
1131 | repo = self._repo |
|
1141 | repo = self._repo | |
1132 | cl = repo.changelog |
|
|||
1133 | mfl = repo.manifestlog |
|
1142 | mfl = repo.manifestlog | |
1134 | dirlog = mfl._revlog.dirlog |
|
1143 | dirlog = mfl._revlog.dirlog | |
1135 | tmfnodes = {'': mfs} |
|
1144 | tmfnodes = {'': mfs} | |
@@ -1192,16 +1201,9 b' class cgpacker(object):' | |||||
1192 |
|
1201 | |||
1193 | lookupfn = makelookupmflinknode(dir, nodes) |
|
1202 | lookupfn = makelookupmflinknode(dir, nodes) | |
1194 |
|
1203 | |||
1195 | if self._ellipses: |
|
|||
1196 | revs = _sortnodesellipsis(store, prunednodes, cl, |
|
|||
1197 | lookupfn) |
|
|||
1198 | else: |
|
|||
1199 | revs = _sortnodesnormal(store, prunednodes, |
|
|||
1200 | self._reorder) |
|
|||
1201 |
|
||||
1202 | deltas = deltagroup( |
|
1204 | deltas = deltagroup( | |
1203 |
self._repo, re |
|
1205 | self._repo, store, prunednodes, False, lookupfn, | |
1204 | self._forcedeltaparentprev, |
|
1206 | self._forcedeltaparentprev, self._reorder, | |
1205 | ellipses=self._ellipses, |
|
1207 | ellipses=self._ellipses, | |
1206 | units=_('manifests'), |
|
1208 | units=_('manifests'), | |
1207 | clrevtolocalrev=clrevtolocalrev, |
|
1209 | clrevtolocalrev=clrevtolocalrev, | |
@@ -1260,7 +1262,6 b' class cgpacker(object):' | |||||
1260 | linknodes = normallinknodes |
|
1262 | linknodes = normallinknodes | |
1261 |
|
1263 | |||
1262 | repo = self._repo |
|
1264 | repo = self._repo | |
1263 | cl = repo.changelog |
|
|||
1264 | progress = repo.ui.makeprogress(_('bundling'), unit=_('files'), |
|
1265 | progress = repo.ui.makeprogress(_('bundling'), unit=_('files'), | |
1265 | total=len(changedfiles)) |
|
1266 | total=len(changedfiles)) | |
1266 | for i, fname in enumerate(sorted(changedfiles)): |
|
1267 | for i, fname in enumerate(sorted(changedfiles)): | |
@@ -1284,18 +1285,11 b' class cgpacker(object):' | |||||
1284 | if not filenodes: |
|
1285 | if not filenodes: | |
1285 | continue |
|
1286 | continue | |
1286 |
|
1287 | |||
1287 | if self._ellipses: |
|
|||
1288 | revs = _sortnodesellipsis(filerevlog, filenodes, |
|
|||
1289 | cl, lookupfilelog) |
|
|||
1290 | else: |
|
|||
1291 | revs = _sortnodesnormal(filerevlog, filenodes, |
|
|||
1292 | self._reorder) |
|
|||
1293 |
|
||||
1294 | progress.update(i + 1, item=fname) |
|
1288 | progress.update(i + 1, item=fname) | |
1295 |
|
1289 | |||
1296 | deltas = deltagroup( |
|
1290 | deltas = deltagroup( | |
1297 |
self._repo, |
|
1291 | self._repo, filerevlog, filenodes, False, lookupfilelog, | |
1298 | self._forcedeltaparentprev, |
|
1292 | self._forcedeltaparentprev, self._reorder, | |
1299 | ellipses=self._ellipses, |
|
1293 | ellipses=self._ellipses, | |
1300 | clrevtolocalrev=clrevtolocalrev, |
|
1294 | clrevtolocalrev=clrevtolocalrev, | |
1301 | fullclnodes=self._fullclnodes, |
|
1295 | fullclnodes=self._fullclnodes, |
General Comments 0
You need to be logged in to leave comments.
Login now