[Pkg-bazaar-commits] ./bzr/unstable r122: check: make sure parent of file entries are present

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


------------------------------------------------------------
revno: 122
committer: mbp at sourcefrog.net
timestamp: Tue 2005-03-29 10:07:23 +1000
message:
  check: make sure parent of file entries are present
modified:
  bzrlib/check.py
-------------- next part --------------
=== modified file 'bzrlib/check.py'
--- a/bzrlib/check.py	2005-03-29 00:03:28 +0000
+++ b/bzrlib/check.py	2005-03-29 00:07:23 +0000
@@ -77,17 +77,28 @@
     seen_ids = Set()
     seen_names = Set()
 
+    for file_id in inv:
+        if file_id in seen_ids:
+            bailout('duplicated file_id {%s} in inventory for revision {%s}'
+                    % (file_id, revid))
+        seen_ids.add(file_id)
+        
+    for file_id in inv:
+        ie = inv[file_id]
+        
+        if ie.parent_id != None:
+            if ie.parent_id not in seen_ids:
+                bailout('missing parent {%s} in inventory for revision {%s}'
+                        % (ie.parent_id, revid))
+
+        if ie.kind == 'file':
+            if not ie.text_id in branch.text_store:
+                bailout('text {%s} not in text_store' % ie.text_id)
+
+                
+            
     for path, ie in inv.iter_entries():
         if path in seen_names:
             bailout('duplicated path %r in inventory for revision {%s}' % (path, revid))
         seen_names.add(path)
         
-        if ie.file_id in seen_ids:
-            bailout('duplicated file_id {%s} in inventory for revision {%s}'
-                    % (ie.file_id, revid))
-        seen_ids.add(ie.file_id)
-            
-        if ie.kind == 'file':
-            if not ie.text_id in branch.text_store:
-                bailout('text {%s} not in text_store' % ie.text_id)
-        



More information about the Pkg-bazaar-commits mailing list