Show More
@@ -104,8 +104,6 b' class progbar(object):' | |||||
104 | self.order = self.ui.configlist('progress', 'format') |
|
104 | self.order = self.ui.configlist('progress', 'format') | |
105 | self.estimateinterval = self.ui.configwith( |
|
105 | self.estimateinterval = self.ui.configwith( | |
106 | float, 'progress', 'estimateinterval') |
|
106 | float, 'progress', 'estimateinterval') | |
107 | # developer config: progress.debug |
|
|||
108 | self.debug = self.ui.configbool('progress', 'debug') |
|
|||
109 |
|
107 | |||
110 | def show(self, now, topic, pos, item, unit, total): |
|
108 | def show(self, now, topic, pos, item, unit, total): | |
111 | if not shouldprint(self.ui): |
|
109 | if not shouldprint(self.ui): |
@@ -1421,6 +1421,7 b' class progress(object):' | |||||
1421 | self.topic = topic |
|
1421 | self.topic = topic | |
1422 | self.unit = unit |
|
1422 | self.unit = unit | |
1423 | self.total = total |
|
1423 | self.total = total | |
|
1424 | self.debug = ui.configbool('progress', 'debug') | |||
1424 |
|
1425 | |||
1425 | def __enter__(self): |
|
1426 | def __enter__(self): | |
1426 | return self |
|
1427 | return self | |
@@ -1458,14 +1459,7 b' class progress(object):' | |||||
1458 | self.ui._progbar.progress(self.topic, self.pos, item=item, |
|
1459 | self.ui._progbar.progress(self.topic, self.pos, item=item, | |
1459 | unit=self.unit, total=self.total) |
|
1460 | unit=self.unit, total=self.total) | |
1460 |
|
1461 | |||
1461 | # Looking up progress.debug in tight loops is expensive. The value |
|
1462 | if self.pos is None or not self.debug: | |
1462 | # is cached on the progbar object and we can avoid the lookup in |
|
|||
1463 | # the common case where a progbar is active. |
|
|||
1464 | if self.pos is None or not self.ui._progbar.debug: |
|
|||
1465 | return |
|
|||
1466 |
|
||||
1467 | # Keep this logic in sync with above. |
|
|||
1468 | if self.pos is None or not self.ui.configbool('progress', 'debug'): |
|
|||
1469 | return |
|
1463 | return | |
1470 |
|
1464 | |||
1471 | if self.unit: |
|
1465 | if self.unit: |
General Comments 0
You need to be logged in to leave comments.
Login now