Ah, restored altered dirname code to Monotone's root method.
authorW. Trevor King <wking@drexel.edu>
Sun, 27 Jun 2010 14:47:11 +0000 (10:47 -0400)
committerW. Trevor King <wking@drexel.edu>
Sun, 27 Jun 2010 14:47:11 +0000 (10:47 -0400)
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 ;).

libbe/storage/vcs/monotone.py

index d95cb72a6fc338e910188179817d7f5842022d51..1e15aa4a1f8a2ff39e301dd85c075a50f6c4a4aa 100644 (file)
@@ -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: