~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revisiontree.py

  • Committer: John Arbash Meinel
  • Date: 2009-06-17 17:57:15 UTC
  • mfrom: (4454 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4460.
  • Revision ID: john@arbash-meinel.com-20090617175715-p9ebpwx5rhc0qin1
Merge bzr.dev 4454 in preparation for NEWS entry.

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
    def has_filename(self, filename):
115
115
        return bool(self.inventory.path2id(filename))
116
116
 
117
 
    def list_files(self, include_root=False):
 
117
    def list_files(self, include_root=False, from_dir=None, recursive=True):
118
118
        # The only files returned by this are those from the version
119
 
        entries = self.inventory.iter_entries()
120
 
        # skip the root for compatability with the current apis.
121
 
        if self.inventory.root is not None and not include_root:
 
119
        inv = self.inventory
 
120
        if from_dir is None:
 
121
            from_dir_id = None
 
122
        else:
 
123
            from_dir_id = inv.path2id(from_dir)
 
124
            if from_dir_id is None:
 
125
                # Directory not versioned
 
126
                return
 
127
        entries = inv.iter_entries(from_dir=from_dir_id, recursive=recursive)
 
128
        if inv.root is not None and not include_root and from_dir is None:
122
129
            # skip the root for compatability with the current apis.
123
130
            entries.next()
124
131
        for path, entry in entries: