Comments
Patch
@@ -42,9 +42,10 @@ def findcommonincoming(repo, remote, hea
if allknown:
return (heads, False, heads)
res = setdiscovery.findcommonheads(repo.ui, repo, remote,
- abortwhenunrelated=not force)
+ abortwhenunrelated=not force,
+ wantednodes=heads)
common, anyinc, srvheads = res
return (list(common), anyinc, heads or list(srvheads))
class outgoing(object):
@@ -120,11 +120,15 @@ def _limitsample(sample, desiredlen):
def findcommonheads(ui, local, remote,
initialsamplesize=100,
fullsamplesize=200,
- abortwhenunrelated=True):
+ abortwhenunrelated=True,
+ wantednodes=None):
'''Return a tuple (common, anyincoming, remoteheads) used to identify
missing nodes from or in remote.
+
+ "wantednodes" is an optional iterable of nodes that we want from the
+ remote. It is used as a hint to possibly enable more efficient discovery.
'''
roundtrips = 0
cl = local.changelog
dag = dagutil.revlogdag(cl)