diff options
Diffstat (limited to 'libbe/storage/vcs/base.py')
-rw-r--r-- | libbe/storage/vcs/base.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/libbe/storage/vcs/base.py b/libbe/storage/vcs/base.py index 662fc30..69e412e 100644 --- a/libbe/storage/vcs/base.py +++ b/libbe/storage/vcs/base.py @@ -446,6 +446,7 @@ os.listdir(self.get_path("bugs")): kwargs['encoding'] = libbe.util.encoding.get_filesystem_encoding() libbe.storage.base.VersionedStorage.__init__(self, *args, **kwargs) self.versioned = False + self.interspersed_vcs_files = False self.verbose_invoke = False self._cached_path_id = CachedPathID() self._rooted = False @@ -514,6 +515,18 @@ os.listdir(self.get_path("bugs")): """ pass + def _vcs_is_versioned(self, path): + """ + Return true if a path is under version control, False + otherwise. You only need to set this if the VCS goes about + dumping VCS-specific files into the .be directory. + + If you do need to implement this method (e.g. Arch), set + self.interspersed_vcs_files = True + """ + assert self.interspersed_vcs_files == False + raise NotImplementedError + def _vcs_get_file_contents(self, path, revision=None): """ Get the file contents as they were in a given revision. @@ -704,7 +717,11 @@ os.listdir(self.get_path("bugs")): for i,c in enumerate(children): if c == None: continue cpath = os.path.join(path, c) - children[i] = self._cached_path_id.id(cpath) + if self.interspersed_vcs_files == True \ + and self._vcs_is_versioned(cpath) == False: + children[i] = None + else: + children[i] = self._cached_path_id.id(cpath) return [c for c in children if c != None] def _get(self, id, default=libbe.util.InvalidObject, revision=None): |