/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/git/tree.py

Merge iter-entries-by-dir branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
438
438
        return self._submodules
439
439
 
440
440
    def list_files(self, include_root=False, from_dir=None, recursive=True,
441
 
                   follow_tree_references=False):
 
441
                   recurse_nested=False):
442
442
        if self.tree is None:
443
443
            return
444
444
        if from_dir is None or from_dir == '.':
469
469
                    continue
470
470
                child_path = posixpath.join(path, name)
471
471
                child_relpath = posixpath.join(relpath, name)
472
 
                if S_ISGITLINK(mode) and follow_tree_references:
 
472
                if S_ISGITLINK(mode) and recurse_nested:
473
473
                    mode = stat.S_IFDIR
474
474
                    store = self._get_submodule_store(child_relpath)
475
475
                    hexsha = store[hexsha].tree
531
531
                                        file_id)
532
532
 
533
533
    def iter_entries_by_dir(self, specific_files=None,
534
 
                            follow_tree_references=False):
 
534
                            recurse_nested=False):
535
535
        if self.tree is None:
536
536
            return
537
537
        if specific_files is not None:
552
552
                    continue
553
553
                child_path = posixpath.join(path, name)
554
554
                child_path_decoded = child_path.decode('utf-8')
555
 
                if follow_tree_references and S_ISGITLINK(mode):
 
555
                if recurse_nested and S_ISGITLINK(mode):
556
556
                    mode = stat.S_IFDIR
557
557
                    store = self._get_submodule_store(child_path)
558
558
                    hexsha = store[hexsha].tree
1213
1213
            self._ensure_versioned_dir(index_path)
1214
1214
 
1215
1215
    def _recurse_index_entries(self, index=None, basepath=b"",
1216
 
                               follow_tree_references=False):
 
1216
                               recurse_nested=False):
1217
1217
        # Iterate over all index entries
1218
1218
        with self.lock_read():
1219
1219
            if index is None:
1221
1221
            for path, value in index.items():
1222
1222
                (ctime, mtime, dev, ino, mode, uid, gid, size, sha,
1223
1223
                 flags) = value
1224
 
                if S_ISGITLINK(mode) and follow_tree_references:
 
1224
                if S_ISGITLINK(mode) and recurse_nested:
1225
1225
                    subindex = self._get_submodule_index(path)
1226
1226
                    for entry in self._recurse_index_entries(
1227
1227
                            index=subindex, basepath=path,
1228
 
                            follow_tree_references=follow_tree_references):
 
1228
                            recurse_nested=recurse_nested):
1229
1229
                        yield entry
1230
1230
                else:
1231
1231
                    yield (posixpath.join(basepath, path), value)
1232
1232
 
1233
1233
    def iter_entries_by_dir(self, specific_files=None,
1234
 
                            follow_tree_references=False):
 
1234
                            recurse_nested=False):
1235
1235
        with self.lock_read():
1236
1236
            if specific_files is not None:
1237
1237
                specific_files = set(specific_files)
1243
1243
                ret[(u"", u"")] = root_ie
1244
1244
            dir_ids = {u"": root_ie.file_id}
1245
1245
            for path, value in self._recurse_index_entries(
1246
 
                    follow_tree_references=follow_tree_references):
 
1246
                    recurse_nested=recurse_nested):
1247
1247
                if self.mapping.is_special_file(path):
1248
1248
                    continue
1249
1249
                path = path.decode("utf-8")