comparison mercurial/setdiscovery.py @ 51690:493034cc3265

black: format the codebase with 23.3.0 The CI has moved to 23.3.0, which is the last version that supports 3.7 at runtime, so we should honor this change. # skip-blame mass-reformating only
author Raphaël Gomès <rgomes@octobus.net>
date Thu, 18 Jul 2024 12:36:12 +0200
parents c217d94cdd9d
children 7f0cb9ee0534
comparison
equal deleted inserted replaced
51689:39e2b2d062c1 51690:493034cc3265
188 return getrev(r)[5:7] 188 return getrev(r)[5:7]
189 189
190 return getparents 190 return getparents
191 191
192 def _childrengetter(self): 192 def _childrengetter(self):
193
194 if self._childrenmap is not None: 193 if self._childrenmap is not None:
195 # During discovery, the `undecided` set keep shrinking. 194 # During discovery, the `undecided` set keep shrinking.
196 # Therefore, the map computed for an iteration N will be 195 # Therefore, the map computed for an iteration N will be
197 # valid for iteration N+1. Instead of computing the same 196 # valid for iteration N+1. Instead of computing the same
198 # data over and over we cached it the first time. 197 # data over and over we cached it the first time.
452 disco.addinfo(zip(sample, yesno)) 451 disco.addinfo(zip(sample, yesno))
453 452
454 full = not initial_head_exchange 453 full = not initial_head_exchange
455 progress = ui.makeprogress(_(b'searching'), unit=_(b'queries')) 454 progress = ui.makeprogress(_(b'searching'), unit=_(b'queries'))
456 while not disco.iscomplete(): 455 while not disco.iscomplete():
457
458 if full or disco.hasinfo(): 456 if full or disco.hasinfo():
459 if full: 457 if full:
460 ui.note(_(b"sampling from both directions\n")) 458 ui.note(_(b"sampling from both directions\n"))
461 else: 459 else:
462 ui.debug(b"taking initial sample\n") 460 ui.debug(b"taking initial sample\n")