Rev 2: Handle if fids/rids is 0. in http://bazaar.launchpad.net/%7Ejameinel/%2Bjunk/bzr-dump

John Arbash Meinel john at arbash-meinel.com
Wed Mar 4 04:28:19 GMT 2009


At http://bazaar.launchpad.net/%7Ejameinel/%2Bjunk/bzr-dump

------------------------------------------------------------
revno: 2
revision-id: john at arbash-meinel.com-20090304042759-743wvtajjbx6zq3t
parent: john at arbash-meinel.com-20090304034534-zjytp6m07p65frvy
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: bzr-dump
timestamp: Tue 2009-03-03 22:27:59 -0600
message:
  Handle if fids/rids is 0.
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py	2009-03-04 03:45:34 +0000
+++ b/__init__.py	2009-03-04 04:27:59 +0000
@@ -15,7 +15,7 @@
             revs = repo.revisions.keys()
             rev_ids = [rev[0] for rev in revs]
             n_interned = sum([1 for r in rev_ids if dump_pyx.is_interned(r)])
-            trace.note('interned: %d/%d', n_interned, len(rev_ids))
+            trace.note('interned rev ids: %d/%d', n_interned, len(rev_ids))
             pb = ui.ui_factory.nested_progress_bar()
             try:
                 fids = 0
@@ -40,6 +40,8 @@
             del revs, rev_ids, text_keys
         finally:
             repo.unlock()
+            fids = max(fids, 1)
+            rids = max(rids, 1)
             trace.note('interned fids: %d/%d %.1f%%', fids_interned, fids,
                        100.0 * fids_interned / fids)
             trace.note('interned rids: %d/%d %.1f%%', rids_interned, rids,



More information about the bazaar-commits mailing list