~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

Create a paths2ids api to replace find_ids_across_trees, with tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
216
216
        """Return the id for path in this tree."""
217
217
        return self._inventory.path2id(path)
218
218
 
 
219
    def paths2ids(self, paths, trees=[]):
 
220
        """Return all the ids that can be reached by walking from paths.
 
221
        
 
222
        Each path is looked up in each this tree and any extras provided in
 
223
        trees, and this is repeated recursively: the children in an extra tree
 
224
        of a directory that has been renamed under a provided path in this tree
 
225
        are all returned, even if none exist until a provided path in this
 
226
        tree, and vice versa.
 
227
        """
 
228
        return find_ids_across_trees(paths, [self] + trees)
 
229
 
219
230
    def print_file(self, file_id):
220
231
        """Print file with id `file_id` to stdout."""
221
232
        import sys