Fixed Monotone driver rooting for interface versions >= 8.0.
authorW. Trevor King <wking@drexel.edu>
Sun, 27 Jun 2010 13:21:31 +0000 (09:21 -0400)
committerW. Trevor King <wking@drexel.edu>
Sun, 27 Jun 2010 13:24:47 +0000 (09:24 -0400)
I'm not sure where the dirname manipulation came from, but it
was screwing things up ;).

Also some argument order and indentation cleanups.

libbe/storage/vcs/monotone.py

index 350b4f19460dc4e4b2698267b7337e409805ac59..d95cb72a6fc338e910188179817d7f5842022d51 100644 (file)
@@ -131,13 +131,9 @@ class Monotone (base.VCS):
 
     def _vcs_root(self, path):
         """Find the root of the deepest repository containing path."""
-        if os.path.isdir(path):
-            dirname = os.path.dirname(path)
-        else:
-            dirname = path
         if self.version_cmp(8, 0) >= 0:
             status,output,error = self._invoke_client(
-                'automate', 'get_workspace_root', cwd=dirname)
+                'automate', 'get_workspace_root', cwd=path)
         else:
             mtn_dir = self._u_search_parent_directories(path, '_MTN')
             if mtn_dir == None:
@@ -168,12 +164,13 @@ class Monotone (base.VCS):
         self._passphrase = ''
         self._u_invoke_client('db', 'init', '--db', self._db_path, cwd=path)
         os.mkdir(self._key_dir)
-        self._u_invoke_client('automate',
-                              '--db', self._db_path,
-                              '--keydir', self._key_dir,
-                              'genkey', self._key, self._passphrase)
-        self._invoke_client('setup', '--db', self._db_path,
-                                '--branch', self._branch_name, cwd=path)
+        self._u_invoke_client(
+            '--db', self._db_path,
+            '--keydir', self._key_dir,
+            'automate', 'genkey', self._key, self._passphrase)
+        self._invoke_client(
+            'setup', '--db', self._db_path,
+            '--branch', self._branch_name, cwd=path)
 
     def _vcs_destroy(self):
         vcs_dir = os.path.join(self.repo, '_MTN')