# HG changeset patch # User David Soria Parra # Date 1323873668 -3600 # Node ID 06671371e634531ae648d14d9cffaae3fe057d31 # Parent 20ae902c43ec5560868b1321c9f156a8c33ef53d progress: check for ui.quiet and ui.debugflag before we write ui.quiet and ui.debugflag are not initialized during uisetup and reposetup. progressui is always initialized, therefore we have to check during write() if ui.quiet is set or not. diff -r 20ae902c43ec -r 06671371e634 hgext/progress.py --- a/hgext/progress.py Fri Dec 16 18:23:15 2011 -0600 +++ b/hgext/progress.py Wed Dec 14 15:41:08 2011 +0100 @@ -271,17 +271,21 @@ class progressui(ui.__class__): _progbar = None + def _quiet(self): + return self.debugflag or self.quiet + def progress(self, *args, **opts): - self._progbar.progress(*args, **opts) + if not self._quiet(): + self._progbar.progress(*args, **opts) return super(progressui, self).progress(*args, **opts) def write(self, *args, **opts): - if self._progbar.printed: + if not self._quiet() and self._progbar.printed: self._progbar.clear() return super(progressui, self).write(*args, **opts) def write_err(self, *args, **opts): - if self._progbar.printed: + if not self._quiet() and self._progbar.printed: self._progbar.clear() return super(progressui, self).write_err(*args, **opts)