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