It now does nothing special. The logic is simple enough to inline
in the 2 callers in narrow that need it.
The changegroup generation APIs could probably be a bit simpler.
But that's for another time.
durin42 |
hg-reviewers |
It now does nothing special. The logic is simple enough to inline
in the 2 callers in narrow that need it.
The changegroup generation APIs could probably be a bit simpler.
But that's for another time.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Path | Packages | |||
---|---|---|---|---|
M | hgext/narrow/narrowbundle2.py (26 lines) | |||
M | mercurial/changegroup.py (15 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg |
for r in deadrevs: | for r in deadrevs: | ||||
yield _KILLNODESIGNAL | yield _KILLNODESIGNAL | ||||
yield repo.changelog.node(r) | yield repo.changelog.node(r) | ||||
yield _DONESIGNAL | yield _DONESIGNAL | ||||
bundler.newpart(_CHANGESPECPART, data=genkills()) | bundler.newpart(_CHANGESPECPART, data=genkills()) | ||||
newvisit, newfull, newellipsis = exchange._computeellipsis( | newvisit, newfull, newellipsis = exchange._computeellipsis( | ||||
repo, set(), common, known, newmatch) | repo, set(), common, known, newmatch) | ||||
if newvisit: | if newvisit: | ||||
cg = changegroup._packellipsischangegroup( | packer = changegroup.getbundler(version, repo, | ||||
repo, common, newmatch, newfull, newellipsis, | filematcher=newmatch, | ||||
newvisit, depth, source, version) | ellipses=True, | ||||
part = bundler.newpart('changegroup', data=cg) | shallow=depth is not None, | ||||
ellipsisroots=newellipsis, | |||||
fullnodes=newfull) | |||||
cgdata = packer.generate(common, newvisit, False, source) | |||||
part = bundler.newpart('changegroup', data=cgdata) | |||||
part.addparam('version', version) | part.addparam('version', version) | ||||
if 'treemanifest' in repo.requirements: | if 'treemanifest' in repo.requirements: | ||||
part.addparam('treemanifest', '1') | part.addparam('treemanifest', '1') | ||||
visitnodes, relevant_nodes, ellipsisroots = exchange._computeellipsis( | visitnodes, relevant_nodes, ellipsisroots = exchange._computeellipsis( | ||||
repo, common, heads, set(), newmatch, depth=depth) | repo, common, heads, set(), newmatch, depth=depth) | ||||
repo.ui.debug('Found %d relevant revs\n' % len(relevant_nodes)) | repo.ui.debug('Found %d relevant revs\n' % len(relevant_nodes)) | ||||
if visitnodes: | if visitnodes: | ||||
cg = changegroup._packellipsischangegroup( | packer = changegroup.getbundler(version, repo, | ||||
repo, common, newmatch, relevant_nodes, ellipsisroots, | filematcher=newmatch, | ||||
visitnodes, depth, source, version) | ellipses=True, | ||||
part = bundler.newpart('changegroup', data=cg) | shallow=depth is not None, | ||||
ellipsisroots=ellipsisroots, | |||||
fullnodes=relevant_nodes) | |||||
cgdata = packer.generate(common, visitnodes, False, source) | |||||
part = bundler.newpart('changegroup', data=cgdata) | |||||
part.addparam('version', version) | part.addparam('version', version) | ||||
if 'treemanifest' in repo.requirements: | if 'treemanifest' in repo.requirements: | ||||
part.addparam('treemanifest', '1') | part.addparam('treemanifest', '1') | ||||
@bundle2.parthandler(_SPECPART, (_SPECPART_INCLUDE, _SPECPART_EXCLUDE)) | @bundle2.parthandler(_SPECPART, (_SPECPART_INCLUDE, _SPECPART_EXCLUDE)) | ||||
def _handlechangespec_2(op, inpart): | def _handlechangespec_2(op, inpart): | ||||
includepats = set(inpart.params.get(_SPECPART_INCLUDE, '').splitlines()) | includepats = set(inpart.params.get(_SPECPART_INCLUDE, '').splitlines()) | ||||
excludepats = set(inpart.params.get(_SPECPART_EXCLUDE, '').splitlines()) | excludepats = set(inpart.params.get(_SPECPART_EXCLUDE, '').splitlines()) |
try: | try: | ||||
fl.rev(n) | fl.rev(n) | ||||
except error.LookupError: | except error.LookupError: | ||||
raise error.Abort( | raise error.Abort( | ||||
_('missing file data for %s:%s - run hg verify') % | _('missing file data for %s:%s - run hg verify') % | ||||
(f, hex(n))) | (f, hex(n))) | ||||
return revisions, files | return revisions, files | ||||
def _packellipsischangegroup(repo, common, match, relevant_nodes, | |||||
ellipsisroots, visitnodes, depth, source, version): | |||||
# We wrap cg1packer.revchunk, using a side channel to pass | |||||
# relevant_nodes into that area. Then if linknode isn't in the | |||||
# set, we know we have an ellipsis node and we should defer | |||||
# sending that node's data. We override close() to detect | |||||
# pending ellipsis nodes and flush them. | |||||
packer = getbundler(version, repo, filematcher=match, | |||||
ellipses=True, | |||||
shallow=depth is not None, | |||||
ellipsisroots=ellipsisroots, | |||||
fullnodes=relevant_nodes) | |||||
return packer.generate(common, visitnodes, False, source) |