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