##// END OF EJS Templates
setdiscovery: don't call "heads" wire command when heads specified...
Martin von Zweigbergk -
r35867:5cfdf613 default
parent child Browse files
Show More
@@ -62,7 +62,7 b' def findcommonincoming(repo, remote, hea'
62 if allknown:
62 if allknown:
63 return (heads, False, heads)
63 return (heads, False, heads)
64
64
65 res = setdiscovery.findcommonheads(repo.ui, repo, remote,
65 res = setdiscovery.findcommonheads(repo.ui, repo, remote, heads,
66 abortwhenunrelated=not force,
66 abortwhenunrelated=not force,
67 ancestorsof=ancestorsof)
67 ancestorsof=ancestorsof)
68 common, anyinc, srvheads = res
68 common, anyinc, srvheads = res
@@ -130,7 +130,7 b' def _limitsample(sample, desiredlen):'
130 sample = set(random.sample(sample, desiredlen))
130 sample = set(random.sample(sample, desiredlen))
131 return sample
131 return sample
132
132
133 def findcommonheads(ui, local, remote,
133 def findcommonheads(ui, local, remote, heads=None,
134 initialsamplesize=100,
134 initialsamplesize=100,
135 fullsamplesize=200,
135 fullsamplesize=200,
136 abortwhenunrelated=True,
136 abortwhenunrelated=True,
@@ -155,11 +155,15 b' def findcommonheads(ui, local, remote,'
155 sample = _limitsample(ownheads, initialsamplesize)
155 sample = _limitsample(ownheads, initialsamplesize)
156 # indices between sample and externalized version must match
156 # indices between sample and externalized version must match
157 sample = list(sample)
157 sample = list(sample)
158 batch = remote.iterbatch()
158 if heads:
159 batch.heads()
159 srvheadhashes = heads
160 batch.known(dag.externalizeall(sample))
160 yesno = remote.known(dag.externalizeall(sample))
161 batch.submit()
161 else:
162 srvheadhashes, yesno = batch.results()
162 batch = remote.iterbatch()
163 batch.heads()
164 batch.known(dag.externalizeall(sample))
165 batch.submit()
166 srvheadhashes, yesno = batch.results()
163
167
164 if cl.tip() == nullid:
168 if cl.tip() == nullid:
165 if srvheadhashes != [nullid]:
169 if srvheadhashes != [nullid]:
General Comments 0
You need to be logged in to leave comments. Login now