##// END OF EJS Templates
setdiscovery: use a revset for finding DAG heads in a subset...
Gregory Szorc -
r39205:14099275 default
parent child Browse files
Show More
@@ -96,7 +96,7 b' def _updatesample(dag, revs, sample, qui'
96 96 dist.setdefault(p, d + 1)
97 97 visit.append(p)
98 98
99 def _takequicksample(dag, revs, size):
99 def _takequicksample(repo, dag, revs, size):
100 100 """takes a quick sample of size <size>
101 101
102 102 It is meant for initial sampling and focuses on querying heads and close
@@ -105,14 +105,16 b' def _takequicksample(dag, revs, size):'
105 105 :dag: a dag object
106 106 :revs: set of revs to discover
107 107 :size: the maximum size of the sample"""
108 sample = dag.headsetofconnecteds(revs)
108 sample = set(repo.revs('heads(%ld)', revs))
109
109 110 if len(sample) >= size:
110 111 return _limitsample(sample, size)
111 112 _updatesample(dag, None, sample, quicksamplesize=size)
112 113 return sample
113 114
114 def _takefullsample(dag, revs, size):
115 sample = dag.headsetofconnecteds(revs)
115 def _takefullsample(repo, dag, revs, size):
116 sample = set(repo.revs('heads(%ld)', revs))
117
116 118 # update from heads
117 119 _updatesample(dag, revs, sample)
118 120 # update from roots
@@ -242,7 +244,7 b' def findcommonheads(ui, local, remote,'
242 244 if len(undecided) < targetsize:
243 245 sample = list(undecided)
244 246 else:
245 sample = samplefunc(dag, undecided, targetsize)
247 sample = samplefunc(local, dag, undecided, targetsize)
246 248
247 249 roundtrips += 1
248 250 progress.update(roundtrips)
General Comments 0
You need to be logged in to leave comments. Login now