~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/check.py

  • Committer: Robert Collins
  • Date: 2005-09-14 09:01:06 UTC
  • mto: (1185.1.12)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: robertc@robertcollins.net-20050914090106-50ddfad9500a8ae9
make diff lsdiff/filterdiff friendly

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
    :param inv_id:  The inventory id for this inventory
73
73
    :param branch:  The Branch where this entry will be stored.
74
74
    """
75
 
    raise NotImplementedError("can't update existing inventory entry")
 
75
    _update_store_entry(inv, inv_id, branch,
 
76
            'inventory-store', branch.inventory_store)
76
77
 
77
78
 
78
79
def check(branch):
154
155
                                    "by {%s}"
155
156
                                    % (rev_id, last_rev_id))
156
157
 
157
 
            if hasattr(rev, 'inventory_id') and rev.inventory_id != rev_id:
 
158
            if rev.inventory_id != rev_id:
158
159
                mismatch_inv_id.append(rev_id)
159
160
 
160
161
            ## TODO: Check all the required fields are present on the revision.
161
162
 
162
163
            if rev.inventory_sha1:
163
 
                inv_sha1 = branch.get_inventory_sha1(rev_id)
 
164
                inv_sha1 = branch.get_inventory_sha1(rev.inventory_id)
164
165
                if inv_sha1 != rev.inventory_sha1:
165
166
                    raise BzrCheckError('Inventory sha1 hash doesn\'t match'
166
167
                        ' value in revision {%s}' % rev_id)
168
169
                missing_inventory_sha_cnt += 1
169
170
                mutter("no inventory_sha1 on revision {%s}" % rev_id)
170
171
 
171
 
            inv = branch.get_inventory(rev_id)
 
172
            inv = branch.get_inventory(rev.inventory_id)
172
173
            seen_ids = {}
173
174
            seen_names = {}
174
175