##// END OF EJS Templates
changegroup: move fullnodes into cgpacker...
Gregory Szorc -
r38945:1af339c2 default
parent child Browse files
Show More
@@ -523,7 +523,7 b' class cgpacker(object):'
523 523 def __init__(self, repo, filematcher, version, allowreorder,
524 524 useprevdelta, builddeltaheader, manifestsend,
525 525 sendtreemanifests, bundlecaps=None, ellipses=False,
526 shallow=False, ellipsisroots=None):
526 shallow=False, ellipsisroots=None, fullnodes=None):
527 527 """Given a source repo, construct a bundler.
528 528
529 529 filematcher is a matcher that matches on files to include in the
@@ -552,6 +552,10 b' class cgpacker(object):'
552 552
553 553 shallow indicates whether shallow data might be sent. The packer may
554 554 need to pack file contents not introduced by the changes being packed.
555
556 fullnodes is the list of nodes which should not be ellipsis nodes. We
557 store this rather than the set of nodes that should be ellipsis because
558 for very large histories we expect this to be significantly smaller.
555 559 """
556 560 assert filematcher
557 561 self._filematcher = filematcher
@@ -568,6 +572,7 b' class cgpacker(object):'
568 572 bundlecaps = set()
569 573 self._bundlecaps = bundlecaps
570 574 self._isshallow = shallow
575 self._fullnodes = fullnodes
571 576
572 577 # Maps ellipsis revs to their roots at the changelog level.
573 578 self._precomputedellipsis = ellipsisroots
@@ -744,7 +749,7 b' class cgpacker(object):'
744 749 # end up with bogus linkrevs specified for manifests and
745 750 # we skip some manifest nodes that we should otherwise
746 751 # have sent.
747 if (x in self._full_nodes
752 if (x in self._fullnodes
748 753 or cl.rev(x) in self._precomputedellipsis):
749 754 n = c[0]
750 755 # Record the first changeset introducing this manifest
@@ -1086,7 +1091,7 b' class cgpacker(object):'
1086 1091
1087 1092 # This is a node to send in full, because the changeset it
1088 1093 # corresponds to was a full changeset.
1089 if linknode in self._full_nodes:
1094 if linknode in self._fullnodes:
1090 1095 return self._revisiondeltanormal(store, rev, prev, linknode)
1091 1096
1092 1097 # At this point, a node can either be one we should skip or an
@@ -1135,7 +1140,7 b' class cgpacker(object):'
1135 1140 walk = walk[1:]
1136 1141 if p in self._clrevtolocalrev:
1137 1142 return self._clrevtolocalrev[p]
1138 elif p in self._full_nodes:
1143 elif p in self._fullnodes:
1139 1144 walk.extend([pp for pp in self._repo.changelog.parentrevs(p)
1140 1145 if pp != nullrev])
1141 1146 elif p in self._precomputedellipsis:
@@ -1194,7 +1199,7 b' class cgpacker(object):'
1194 1199 )
1195 1200
1196 1201 def _makecg1packer(repo, filematcher, bundlecaps, ellipses=False,
1197 shallow=False, ellipsisroots=None):
1202 shallow=False, ellipsisroots=None, fullnodes=None):
1198 1203 builddeltaheader = lambda d: _CHANGEGROUPV1_DELTA_HEADER.pack(
1199 1204 d.node, d.p1node, d.p2node, d.linknode)
1200 1205
@@ -1207,10 +1212,11 b' def _makecg1packer(repo, filematcher, bu'
1207 1212 bundlecaps=bundlecaps,
1208 1213 ellipses=ellipses,
1209 1214 shallow=shallow,
1210 ellipsisroots=ellipsisroots)
1215 ellipsisroots=ellipsisroots,
1216 fullnodes=fullnodes)
1211 1217
1212 1218 def _makecg2packer(repo, filematcher, bundlecaps, ellipses=False,
1213 shallow=False, ellipsisroots=None):
1219 shallow=False, ellipsisroots=None, fullnodes=None):
1214 1220 builddeltaheader = lambda d: _CHANGEGROUPV2_DELTA_HEADER.pack(
1215 1221 d.node, d.p1node, d.p2node, d.basenode, d.linknode)
1216 1222
@@ -1226,10 +1232,11 b' def _makecg2packer(repo, filematcher, bu'
1226 1232 bundlecaps=bundlecaps,
1227 1233 ellipses=ellipses,
1228 1234 shallow=shallow,
1229 ellipsisroots=ellipsisroots)
1235 ellipsisroots=ellipsisroots,
1236 fullnodes=fullnodes)
1230 1237
1231 1238 def _makecg3packer(repo, filematcher, bundlecaps, ellipses=False,
1232 shallow=False, ellipsisroots=None):
1239 shallow=False, ellipsisroots=None, fullnodes=None):
1233 1240 builddeltaheader = lambda d: _CHANGEGROUPV3_DELTA_HEADER.pack(
1234 1241 d.node, d.p1node, d.p2node, d.basenode, d.linknode, d.flags)
1235 1242
@@ -1242,7 +1249,8 b' def _makecg3packer(repo, filematcher, bu'
1242 1249 bundlecaps=bundlecaps,
1243 1250 ellipses=ellipses,
1244 1251 shallow=shallow,
1245 ellipsisroots=ellipsisroots)
1252 ellipsisroots=ellipsisroots,
1253 fullnodes=fullnodes)
1246 1254
1247 1255 _packermap = {'01': (_makecg1packer, cg1unpacker),
1248 1256 # cg2 adds support for exchanging generaldelta
@@ -1303,7 +1311,8 b' def safeversion(repo):'
1303 1311 return min(versions)
1304 1312
1305 1313 def getbundler(version, repo, bundlecaps=None, filematcher=None,
1306 ellipses=False, shallow=False, ellipsisroots=None):
1314 ellipses=False, shallow=False, ellipsisroots=None,
1315 fullnodes=None):
1307 1316 assert version in supportedoutgoingversions(repo)
1308 1317
1309 1318 if filematcher is None:
@@ -1325,7 +1334,8 b' def getbundler(version, repo, bundlecaps'
1325 1334
1326 1335 fn = _packermap[version][0]
1327 1336 return fn(repo, filematcher, bundlecaps, ellipses=ellipses,
1328 shallow=shallow, ellipsisroots=ellipsisroots)
1337 shallow=shallow, ellipsisroots=ellipsisroots,
1338 fullnodes=fullnodes)
1329 1339
1330 1340 def getunbundler(version, fh, alg, extras=None):
1331 1341 return _packermap[version][1](fh, alg, extras=extras)
@@ -1419,11 +1429,7 b' def _packellipsischangegroup(repo, commo'
1419 1429 packer = getbundler(version, repo, filematcher=match,
1420 1430 ellipses=True,
1421 1431 shallow=depth is not None,
1422 ellipsisroots=ellipsisroots)
1423 # Give the packer the list of nodes which should not be
1424 # ellipsis nodes. We store this rather than the set of nodes
1425 # that should be an ellipsis because for very large histories
1426 # we expect this to be significantly smaller.
1427 packer._full_nodes = relevant_nodes
1432 ellipsisroots=ellipsisroots,
1433 fullnodes=relevant_nodes)
1428 1434
1429 1435 return packer.generate(common, visitnodes, False, source)
General Comments 0
You need to be logged in to leave comments. Login now