Show More
@@ -520,14 +520,18 b' class revisiondelta(object):' | |||
|
520 | 520 | deltachunks = attr.ib() |
|
521 | 521 | |
|
522 | 522 | class cg1packer(object): |
|
523 |
def __init__(self, repo, filematcher, version, |
|
|
524 | manifestsend, sendtreemanifests, | |
|
523 | def __init__(self, repo, filematcher, version, allowreorder, | |
|
524 | builddeltaheader, manifestsend, sendtreemanifests, | |
|
525 | 525 | bundlecaps=None): |
|
526 | 526 | """Given a source repo, construct a bundler. |
|
527 | 527 | |
|
528 | 528 | filematcher is a matcher that matches on files to include in the |
|
529 | 529 | changegroup. Used to facilitate sparse changegroups. |
|
530 | 530 | |
|
531 | allowreorder controls whether reordering of revisions is allowed. | |
|
532 | This value is used when ``bundle.reorder`` is ``auto`` or isn't | |
|
533 | set. | |
|
534 | ||
|
531 | 535 | builddeltaheader is a callable that constructs the header for a group |
|
532 | 536 | delta. |
|
533 | 537 | |
@@ -552,14 +556,16 b' class cg1packer(object):' | |||
|
552 | 556 | if bundlecaps is None: |
|
553 | 557 | bundlecaps = set() |
|
554 | 558 | self._bundlecaps = bundlecaps |
|
559 | ||
|
555 | 560 | # experimental config: bundle.reorder |
|
556 | 561 | reorder = repo.ui.config('bundle', 'reorder') |
|
557 | 562 | if reorder == 'auto': |
|
558 |
reorder = |
|
|
563 | self._reorder = allowreorder | |
|
559 | 564 | else: |
|
560 | reorder = stringutil.parsebool(reorder) | |
|
565 | self._reorder = stringutil.parsebool(reorder) | |
|
566 | ||
|
561 | 567 | self._repo = repo |
|
562 | self._reorder = reorder | |
|
568 | ||
|
563 | 569 | if self._repo.ui.verbose and not self._repo.ui.debugflag: |
|
564 | 570 | self._verbosenote = self._repo.ui.note |
|
565 | 571 | else: |
@@ -1120,19 +1126,6 b' class cg1packer(object):' | |||
|
1120 | 1126 | ) |
|
1121 | 1127 | |
|
1122 | 1128 | class cg2packer(cg1packer): |
|
1123 | def __init__(self, repo, filematcher, version, builddeltaheader, | |
|
1124 | manifestsend, sendtreemanifests, bundlecaps=None): | |
|
1125 | super(cg2packer, self).__init__(repo, filematcher, version, | |
|
1126 | builddeltaheader, manifestsend, | |
|
1127 | sendtreemanifests, | |
|
1128 | bundlecaps=bundlecaps) | |
|
1129 | ||
|
1130 | if self._reorder is None: | |
|
1131 | # Since generaldelta is directly supported by cg2, reordering | |
|
1132 | # generally doesn't help, so we disable it by default (treating | |
|
1133 | # bundle.reorder=auto just like bundle.reorder=False). | |
|
1134 | self._reorder = False | |
|
1135 | ||
|
1136 | 1129 | def deltaparent(self, store, rev, p1, p2, prev): |
|
1137 | 1130 | # Narrow ellipses mode. |
|
1138 | 1131 | if util.safehasattr(self, 'full_nodes'): |
@@ -1176,7 +1169,8 b' def _makecg1packer(repo, filematcher, bu' | |||
|
1176 | 1169 | builddeltaheader = lambda d: _CHANGEGROUPV1_DELTA_HEADER.pack( |
|
1177 | 1170 | d.node, d.p1node, d.p2node, d.linknode) |
|
1178 | 1171 | |
|
1179 |
return cg1packer(repo, filematcher, b'01', |
|
|
1172 | return cg1packer(repo, filematcher, b'01', allowreorder=None, | |
|
1173 | builddeltaheader=builddeltaheader, | |
|
1180 | 1174 | manifestsend=b'', sendtreemanifests=False, |
|
1181 | 1175 | bundlecaps=bundlecaps) |
|
1182 | 1176 | |
@@ -1184,7 +1178,11 b' def _makecg2packer(repo, filematcher, bu' | |||
|
1184 | 1178 | builddeltaheader = lambda d: _CHANGEGROUPV2_DELTA_HEADER.pack( |
|
1185 | 1179 | d.node, d.p1node, d.p2node, d.basenode, d.linknode) |
|
1186 | 1180 | |
|
1187 | return cg2packer(repo, filematcher, b'02', builddeltaheader, | |
|
1181 | # Since generaldelta is directly supported by cg2, reordering | |
|
1182 | # generally doesn't help, so we disable it by default (treating | |
|
1183 | # bundle.reorder=auto just like bundle.reorder=False). | |
|
1184 | return cg2packer(repo, filematcher, b'02', allowreorder=False, | |
|
1185 | builddeltaheader=builddeltaheader, | |
|
1188 | 1186 | manifestsend=b'', sendtreemanifests=False, |
|
1189 | 1187 | bundlecaps=bundlecaps) |
|
1190 | 1188 | |
@@ -1192,7 +1190,8 b' def _makecg3packer(repo, filematcher, bu' | |||
|
1192 | 1190 | builddeltaheader = lambda d: _CHANGEGROUPV3_DELTA_HEADER.pack( |
|
1193 | 1191 | d.node, d.p1node, d.p2node, d.basenode, d.linknode, d.flags) |
|
1194 | 1192 | |
|
1195 |
return cg2packer(repo, filematcher, b'03', |
|
|
1193 | return cg2packer(repo, filematcher, b'03', allowreorder=False, | |
|
1194 | builddeltaheader=builddeltaheader, | |
|
1196 | 1195 | manifestsend=closechunk(), sendtreemanifests=True, |
|
1197 | 1196 | bundlecaps=bundlecaps) |
|
1198 | 1197 |
General Comments 0
You need to be logged in to leave comments.
Login now