diff options
author | W. Trevor King <wking@drexel.edu> | 2010-06-27 10:47:11 -0400 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2010-06-27 10:47:11 -0400 |
commit | d661ec949cd97def3e33af1db98bd33ceb0e1acc (patch) | |
tree | 081ffdc7e54c0e41d23a4e1d900e56ff5e884a6d /libbe | |
parent | 4ffb44509a92d8c7ea3d262923d598e86e501da0 (diff) | |
download | bugseverywhere-d661ec949cd97def3e33af1db98bd33ceb0e1acc.tar.gz |
Ah, restored altered dirname code to Monotone's root method.
The previous implementation used
cwd=path
which would fail for non-directory paths.
The implementation before that was missing the not from
if not os.path.isdir(path):
dirname = os.path.dirname(path)
which meant it found the dirname when it didn't need to, and not when
it did ;).
Diffstat (limited to 'libbe')
-rw-r--r-- | libbe/storage/vcs/monotone.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libbe/storage/vcs/monotone.py b/libbe/storage/vcs/monotone.py index d95cb72..1e15aa4 100644 --- a/libbe/storage/vcs/monotone.py +++ b/libbe/storage/vcs/monotone.py @@ -132,8 +132,12 @@ class Monotone (base.VCS): def _vcs_root(self, path): """Find the root of the deepest repository containing path.""" if self.version_cmp(8, 0) >= 0: + if not os.path.isdir(path): + dirname = os.path.dirname(path) + else: + dirname = path status,output,error = self._invoke_client( - 'automate', 'get_workspace_root', cwd=path) + 'automate', 'get_workspace_root', cwd=dirname) else: mtn_dir = self._u_search_parent_directories(path, '_MTN') if mtn_dir == None: |