~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/inventory.py

  • Committer: Ian Clatworthy
  • Author(s): Vincent Ladeuil
  • Date: 2009-04-03 05:17:24 UTC
  • mto: (4246.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 4247.
  • Revision ID: ian.clatworthy@canonical.com-20090403051724-1rtkgua4zrhbrfrg
inv._get_mutable_inventory() - prepare for CHKInventory

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
# created, but it's not for now.
28
28
ROOT_ID = "TREE_ROOT"
29
29
 
30
 
import os
31
 
import re
32
 
import sys
 
30
from copy import deepcopy
33
31
 
34
32
from bzrlib.lazy_import import lazy_import
35
33
lazy_import(globals(), """
36
34
import collections
 
35
import os
 
36
import re
37
37
import tarfile
38
38
 
39
39
import bzrlib
877
877
            other.add(entry.copy())
878
878
        return other
879
879
 
 
880
    def _get_mutable_inventory(self):
 
881
        """Returns a mutable copy of the object.
 
882
 
 
883
        Some inventories are immutable, yet working trees, for example, needs
 
884
        to mutate exisiting inventories instead of creating a new one.
 
885
        """
 
886
        return deepcopy(self)
 
887
 
880
888
    def __iter__(self):
881
889
        return iter(self._byid)
882
890