changeset 9092:9aebeea7ac00

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)
author Abderrahim Kitouni <a.kitouni@gmail.com>
date Sat, 04 Jul 2009 14:18:15 +0100
parents 79a886bcf461
children bbc78cb1bf15
files mercurial/subrepo.py
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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]