~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.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:
519
519
        return False
520
520
 
521
521
    def kind(self, file_id):
522
 
        assert self._inventory[file_id].kind == "directory"
523
522
        return "directory"
524
523
 
525
524
    def list_files(self, include_root=False):
568
567
        # what happened to the file that used to have
569
568
        # this name.  There are two possibilities: either it was
570
569
        # deleted entirely, or renamed.
571
 
        assert old_id
572
570
        if new_inv.has_id(old_id):
573
571
            return 'X', old_inv.id2path(old_id), new_inv.id2path(old_id)
574
572
        else: