[Pkg-bazaar-commits] ./bzr/unstable r117: better messages from check command

mbp at sourcefrog.net mbp at sourcefrog.net
Fri Apr 10 07:51:10 UTC 2009


------------------------------------------------------------
revno: 117
committer: mbp at sourcefrog.net
timestamp: Mon 2005-03-28 20:04:39 +1000
message:
  better messages from check command
modified:
  bzrlib/check.py
-------------- next part --------------
=== modified file 'bzrlib/check.py'
--- a/bzrlib/check.py	2005-03-28 04:16:10 +0000
+++ b/bzrlib/check.py	2005-03-28 10:04:39 +0000
@@ -23,21 +23,21 @@
 
 import bzrlib
 from trace import mutter
+from errors import bailout
 
-def _ass(a, b):
-    if a != b:
-        bzrlib.errors.bailout("check failed: %r != %r" % (a, b))
 
 def check(branch):
     mutter('checking tree %r' % branch.base)
 
-    mutter('checking entire revision history is present')
+    mutter('checking revision history')
     last_ptr = None
     for rid in branch.revision_history():
         mutter('    revision {%s}' % rid)
         rev = branch.get_revision(rid)
-        _ass(rev.revision_id, rid)
-        _ass(rev.precursor, last_ptr)
+        if rev.revision_id != rid:
+            bailout('wrong internal revision id in revision {%s}' % rid)
+        if rev.precursor != last_ptr:
+            bailout('mismatched precursor in revision {%s}' % rid)
         last_ptr = rid
 
     #mutter("checking tree")



More information about the Pkg-bazaar-commits mailing list