diff options
author | W. Trevor King <wking@drexel.edu> | 2010-12-06 10:43:49 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2010-12-06 10:43:49 -0500 |
commit | ab090d8929f7019aa68876fd825766f472fd9138 (patch) | |
tree | 6a933e9b9e539cacdecfc5f459fc283ef77484ed /libbe/storage/vcs/darcs.py | |
parent | ef0a5537747a2e5a0b2248018e981f80ae0b0f9f (diff) | |
download | bugseverywhere-ab090d8929f7019aa68876fd825766f472fd9138.tar.gz |
Make libbe.storage.vcs.darcs.Darcs._vcs_listdir() more robust.
The old version returned [] (for Darcs 2.5) on
darcs show files --no-files --patch 'Initial commit' .be
(called in `be diff` for `test_usage.sh darcs`), because darcs
returned the paths prefixed with './' (e.g. `./.be`, not `.be`). By
calculating relative paths and using the relative paths to determine
which files belong to the directory, we can handle both prefixed and
plain paths.
Diffstat (limited to 'libbe/storage/vcs/darcs.py')
-rw-r--r-- | libbe/storage/vcs/darcs.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libbe/storage/vcs/darcs.py b/libbe/storage/vcs/darcs.py index 7ff4554..29b25eb 100644 --- a/libbe/storage/vcs/darcs.py +++ b/libbe/storage/vcs/darcs.py @@ -229,8 +229,9 @@ class Darcs(base.VCS): descendents = [self._u_rel_path(f, path) for f in files if f != '.'] else: - descendents = [self._u_rel_path(f, path) for f in files - if f.startswith(path)] + rel_files = [self._u_rel_path(f, path) for f in files] + descendents = [f for f in rel_files + if f != '.' and not f.startswith('..')] return [f for f in descendents if f.count(os.path.sep) == 0] # Darcs versions <= 2.3.1 lack the --patch option for 'show files' raise NotImplementedError |