managed: fix repo detection by giving a real path
2 files changed, 7 insertions(+), 7 deletions(-)

M hgext3rd/confman/configuration.py
M hgext3rd/confman/managed.py
M hgext3rd/confman/configuration.py +4 -3
@@ 89,7 89,7 @@ class configurationmanager(object):
         if not os.path.exists(path):
             return None
         try:
-            return repoclassbyconf(self.confs[section])(self, path)
+            return repoclassbyconf(self.confs[section], path)(self, path)
         except error.RepoError:
             return None
 

          
@@ 175,8 175,9 @@ class configurationmanager(object):
             source = conf['pulluri'].format(**conf)
             ui.status('cloning %s from %s to %s\n' % (section, source, dest))
             try:
-                repoclassbyconf(conf).clone(self, source, dest,
-                                            self.confs[section])
+                path = self.pathfromsection(section)
+                repoclassbyconf(conf, path).clone(self, source, dest,
+                                                  self.confs[section])
             except Exception, err:
                 # the clone operation did fail
                 self.failed.add(section)

          
M hgext3rd/confman/managed.py +3 -4
@@ 147,18 147,17 @@ class gitrevisioncontext(rcbase):
         return out.splitlines()
 
 
-def repoclassbyconf(conf):
+def repoclassbyconf(conf, path):
     '''introspect the configuration parameters values and the filesystem
     and deduct the right repository manager class.
     '''
     uri = urlparse.urlparse(conf['pulluri'])
-    layout = conf['layout']
     pulluri = conf['pulluri']
-    if (osp.isdir(osp.join(layout, '.hg'))
+    if (osp.isdir(osp.join(path, '.hg'))
         or osp.isdir(osp.join(pulluri, '.hg'))):
         return hgrepo
     if (uri.scheme == 'git' or uri.path.endswith('.git')
-        or osp.isdir(osp.join(layout, '.git'))
+        or osp.isdir(osp.join(path, '.git'))
         or osp.isdir(osp.join(pulluri, '.git'))):
         return gitrepo
     if uri.path.endswith('.tar.gz') or uri.path.endswith('.tar.bz2'):