~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/inventory.py

  • Committer: Martin Pool
  • Date: 2005-09-07 04:00:21 UTC
  • Revision ID: mbp@sourcefrog.net-20050907040020-2c7a5e0176888d95
- BROKEN: partial support for commit into weave

Show diffs side-by-side

added added

removed removed

Lines of Context:
149
149
 
150
150
    def copy(self):
151
151
        other = InventoryEntry(self.file_id, self.name, self.kind,
152
 
                               self.parent_id, text_id=self.text_id)
 
152
                               self.parent_id)
 
153
        other.text_id = self.text_id
153
154
        other.text_sha1 = self.text_sha1
154
155
        other.text_size = self.text_size
155
156
        # note that children are *not* copied; they're pulled across when
262
263
        self._byid = {self.root.file_id: self.root}
263
264
 
264
265
 
 
266
    def copy(self):
 
267
        other = Inventory(self.root.file_id)
 
268
        for entry in self._byid.itervalues():
 
269
            if entry == self.root:
 
270
                continue
 
271
            other.add(entry.copy())
 
272
        return other
 
273
 
 
274
 
265
275
    def __iter__(self):
266
276
        return iter(self._byid)
267
277