Rev 3038: Simplify the check_file_version_parents API some more. This has already changed in this release cycle. in http://people.ubuntu.com/~robertc/baz2.0/check

Robert Collins robertc at robertcollins.net
Tue Nov 27 22:04:44 GMT 2007


At http://people.ubuntu.com/~robertc/baz2.0/check

------------------------------------------------------------
revno: 3038
revision-id:robertc at robertcollins.net-20071127220431-tdbtagcse2nigx8k
parent: robertc at robertcollins.net-20071127215836-300j320ru8mbyl85
committer: Robert Collins <robertc at robertcollins.net>
branch nick: check
timestamp: Wed 2007-11-28 09:04:31 +1100
message:
  Simplify the check_file_version_parents API some more. This has already changed in this release cycle.
modified:
  bzrlib/check.py                check.py-20050309040759-f3a679400c06bcc1
  bzrlib/reconcile.py            reweave_inventory.py-20051108164726-1e5e0934febac06e
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
=== modified file 'bzrlib/check.py'
--- a/bzrlib/check.py	2007-11-27 21:58:36 +0000
+++ b/bzrlib/check.py	2007-11-27 22:04:31 +0000
@@ -209,8 +209,7 @@
                     self.repository.get_transaction())
             # No progress here, because it looks ugly.
             w.check()
-            result = weave_checker.check_file_version_parents(w, weave_id,
-                w.versions())
+            result = weave_checker.check_file_version_parents(w, weave_id)
             bad_parents, unused_versions = result
             bad_parents = bad_parents.items()
             for revision_id, (weave_parents, correct_parents) in bad_parents:

=== modified file 'bzrlib/reconcile.py'
--- a/bzrlib/reconcile.py	2007-11-16 01:28:59 +0000
+++ b/bzrlib/reconcile.py	2007-11-27 22:04:31 +0000
@@ -388,8 +388,7 @@
                            len(self.repo.weave_store))
             vf = self.repo.weave_store.get_weave(file_id, transaction)
             versions_with_bad_parents, unused_versions = \
-                vf_checker.check_file_version_parents(vf, file_id,
-                vf.versions())
+                vf_checker.check_file_version_parents(vf, file_id)
             if (len(versions_with_bad_parents) == 0 and
                 len(unused_versions) == 0):
                 continue

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2007-11-25 17:54:55 +0000
+++ b/bzrlib/repository.py	2007-11-27 22:04:31 +0000
@@ -2900,7 +2900,7 @@
         # strip the file_id, for the weave api
         return tuple([revision_id for file_id, revision_id in parent_keys])
 
-    def check_file_version_parents(self, weave, file_id, planned_revisions):
+    def check_file_version_parents(self, weave, file_id):
         """Check the parents stored in a versioned file are correct.
 
         It also detects file versions that are not referenced by their
@@ -2915,12 +2915,12 @@
         """
         wrong_parents = {}
         unused_versions = set()
-        for num, revision_id in enumerate(planned_revisions):
+        for num, revision_id in enumerate(weave.versions()):
             try:
                 correct_parents = self.calculate_file_version_parents(
                     revision_id, file_id)
             except KeyError:
-                # we were asked to investigate a non-existant version.
+                # The version is not part of the used keys.
                 unused_versions.add(revision_id)
             else:
                 try:



More information about the bazaar-commits mailing list