##// END OF EJS Templates
subrepo: use hg.repository instead of creating localrepo directly...
Abderrahim Kitouni -
r9092:9aebeea7 default
parent child Browse files
Show More
@@ -8,7 +8,7 b''
8 import errno, os
8 import errno, os
9 from i18n import _
9 from i18n import _
10 import config, util, node, error
10 import config, util, node, error
11 localrepo = hg = None
11 hg = None
12
12
13 nullstate = ('', '')
13 nullstate = ('', '')
14
14
@@ -117,9 +117,8 b' def subrepo(ctx, path):'
117 # because it wants to make repo objects from deep inside the stack
117 # because it wants to make repo objects from deep inside the stack
118 # so we manually delay the circular imports to not break
118 # so we manually delay the circular imports to not break
119 # scripts that don't use our demand-loading
119 # scripts that don't use our demand-loading
120 global localrepo, hg
120 global hg
121 import localrepo as l, hg as h
121 import hg as h
122 localrepo = l
123 hg = h
122 hg = h
124
123
125 util.path_auditor(ctx._repo.root)(path)
124 util.path_auditor(ctx._repo.root)(path)
@@ -135,10 +134,10 b' class hgsubrepo(object):'
135 r = ctx._repo
134 r = ctx._repo
136 root = r.wjoin(path)
135 root = r.wjoin(path)
137 if os.path.exists(os.path.join(root, '.hg')):
136 if os.path.exists(os.path.join(root, '.hg')):
138 self._repo = localrepo.localrepository(r.ui, root)
137 self._repo = hg.repository(r.ui, root)
139 else:
138 else:
140 util.makedirs(root)
139 util.makedirs(root)
141 self._repo = localrepo.localrepository(r.ui, root, create=True)
140 self._repo = hg.repository(r.ui, root, create=True)
142 self._repo._subparent = r
141 self._repo._subparent = r
143 self._repo._subsource = state[0]
142 self._repo._subsource = state[0]
144
143
General Comments 0
You need to be logged in to leave comments. Login now