Rev 4340: Put the branch-but-should-be-repo cross check code inrepository.py for reference. in http://people.ubuntu.com/~robertc/baz2.0/check
Robert Collins
robertc at robertcollins.net
Mon May 11 02:49:02 BST 2009
At http://people.ubuntu.com/~robertc/baz2.0/check
------------------------------------------------------------
revno: 4340
revision-id: robertc at robertcollins.net-20090511014900-02c29bkf0vnjve4j
parent: robertc at robertcollins.net-20090511014706-aybf5ou226d1c6hh
committer: Robert Collins <robertc at robertcollins.net>
branch nick: check
timestamp: Mon 2009-05-11 11:49:00 +1000
message:
Put the branch-but-should-be-repo cross check code inrepository.py for reference.
=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py 2009-05-01 07:59:02 +0000
+++ b/bzrlib/repository.py 2009-05-11 01:49:00 +0000
@@ -2462,6 +2462,31 @@
:param revision_ids: A non-empty list of revision_ids whose ancestry
will be checked. Typically the last revision_id of a branch.
"""
+ # TODO: Reinstate or confirm its obsolescence.
+ # from Branch.check - a cross check that the parents index
+ # (iter_reverse_revision_history uses that) and the revision objects
+ # match up.
+ #real_rev_history = list(self.repository.iter_reverse_revision_history(
+ # last_revision_id))
+ #real_rev_history.reverse()
+ #
+ #mainline_parent_id = None
+ #for revision_id in real_rev_history:
+ # try:
+ # revision = self.repository.get_revision(revision_id)
+ # except errors.NoSuchRevision, e:
+ # result.errors.append(errors.BzrCheckError(
+ # "mainline revision {%s} not in repository" % revision_id))
+ # break
+ # # In general the first entry on the revision history has no parents.
+ # # But it's not illegal for it to have parents listed; this can happen
+ # # in imports from Arch when the parents weren't reachable.
+ # if mainline_parent_id is not None:
+ # if mainline_parent_id not in revision.parent_ids:
+ # raise errors.BzrCheckError("previous revision {%s} not listed among "
+ # "parents of {%s}"
+ # % (mainline_parent_id, revision_id))
+ # mainline_parent_id = revision_id
return self._check(revision_ids)
def _check(self, revision_ids):
More information about the bazaar-commits
mailing list