[Pkg-bazaar-commits] ./bzr/unstable r114: - reactivate basic check command
mbp at sourcefrog.net
mbp at sourcefrog.net
Fri Apr 10 07:44:15 UTC 2009
------------------------------------------------------------
revno: 114
committer: mbp at sourcefrog.net
timestamp: Mon 2005-03-28 14:08:13 +1000
message:
- reactivate basic check command
modified:
bzrlib/check.py
-------------- next part --------------
=== modified file 'bzrlib/check.py'
--- a/bzrlib/check.py 2005-03-28 02:49:46 +0000
+++ b/bzrlib/check.py 2005-03-28 04:08:13 +0000
@@ -20,24 +20,32 @@
######################################################################
# consistency checks
-def check():
- """check: Consistency check of branch history.
-
-usage: bzr check [-v] [BRANCH]
-
-options:
- --verbose, -v Show progress of checking.
-
-This command checks various invariants about the branch storage to
-detect data corruption or bzr bugs.
-"""
- assert_in_tree()
- mutter("checking tree")
- check_patches_exist()
- check_patch_chaining()
- check_patch_uniqueness()
- check_inventory()
- mutter("tree looks OK")
+
+import bzrlib
+
+
+def _ass(a, b):
+ if a != b:
+ bzrlib.errors.bailout("check failed: %r != %r" % (a, b))
+
+def check(branch, verbose=True):
+ print 'checking tree %r' % branch.base
+
+ print 'checking entire revision history is present'
+ last_ptr = None
+ for rid in branch.revision_history():
+ print ' revision {%s}' % rid
+ rev = branch.get_revision(rid)
+ _ass(rev.revision_id, rid)
+ _ass(rev.precursor, last_ptr)
+ last_ptr = rid
+
+ #mutter("checking tree")
+ #check_patches_exist()
+ #check_patch_chaining()
+ #check_patch_uniqueness()
+ #check_inventory()
+ print ("tree looks OK")
## TODO: Check that previous-inventory and previous-manifest
## are the same as those stored in the previous changeset.
More information about the Pkg-bazaar-commits
mailing list