~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/reconcile.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-05-08 07:05:00 UTC
  • mfrom: (3376.2.15 no-asserts)
  • Revision ID: pqm@pqm.ubuntu.com-20080508070500-9zyyvsk0eev20t4w
(mbp) remove and disallow assert statements

Show diffs side-by-side

added added

removed removed

Lines of Context:
246
246
            parents = self._rev_graph[rev_id]
247
247
            # double check this really is in topological order.
248
248
            unavailable = [p for p in parents if p not in new_inventory_vf]
249
 
            assert len(unavailable) == 0
 
249
            if unavailable:
 
250
                raise AssertionError('unavailable parents: %r'
 
251
                    % unavailable)
250
252
            # this entry has all the non ghost parents in the inventory
251
253
            # file already.
252
254
            self._reweave_step('adding inventories')
265
267
            new_inventory_vf._save()
266
268
        # if this worked, the set of new_inventory_vf.names should equal
267
269
        # self.pending
268
 
        assert set(new_inventory_vf.versions()) == self.pending
 
270
        if not (set(new_inventory_vf.versions()) == self.pending):
 
271
            raise AssertionError()
269
272
        self.pb.update('Writing weave')
270
273
        self.repo.control_weaves.copy(new_inventory_vf, 'inventory', self.repo.get_transaction())
271
274
        self.repo.control_weaves.delete('inventory.new', self.repo.get_transaction())
283
286
        # analyse revision id rev_id and put it in the stack.
284
287
        self._reweave_step('loading revisions')
285
288
        rev = self.repo.get_revision_reconcile(rev_id)
286
 
        assert rev.revision_id == rev_id
287
289
        parents = []
288
290
        for parent in rev.parent_ids:
289
291
            if self._parent_is_available(parent):
402
404
            # double check this really is in topological order, ignoring existing ghosts.
403
405
            unavailable = [p for p in parents if p not in new_inventory_vf and
404
406
                p in self.revisions]
405
 
            assert len(unavailable) == 0
 
407
            if unavailable:
 
408
                raise AssertionError(
 
409
                    'unavailable parents: %r' % (unavailable,))
406
410
            # this entry has all the non ghost parents in the inventory
407
411
            # file already.
408
412
            self._reweave_step('adding inventories')
412
416
 
413
417
        # if this worked, the set of new_inventory_vf.names should equal
414
418
        # self.pending
415
 
        assert set(new_inventory_vf.versions()) == set(self.revisions.versions())
 
419
        if not(set(new_inventory_vf.versions()) == set(self.revisions.versions())):
 
420
            raise AssertionError()
416
421
        self.pb.update('Writing weave')
417
422
        self.repo.control_weaves.copy(new_inventory_vf, 'inventory', self.transaction)
418
423
        self.repo.control_weaves.delete('inventory.new', self.transaction)