~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revisiontree.py

  • Committer: Patch Queue Manager
  • Date: 2012-02-07 00:57:24 UTC
  • mfrom: (6405.2.18 bzr)
  • Revision ID: pqm@pqm.ubuntu.com-20120207005724-xvfawh5exf1ohusu
(jelmer) Rename Tree.inventory to Tree.root_inventory. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
141
141
        # The only files returned by this are those from the version
142
142
        if from_dir is None:
143
143
            from_dir_id = None
144
 
            inv = self.inventory
 
144
            inv = self.root_inventory
145
145
        else:
146
146
            inv, from_dir_id = self._path2inv_file_id(from_dir)
147
147
            if from_dir_id is None:
165
165
        return inv[inv_file_id].reference_revision
166
166
 
167
167
    def get_root_id(self):
168
 
        if self.inventory.root:
169
 
            return self.inventory.root.file_id
 
168
        if self.root_inventory.root:
 
169
            return self.root_inventory.root.file_id
170
170
 
171
171
    def kind(self, file_id):
172
172
        inv, inv_file_id = self._unpack_file_id(file_id)
252
252
            and isinstance(target, RevisionTree)):
253
253
            try:
254
254
                # Only CHK inventories have id_to_entry attribute
255
 
                source.inventory.id_to_entry
256
 
                target.inventory.id_to_entry
 
255
                source.root_inventory.id_to_entry
 
256
                target.root_inventory.id_to_entry
257
257
                return True
258
258
            except AttributeError:
259
259
                pass
277
277
        # to CHKInventory.iter_changes and do a better job there -- vila
278
278
        # 20090304
279
279
        changed_file_ids = set()
280
 
        for result in self.target.inventory.iter_changes(
281
 
                self.source.inventory):
 
280
        # FIXME: nested tree support
 
281
        for result in self.target.root_inventory.iter_changes(
 
282
                self.source.root_inventory):
282
283
            if specific_file_ids is not None:
283
284
                file_id = result[0]
284
285
                if file_id not in specific_file_ids:
300
301
            # required to.
301
302
            # Now walk the whole inventory, excluding the already yielded
302
303
            # file ids
 
304
            # FIXME: Support nested trees
303
305
            changed_file_ids = set(changed_file_ids)
304
 
            for relpath, entry in self.target.inventory.iter_entries():
 
306
            for relpath, entry in self.target.root_inventory.iter_entries():
305
307
                if (specific_file_ids is not None
306
308
                    and not entry.file_id in specific_file_ids):
307
309
                    continue