##// END OF EJS Templates
discovery: move handling of sampling special case inside sampling function...
Boris Feld -
r41146:3c85a62d default
parent child Browse files
Show More
@@ -102,6 +102,8 b' def _takequicksample(repo, headrevs, rev'
102 102 :headrevs: set of head revisions in local DAG to consider
103 103 :revs: set of revs to discover
104 104 :size: the maximum size of the sample"""
105 if len(revs) <= size:
106 return list(revs)
105 107 sample = set(repo.revs('heads(%ld)', revs))
106 108
107 109 if len(sample) >= size:
@@ -112,6 +114,8 b' def _takequicksample(repo, headrevs, rev'
112 114 return sample
113 115
114 116 def _takefullsample(repo, headrevs, revs, size):
117 if len(revs) <= size:
118 return list(revs)
115 119 sample = set(repo.revs('heads(%ld)', revs))
116 120
117 121 # update from heads
@@ -264,10 +268,7 b' def findcommonheads(ui, local, remote,'
264 268 ui.debug("taking quick initial sample\n")
265 269 samplefunc = _takequicksample
266 270 targetsize = initialsamplesize
267 if len(undecided) <= targetsize:
268 sample = list(undecided)
269 else:
270 sample = samplefunc(local, ownheads, undecided, targetsize)
271 sample = samplefunc(local, ownheads, undecided, targetsize)
271 272
272 273 roundtrips += 1
273 274 progress.update(roundtrips)
General Comments 0
You need to be logged in to leave comments. Login now