Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/progress.py @ 45957:89a2afe31e82
formating: upgrade to black 20.8b1
This required a couple of small tweaks to un-confuse black, but now it
works. Big formatting changes come from:
* Dramatically improved collection-splitting logic upstream
* Black having a strong (correct IMO) opinion that """ is better than '''
Differential Revision: https://phab.mercurial-scm.org/D9430
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Fri, 27 Nov 2020 17:03:29 -0500 |
parents | 4e0a6d157910 |
children | 6000f5b25c9b |
comparison
equal
deleted
inserted
replaced
45956:346af7687c6f | 45957:89a2afe31e82 |
---|---|
249 return True | 249 return True |
250 else: | 250 else: |
251 return False | 251 return False |
252 | 252 |
253 def _calibrateestimate(self, topic, now, pos): | 253 def _calibrateestimate(self, topic, now, pos): |
254 '''Adjust starttimes and startvals for topic so ETA works better | 254 """Adjust starttimes and startvals for topic so ETA works better |
255 | 255 |
256 If progress is non-linear (ex. get much slower in the last minute), | 256 If progress is non-linear (ex. get much slower in the last minute), |
257 it's more friendly to only use a recent time span for ETA and speed | 257 it's more friendly to only use a recent time span for ETA and speed |
258 calculation. | 258 calculation. |
259 | 259 |
260 [======================================> ] | 260 [======================================> ] |
261 ^^^^^^^ | 261 ^^^^^^^ |
262 estimateinterval, only use this for estimation | 262 estimateinterval, only use this for estimation |
263 ''' | 263 """ |
264 interval = self.estimateinterval | 264 interval = self.estimateinterval |
265 if interval <= 0: | 265 if interval <= 0: |
266 return | 266 return |
267 elapsed = now - self.starttimes[topic] | 267 elapsed = now - self.starttimes[topic] |
268 if elapsed > interval: | 268 if elapsed > interval: |