I assume these debug output, increment and comment drifted over time.
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
I assume these debug output, increment and comment drifted over time.
No Linters Available |
No Unit Test Coverage |
clnode = cl.node | clnode = cl.node | ||||
clrev = cl.rev | clrev = cl.rev | ||||
if ancestorsof is not None: | if ancestorsof is not None: | ||||
ownheads = [clrev(n) for n in ancestorsof] | ownheads = [clrev(n) for n in ancestorsof] | ||||
else: | else: | ||||
ownheads = [rev for rev in cl.headrevs() if rev != nullrev] | ownheads = [rev for rev in cl.headrevs() if rev != nullrev] | ||||
# early exit if we know all the specified remote heads already | |||||
ui.debug(b"query 1; heads\n") | |||||
roundtrips += 1 | |||||
# We also ask remote about all the local heads. That set can be arbitrarily | # We also ask remote about all the local heads. That set can be arbitrarily | ||||
# large, so we used to limit it size to `initialsamplesize`. We no longer | # large, so we used to limit it size to `initialsamplesize`. We no longer | ||||
# do as it proved counter productive. The skipped heads could lead to a | # do as it proved counter productive. The skipped heads could lead to a | ||||
# large "undecided" set, slower to be clarified than if we asked the | # large "undecided" set, slower to be clarified than if we asked the | ||||
# question for all heads right away. | # question for all heads right away. | ||||
# | # | ||||
# We are already fetching all server heads using the `heads` commands, | # We are already fetching all server heads using the `heads` commands, | ||||
# sending a equivalent number of heads the other way should not have a | # sending a equivalent number of heads the other way should not have a | ||||
# not been met in the wild so far. | # not been met in the wild so far. | ||||
if remote.limitedarguments: | if remote.limitedarguments: | ||||
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) | ||||
else: | else: | ||||
sample = ownheads | sample = ownheads | ||||
ui.debug(b"query 1; heads\n") | |||||
roundtrips += 1 | |||||
with remote.commandexecutor() as e: | with remote.commandexecutor() as e: | ||||
fheads = e.callcommand(b'heads', {}) | fheads = e.callcommand(b'heads', {}) | ||||
fknown = e.callcommand( | fknown = e.callcommand( | ||||
b'known', | b'known', | ||||
{ | { | ||||
b'nodes': [clnode(r) for r in sample], | b'nodes': [clnode(r) for r in sample], | ||||
}, | }, | ||||
) | ) | ||||
continue | continue | ||||
try: | try: | ||||
knownsrvheads.append(clrev(node)) | knownsrvheads.append(clrev(node)) | ||||
# Catches unknown and filtered nodes. | # Catches unknown and filtered nodes. | ||||
except error.LookupError: | except error.LookupError: | ||||
continue | continue | ||||
# early exit if we know all the specified remote heads already | |||||
if len(knownsrvheads) == len(srvheadhashes): | if len(knownsrvheads) == len(srvheadhashes): | ||||
ui.debug(b"all remote heads known locally\n") | ui.debug(b"all remote heads known locally\n") | ||||
return srvheadhashes, False, srvheadhashes | return srvheadhashes, False, srvheadhashes | ||||
if len(sample) == len(ownheads) and all(yesno): | if len(sample) == len(ownheads) and all(yesno): | ||||
ui.note(_(b"all local changesets known remotely\n")) | ui.note(_(b"all local changesets known remotely\n")) | ||||
ownheadhashes = [clnode(r) for r in ownheads] | ownheadhashes = [clnode(r) for r in ownheads] | ||||
return ownheadhashes, True, srvheadhashes | return ownheadhashes, True, srvheadhashes |