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