subrepo: use hg.repository instead of creating localrepo directly
authorAbderrahim Kitouni <a.kitouni@gmail.com>
Sat, 04 Jul 2009 14:18:15 +0100
changeset 9092 9aebeea7ac00
parent 9091 79a886bcf461
child 9102 bbc78cb1bf15
subrepo: use hg.repository instead of creating localrepo directly this way, extensions' reposetup will be called, which allows for git subrepos to be handled by hg-git (and I believe the same goes for svn and hgsubversion)
mercurial/subrepo.py
--- a/mercurial/subrepo.py	Thu Jul 09 15:14:42 2009 -0700
+++ b/mercurial/subrepo.py	Sat Jul 04 14:18:15 2009 +0100
@@ -8,7 +8,7 @@
 import errno, os
 from i18n import _
 import config, util, node, error
-localrepo = hg = None
+hg = None
 
 nullstate = ('', '')
 
@@ -117,9 +117,8 @@
     # because it wants to make repo objects from deep inside the stack
     # so we manually delay the circular imports to not break
     # scripts that don't use our demand-loading
-    global localrepo, hg
-    import localrepo as l, hg as h
-    localrepo = l
+    global hg
+    import hg as h
     hg = h
 
     util.path_auditor(ctx._repo.root)(path)
@@ -135,10 +134,10 @@
         r = ctx._repo
         root = r.wjoin(path)
         if os.path.exists(os.path.join(root, '.hg')):
-            self._repo = localrepo.localrepository(r.ui, root)
+            self._repo = hg.repository(r.ui, root)
         else:
             util.makedirs(root)
-            self._repo = localrepo.localrepository(r.ui, root, create=True)
+            self._repo = hg.repository(r.ui, root, create=True)
         self._repo._subparent = r
         self._repo._subsource = state[0]