Rev 3964: (jam) Avoid getting a UserWarning by not creating an unused progress in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Jan 27 20:24:46 GMT 2009


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

------------------------------------------------------------
revno: 3964
revision-id: pqm at pqm.ubuntu.com-20090127202443-ty2bu1hh91dumasz
parent: pqm at pqm.ubuntu.com-20090127184345-wkncpsyxov2citpy
parent: john at arbash-meinel.com-20090126205756-wh552ozttirfo2m9
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2009-01-27 20:24:43 +0000
message:
  (jam) Avoid getting a UserWarning by not creating an unused progress
  	bar.
modified:
  bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
    ------------------------------------------------------------
    revno: 3960.2.1
    revision-id: john at arbash-meinel.com-20090126205756-wh552ozttirfo2m9
    parent: pqm at pqm.ubuntu.com-20090126181248-yl5ctbxc3y6nu9m4
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: 1.12-progress-warnings
    timestamp: Mon 2009-01-26 14:57:56 -0600
    message:
      There is no need to create a progress bar that we don't even use.
    modified:
      bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
=== modified file 'bzrlib/fetch.py'
--- a/bzrlib/fetch.py	2008-12-02 05:11:07 +0000
+++ b/bzrlib/fetch.py	2009-01-26 20:57:56 +0000
@@ -232,23 +232,19 @@
     def _fetch_inventory_weave(self, revs, pb):
         pb.update("fetch inventory", 0, 2)
         to_weave = self.to_repository.inventories
-        child_pb = bzrlib.ui.ui_factory.nested_progress_bar()
-        try:
-            # just merge, this is optimisable and its means we don't
-            # copy unreferenced data such as not-needed inventories.
-            pb.update("fetch inventory", 1, 3)
-            from_weave = self.from_repository.inventories
-            pb.update("fetch inventory", 2, 3)
-            # we fetch only the referenced inventories because we do not
-            # know for unselected inventories whether all their required
-            # texts are present in the other repository - it could be
-            # corrupt.
-            to_weave.insert_record_stream(from_weave.get_record_stream(
-                [(rev_id,) for rev_id in revs],
-                self.to_repository._fetch_order,
-                not self.to_repository._fetch_uses_deltas))
-        finally:
-            child_pb.finished()
+        # just merge, this is optimisable and its means we don't
+        # copy unreferenced data such as not-needed inventories.
+        pb.update("fetch inventory", 1, 3)
+        from_weave = self.from_repository.inventories
+        pb.update("fetch inventory", 2, 3)
+        # we fetch only the referenced inventories because we do not
+        # know for unselected inventories whether all their required
+        # texts are present in the other repository - it could be
+        # corrupt.
+        to_weave.insert_record_stream(from_weave.get_record_stream(
+            [(rev_id,) for rev_id in revs],
+            self.to_repository._fetch_order,
+            not self.to_repository._fetch_uses_deltas))
 
     def _fetch_revision_texts(self, revs, pb):
         # fetch signatures first and then the revision texts




More information about the bazaar-commits mailing list