~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/knitrepo.py

  • Committer: Martin Pool
  • Date: 2008-04-24 07:22:53 UTC
  • mto: This revision was merged to the branch mainline in revision 3415.
  • Revision ID: mbp@sourcefrog.net-20080424072253-opmjij7xfy38w27f
Remove every assert statement from bzrlib!

Depending on the context they are:

 * turned into an explicit if/raise of either AssertionError 
   or something more specific -- particularly where they protect
   programming interfaces, complex invariants, or data file integrity
 * removed, if they're redundant with a later check, not protecting
   a meaningful invariant
 * turned into a selftest method on tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
303
303
        :returns: an iterator yielding tuples of (revison-id, parents-in-index,
304
304
            parents-in-revision).
305
305
        """
306
 
        assert self.is_locked()
 
306
        if not self.is_locked():
 
307
            raise AssertionError()
307
308
        vf = self._get_revision_vf()
308
309
        for index_version in vf.versions():
309
310
            parents_according_to_index = tuple(vf.get_parents_with_ghosts(
430
431
        """
431
432
        if not _found:
432
433
            format = RepositoryFormat.find_format(a_bzrdir)
433
 
            assert format.__class__ ==  self.__class__
434
434
        if _override_transport is not None:
435
435
            repo_transport = _override_transport
436
436
        else: