This is a relatively trivial operation to perform. We don't
need to use dagutil.
This brings us one step closer to eliminating dagutil.
We still need to populate the heads on revlogdag because later
functionality relies on it.
hg-reviewers |
This is a relatively trivial operation to perform. We don't
need to use dagutil.
This brings us one step closer to eliminating dagutil.
We still need to populate the heads on revlogdag because later
functionality relies on it.
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/setdiscovery.py (9 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
Gregory Szorc | Aug 16 2018, 4:23 PM |
Status | Author | Revision | |
---|---|---|---|
Closed | indygreg | D4330 dagutil: remove module | |
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 |
missing nodes from or in remote. | missing nodes from or in remote. | ||||
''' | ''' | ||||
start = util.timer() | start = util.timer() | ||||
roundtrips = 0 | roundtrips = 0 | ||||
cl = local.changelog | cl = local.changelog | ||||
clnode = cl.node | clnode = cl.node | ||||
clrev = cl.rev | clrev = cl.rev | ||||
localsubset = None | |||||
if ancestorsof is not None: | if ancestorsof is not None: | ||||
localsubset = [clrev(n) for n in ancestorsof] | ownheads = [clrev(n) for n in ancestorsof] | ||||
dag = dagutil.revlogdag(cl, localsubset=localsubset) | else: | ||||
ownheads = [rev for rev in cl.headrevs() if rev != nullrev] | |||||
dag = dagutil.revlogdag(cl, localsubset=ownheads) | |||||
# early exit if we know all the specified remote heads already | # early exit if we know all the specified remote heads already | ||||
ui.debug("query 1; heads\n") | ui.debug("query 1; heads\n") | ||||
roundtrips += 1 | roundtrips += 1 | ||||
ownheads = dag.heads() | |||||
sample = _limitsample(ownheads, initialsamplesize) | sample = _limitsample(ownheads, initialsamplesize) | ||||
# indices between sample and externalized version must match | # indices between sample and externalized version must match | ||||
sample = list(sample) | sample = list(sample) | ||||
with remote.commandexecutor() as e: | with remote.commandexecutor() as e: | ||||
fheads = e.callcommand('heads', {}) | fheads = e.callcommand('heads', {}) | ||||
fknown = e.callcommand('known', { | fknown = e.callcommand('known', { | ||||
'nodes': [clnode(r) for r in sample], | 'nodes': [clnode(r) for r in sample], |