Show More
@@ -169,6 +169,7 b' class partialdiscovery(object):' | |||||
169 |
|
169 | |||
170 | - common: own nodes I know we both know |
|
170 | - common: own nodes I know we both know | |
171 | - undecided: own nodes where I don't know if remote knows them |
|
171 | - undecided: own nodes where I don't know if remote knows them | |
|
172 | - missing: own nodes I know remote lacks | |||
172 | """ |
|
173 | """ | |
173 |
|
174 | |||
174 | def __init__(self, repo, targetheads): |
|
175 | def __init__(self, repo, targetheads): | |
@@ -176,12 +177,24 b' class partialdiscovery(object):' | |||||
176 | self._targetheads = targetheads |
|
177 | self._targetheads = targetheads | |
177 | self._common = repo.changelog.incrementalmissingrevs() |
|
178 | self._common = repo.changelog.incrementalmissingrevs() | |
178 | self._undecided = None |
|
179 | self._undecided = None | |
|
180 | self.missing = set() | |||
179 |
|
181 | |||
180 | def addcommons(self, commons): |
|
182 | def addcommons(self, commons): | |
181 | """registrer nodes known as common""" |
|
183 | """registrer nodes known as common""" | |
182 | self._common.addbases(commons) |
|
184 | self._common.addbases(commons) | |
183 | self._common.removeancestorsfrom(self.undecided) |
|
185 | self._common.removeancestorsfrom(self.undecided) | |
184 |
|
186 | |||
|
187 | def addmissings(self, missings): | |||
|
188 | """registrer some nodes as missing""" | |||
|
189 | if self.missing: | |||
|
190 | new = self._repo.revs('descendants(%ld) - descendants(%ld)', | |||
|
191 | missings, self.missing) | |||
|
192 | self.missing.update(new) | |||
|
193 | else: | |||
|
194 | self.missing.update(self._repo.revs('descendants(%ld)', missings)) | |||
|
195 | ||||
|
196 | self.undecided.difference_update(self.missing) | |||
|
197 | ||||
185 | def hasinfo(self): |
|
198 | def hasinfo(self): | |
186 | """return True is we have any clue about the remote state""" |
|
199 | """return True is we have any clue about the remote state""" | |
187 | return self._common.hasbases() |
|
200 | return self._common.hasbases() | |
@@ -277,8 +290,6 b' def findcommonheads(ui, local, remote,' | |||||
277 | disco.addcommons(srvheads) |
|
290 | disco.addcommons(srvheads) | |
278 | commoninsample = set(n for i, n in enumerate(sample) if yesno[i]) |
|
291 | commoninsample = set(n for i, n in enumerate(sample) if yesno[i]) | |
279 | disco.addcommons(commoninsample) |
|
292 | disco.addcommons(commoninsample) | |
280 | # own nodes I know remote lacks |
|
|||
281 | missing = set() |
|
|||
282 |
|
293 | |||
283 | full = False |
|
294 | full = False | |
284 | progress = ui.makeprogress(_('searching'), unit=_('queries')) |
|
295 | progress = ui.makeprogress(_('searching'), unit=_('queries')) | |
@@ -286,14 +297,8 b' def findcommonheads(ui, local, remote,' | |||||
286 |
|
297 | |||
287 | if sample: |
|
298 | if sample: | |
288 | missinginsample = [n for i, n in enumerate(sample) if not yesno[i]] |
|
299 | missinginsample = [n for i, n in enumerate(sample) if not yesno[i]] | |
|
300 | disco.addmissings(missinginsample) | |||
289 |
|
301 | |||
290 | if missing: |
|
|||
291 | missing.update(local.revs('descendants(%ld) - descendants(%ld)', |
|
|||
292 | missinginsample, missing)) |
|
|||
293 | else: |
|
|||
294 | missing.update(local.revs('descendants(%ld)', missinginsample)) |
|
|||
295 |
|
||||
296 | disco.undecided.difference_update(missing) |
|
|||
297 |
|
302 | |||
298 | if disco.iscomplete(): |
|
303 | if disco.iscomplete(): | |
299 | break |
|
304 | break |
General Comments 0
You need to be logged in to leave comments.
Login now