~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/check.py

  • Committer: Martin Pool
  • Date: 2005-09-19 07:52:30 UTC
  • Revision ID: mbp@sourcefrog.net-20050919075230-bd8a133ef1671044
- remove RevisionReference; just hold parent ids directly

Show diffs side-by-side

added added

removed removed

Lines of Context:
120
120
                    raise BzrCheckError("revision {%s} has %d parents, but is the "
121
121
                                        "start of the branch"
122
122
                                        % (rev_id, len(rev.parents)))
123
 
                for prr in rev.parents:
124
 
                    if prr.revision_id == last_rev_id:
 
123
                for parent_id in rev.parents:
 
124
                    if parent_id == last_rev_id:
125
125
                        break
126
126
                else:
127
127
                    raise BzrCheckError("previous revision {%s} not listed among "
128
128
                                        "parents of {%s}"
129
129
                                        % (last_rev_id, rev_id))
130
 
 
131
 
                for prr in rev.parents:
132
 
                    if prr.revision_sha1 is None:
133
 
                        missing_revision_sha_cnt += 1
134
 
                        continue
135
 
                    prid = prr.revision_id
136
 
                    
137
 
                    try:
138
 
                        actual_sha = branch.get_revision_sha1(prid)
139
 
                    except NoSuchRevision:
140
 
                        missing_revision_cnt += 1
141
 
                        mutter("parent {%s} of {%s} not present in store",
142
 
                               prid, rev_id)
143
 
                        continue
144
 
                        
145
 
                    if prr.revision_sha1 != actual_sha:
146
 
                        raise BzrCheckError("mismatched revision sha1 for "
147
 
                                            "parent {%s} of {%s}: %s vs %s"
148
 
                                            % (prid, rev_id,
149
 
                                               prr.revision_sha1, actual_sha))
150
130
            elif last_rev_id:
151
 
                raise BzrCheckError("revision {%s} has no parents listed but preceded "
152
 
                                    "by {%s}"
 
131
                raise BzrCheckError("revision {%s} has no parents listed "
 
132
                                    "but preceded by {%s}"
153
133
                                    % (rev_id, last_rev_id))
154
134
 
155
135
            ## TODO: Check all the required fields are present on the revision.