diff options
author | W. Trevor King <wking@drexel.edu> | 2010-01-18 10:10:30 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2010-01-18 10:10:30 -0500 |
commit | 8e0e670cb788d941d3ce109da41d1d4491c85032 (patch) | |
tree | 62b21ed40cb7dd625634e84c8846ce8aae2468e3 /libbe/storage/vcs/base.py | |
parent | 3de27f5863be5ce00a4afef7eb5a4ea918c136db (diff) | |
download | bugseverywhere-8e0e670cb788d941d3ce109da41d1d4491c85032.tar.gz |
Added VCS._ancestors
Diffstat (limited to 'libbe/storage/vcs/base.py')
-rw-r--r-- | libbe/storage/vcs/base.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libbe/storage/vcs/base.py b/libbe/storage/vcs/base.py index 1719f06..692064c 100644 --- a/libbe/storage/vcs/base.py +++ b/libbe/storage/vcs/base.py @@ -745,6 +745,27 @@ os.listdir(self.get_path("bugs")): if p.startswith(path): self._cached_path_id.remove_id(id) + def _ancestors(self, id=None, revision=None): + if revision == None: + id_to_path = self._cached_path_id.path + else: + id_to_path = lambda id : self._vcs_path(id, revision) + if id==None: + path = self.be_dir + else: + path = id_to_path(id) + ancestors = [] + while True: + if path == self.repo: + break + path = os.path.dirname(path) + try: + id = self._u_path_to_id(path) + ancestors.append(id) + except (SpacerCollision, InvalidPath): + pass + return ancestors + def _children(self, id=None, revision=None): if revision == None: id_to_path = self._cached_path_id.path |