Rev 4074: (mbp) be more robust in warnings about progressbar usage in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Mar 3 05:40:58 GMT 2009


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 4074
revision-id: pqm at pqm.ubuntu.com-20090303054055-1qi1msga1fc98tkr
parent: pqm at pqm.ubuntu.com-20090303050240-nkz12llmbepj8oo5
parent: mbp at sourcefrog.net-20090303021314-l0syyc4sbv0r113j
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2009-03-03 05:40:55 +0000
message:
  (mbp) be more robust in warnings about progressbar usage
modified:
  bzrlib/ui/text.py              text.py-20051130153916-2e438cffc8afc478
    ------------------------------------------------------------
    revno: 4070.1.1
    revision-id: mbp at sourcefrog.net-20090303021314-l0syyc4sbv0r113j
    parent: pqm at pqm.ubuntu.com-20090302155409-89pygn9tisbc0lir
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: progress
    timestamp: Tue 2009-03-03 13:13:14 +1100
    message:
      Be more robust about pb updates when none are active
    modified:
      bzrlib/ui/text.py              text.py-20051130153916-2e438cffc8afc478
=== modified file 'bzrlib/ui/text.py'
--- a/bzrlib/ui/text.py	2009-02-25 00:45:39 +0000
+++ b/bzrlib/ui/text.py	2009-03-03 02:13:14 +0000
@@ -91,7 +91,10 @@
     def _progress_updated(self, task):
         """A task has been updated and wants to be displayed.
         """
-        if task != self._task_stack[-1]:
+        if not self._task_stack:
+            warnings.warn("%r updated but no tasks are active" %
+                (task,))
+        elif task != self._task_stack[-1]:
             warnings.warn("%r is not the top progress task %r" %
                 (task, self._task_stack[-1]))
         self._progress_view.show_progress(task)




More information about the bazaar-commits mailing list