Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/ui.py @ 34368:f61f5af5ed31
merge with stable
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Sat, 30 Sep 2017 07:52:48 -0700 |
parents | a254c669b475 0e4bed5c5c38 |
children | ae2fcf7af409 |
comparison
equal
deleted
inserted
replaced
34367:d00910b286cd | 34368:f61f5af5ed31 |
---|---|
1486 return None | 1486 return None |
1487 return getprogbar(self) | 1487 return getprogbar(self) |
1488 | 1488 |
1489 def _progclear(self): | 1489 def _progclear(self): |
1490 """clear progress bar output if any. use it before any output""" | 1490 """clear progress bar output if any. use it before any output""" |
1491 if '_progbar' not in vars(self): # nothing loaded yet | 1491 if not haveprogbar(): # nothing loaded yet |
1492 return | 1492 return |
1493 if self._progbar is not None and self._progbar.printed: | 1493 if self._progbar is not None and self._progbar.printed: |
1494 self._progbar.clear() | 1494 self._progbar.clear() |
1495 | 1495 |
1496 def progress(self, topic, pos, item="", unit="", total=None): | 1496 def progress(self, topic, pos, item="", unit="", total=None): |
1790 if _progresssingleton is None: | 1790 if _progresssingleton is None: |
1791 # passing 'ui' object to the singleton is fishy, | 1791 # passing 'ui' object to the singleton is fishy, |
1792 # this is how the extension used to work but feel free to rework it. | 1792 # this is how the extension used to work but feel free to rework it. |
1793 _progresssingleton = progress.progbar(ui) | 1793 _progresssingleton = progress.progbar(ui) |
1794 return _progresssingleton | 1794 return _progresssingleton |
1795 | |
1796 def haveprogbar(): | |
1797 return _progresssingleton is not None |