182 return posixpath.normpath(os.path.join(parent, repo._subsource)) |
182 return posixpath.normpath(os.path.join(parent, repo._subsource)) |
183 if push and repo.ui.config('paths', 'default-push'): |
183 if push and repo.ui.config('paths', 'default-push'): |
184 return repo.ui.config('paths', 'default-push', repo.root) |
184 return repo.ui.config('paths', 'default-push', repo.root) |
185 return repo.ui.config('paths', 'default', repo.root) |
185 return repo.ui.config('paths', 'default', repo.root) |
186 |
186 |
|
187 def itersubrepos(ctx1, ctx2): |
|
188 """find subrepos in ctx1 or ctx2""" |
|
189 # Create a (subpath, ctx) mapping where we prefer subpaths from |
|
190 # ctx1. The subpaths from ctx2 are important when the .hgsub file |
|
191 # has been modified (in ctx2) but not yet committed (in ctx1). |
|
192 subpaths = dict.fromkeys(ctx2.substate, ctx2) |
|
193 subpaths.update(dict.fromkeys(ctx1.substate, ctx1)) |
|
194 for subpath, ctx in sorted(subpaths.iteritems()): |
|
195 yield subpath, ctx.sub(subpath) |
|
196 |
187 def subrepo(ctx, path): |
197 def subrepo(ctx, path): |
188 """return instance of the right subrepo class for subrepo in path""" |
198 """return instance of the right subrepo class for subrepo in path""" |
189 # subrepo inherently violates our import layering rules |
199 # subrepo inherently violates our import layering rules |
190 # because it wants to make repo objects from deep inside the stack |
200 # because it wants to make repo objects from deep inside the stack |
191 # so we manually delay the circular imports to not break |
201 # so we manually delay the circular imports to not break |