~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/inventory.py

  • Committer: Jelmer Vernooij
  • Date: 2007-10-24 20:38:50 UTC
  • mto: This revision was merged to the branch mainline in revision 2943.
  • Revision ID: jelmer@samba.org-20071024203850-3f9x8rq4iupamufm
Handle empty inventories in Inventory.copy().

Show diffs side-by-side

added added

removed removed

Lines of Context:
948
948
    def copy(self):
949
949
        # TODO: jam 20051218 Should copy also copy the revision_id?
950
950
        entries = self.iter_entries()
 
951
        if self.root is None:
 
952
            return Inventory(root_id=None)
951
953
        other = Inventory(entries.next()[1].file_id)
952
954
        # copy recursively so we know directories will be added before
953
955
        # their children.  There are more efficient ways than this...