So it is obvious which nodes we are talking about.
And sneak in a docs change to reflect that this variable is a set.
hg-reviewers |
So it is obvious which nodes we are talking about.
And sneak in a docs change to reflect that this variable is a set.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Path | Packages | |||
---|---|---|---|---|
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 | ||
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 |
bundlecaps is optional and can be used to specify the set of | bundlecaps is optional and can be used to specify the set of | ||||
capabilities which can be used to build the bundle. While bundlecaps is | capabilities which can be used to build the bundle. While bundlecaps is | ||||
unused in core Mercurial, extensions rely on this feature to communicate | unused in core Mercurial, extensions rely on this feature to communicate | ||||
capabilities to customize the changegroup packer. | capabilities to customize the changegroup packer. | ||||
shallow indicates whether shallow data might be sent. The packer may | shallow indicates whether shallow data might be sent. The packer may | ||||
need to pack file contents not introduced by the changes being packed. | need to pack file contents not introduced by the changes being packed. | ||||
fullnodes is the list of nodes which should not be ellipsis nodes. We | fullnodes is the set of changelog nodes which should not be ellipsis | ||||
store this rather than the set of nodes that should be ellipsis because | nodes. We store this rather than the set of nodes that should be | ||||
for very large histories we expect this to be significantly smaller. | ellipsis because for very large histories we expect this to be | ||||
significantly smaller. | |||||
""" | """ | ||||
assert filematcher | assert filematcher | ||||
self._filematcher = filematcher | self._filematcher = filematcher | ||||
self.version = version | self.version = version | ||||
self._deltaparentfn = deltaparentfn | self._deltaparentfn = deltaparentfn | ||||
self._builddeltaheader = builddeltaheader | self._builddeltaheader = builddeltaheader | ||||
self._manifestsend = manifestsend | self._manifestsend = manifestsend | ||||
self._ellipses = ellipses | self._ellipses = ellipses | ||||
# Set of capabilities we can use to build the bundle. | # Set of capabilities we can use to build the bundle. | ||||
if bundlecaps is None: | if bundlecaps is None: | ||||
bundlecaps = set() | bundlecaps = set() | ||||
self._bundlecaps = bundlecaps | self._bundlecaps = bundlecaps | ||||
self._isshallow = shallow | self._isshallow = shallow | ||||
self._fullnodes = fullnodes | self._fullclnodes = fullnodes | ||||
# Maps ellipsis revs to their roots at the changelog level. | # Maps ellipsis revs to their roots at the changelog level. | ||||
self._precomputedellipsis = ellipsisroots | self._precomputedellipsis = ellipsisroots | ||||
# experimental config: bundle.reorder | # experimental config: bundle.reorder | ||||
reorder = repo.ui.config('bundle', 'reorder') | reorder = repo.ui.config('bundle', 'reorder') | ||||
if reorder == 'auto': | if reorder == 'auto': | ||||
self._reorder = allowreorder | self._reorder = allowreorder | ||||
linknode = lookup(store.node(curr)) | linknode = lookup(store.node(curr)) | ||||
if self._ellipses: | if self._ellipses: | ||||
linkrev = self._clnodetorev[linknode] | linkrev = self._clnodetorev[linknode] | ||||
self._clrevtolocalrev[linkrev] = curr | self._clrevtolocalrev[linkrev] = curr | ||||
# This is a node to send in full, because the changeset it | # This is a node to send in full, because the changeset it | ||||
# corresponds to was a full changeset. | # corresponds to was a full changeset. | ||||
if linknode in self._fullnodes: | if linknode in self._fullclnodes: | ||||
delta = _revisiondeltanormal(store, curr, prev, linknode, | delta = _revisiondeltanormal(store, curr, prev, linknode, | ||||
self._deltaparentfn) | self._deltaparentfn) | ||||
elif linkrev not in self._precomputedellipsis: | elif linkrev not in self._precomputedellipsis: | ||||
delta = None | delta = None | ||||
else: | else: | ||||
delta = self._revisiondeltanarrow(store, ischangelog, | delta = self._revisiondeltanarrow(store, ischangelog, | ||||
curr, linkrev, linknode) | curr, linkrev, linknode) | ||||
else: | else: | ||||
if self._ellipses: | if self._ellipses: | ||||
self._clnodetorev[x] = cl.rev(x) | self._clnodetorev[x] = cl.rev(x) | ||||
# Only update mfs if x is going to be sent. Otherwise we | # Only update mfs if x is going to be sent. Otherwise we | ||||
# end up with bogus linkrevs specified for manifests and | # end up with bogus linkrevs specified for manifests and | ||||
# we skip some manifest nodes that we should otherwise | # we skip some manifest nodes that we should otherwise | ||||
# have sent. | # have sent. | ||||
if (x in self._fullnodes | if (x in self._fullclnodes | ||||
or cl.rev(x) in self._precomputedellipsis): | or cl.rev(x) in self._precomputedellipsis): | ||||
n = c[0] | n = c[0] | ||||
# Record the first changeset introducing this manifest | # Record the first changeset introducing this manifest | ||||
# version. | # version. | ||||
mfs.setdefault(n, x) | mfs.setdefault(n, x) | ||||
# Set this narrow-specific dict so we have the lowest | # Set this narrow-specific dict so we have the lowest | ||||
# manifest revnum to look up for this cl revnum. (Part of | # manifest revnum to look up for this cl revnum. (Part of | ||||
# mapping changelog ellipsis parents to manifest ellipsis | # mapping changelog ellipsis parents to manifest ellipsis | ||||
# entry will have been relevant, so we need to skip some changelog | # entry will have been relevant, so we need to skip some changelog | ||||
# nodes even after ellipsis-izing. | # nodes even after ellipsis-izing. | ||||
walk = [clrev] | walk = [clrev] | ||||
while walk: | while walk: | ||||
p = walk[0] | p = walk[0] | ||||
walk = walk[1:] | walk = walk[1:] | ||||
if p in self._clrevtolocalrev: | if p in self._clrevtolocalrev: | ||||
return self._clrevtolocalrev[p] | return self._clrevtolocalrev[p] | ||||
elif p in self._fullnodes: | elif p in self._fullclnodes: | ||||
walk.extend([pp for pp in self._repo.changelog.parentrevs(p) | walk.extend([pp for pp in self._repo.changelog.parentrevs(p) | ||||
if pp != nullrev]) | if pp != nullrev]) | ||||
elif p in self._precomputedellipsis: | elif p in self._precomputedellipsis: | ||||
walk.extend([pp for pp in self._precomputedellipsis[p] | walk.extend([pp for pp in self._precomputedellipsis[p] | ||||
if pp != nullrev]) | if pp != nullrev]) | ||||
else: | else: | ||||
# In this case, we've got an ellipsis with parents | # In this case, we've got an ellipsis with parents | ||||
# outside the current bundle (likely an | # outside the current bundle (likely an |