~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree_4.py

  • Committer: Martin Pool
  • Date: 2009-06-19 09:06:56 UTC
  • mfrom: (4463 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4464.
  • Revision ID: mbp@sourcefrog.net-20090619090656-d5weqeecyscv8kqp
merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
1440
1440
                # Note: do NOT move this logic up higher - using the basis from
1441
1441
                # the accelerator tree is still desirable because that can save
1442
1442
                # a minute or more of processing on large trees!
 
1443
                # The original tree may not have the same content filters
 
1444
                # applied so we can't safely build the inventory delta from
 
1445
                # the source tree.
1443
1446
                if wt.supports_content_filtering():
1444
1447
                    accelerator_tree = None
 
1448
                    delta_from_tree = False
 
1449
                else:
 
1450
                    delta_from_tree = True
1445
1451
                # delta_from_tree is safe even for DirStateRevisionTrees,
1446
1452
                # because wt4.apply_inventory_delta does not mutate the input
1447
1453
                # inventory entries.
1448
1454
                transform.build_tree(basis, wt, accelerator_tree,
1449
 
                                     hardlink=hardlink, delta_from_tree=True)
 
1455
                                     hardlink=hardlink,
 
1456
                                     delta_from_tree=delta_from_tree)
1450
1457
            finally:
1451
1458
                basis.unlock()
1452
1459
        finally:
1837
1844
            return None
1838
1845
        return ie.executable
1839
1846
 
1840
 
    def list_files(self, include_root=False):
 
1847
    def list_files(self, include_root=False, from_dir=None, recursive=True):
1841
1848
        # We use a standard implementation, because DirStateRevisionTree is
1842
1849
        # dealing with one of the parents of the current state
1843
1850
        inv = self._get_inventory()
1844
 
        entries = inv.iter_entries()
1845
 
        if self.inventory.root is not None and not include_root:
 
1851
        if from_dir is None:
 
1852
            from_dir_id = None
 
1853
        else:
 
1854
            from_dir_id = inv.path2id(from_dir)
 
1855
            if from_dir_id is None:
 
1856
                # Directory not versioned
 
1857
                return
 
1858
        entries = inv.iter_entries(from_dir=from_dir_id, recursive=recursive)
 
1859
        if inv.root is not None and not include_root and from_dir is None:
1846
1860
            entries.next()
1847
1861
        for path, entry in entries:
1848
1862
            yield path, 'V', entry.kind, entry.file_id, entry