##// END OF EJS Templates
subrepo: introduce the nullsubrepo() method...
Matt Harbison -
r25416:c4a92867 default
parent child Browse files
Show More
@@ -340,6 +340,25 b' def subrepo(ctx, path):'
340 raise util.Abort(_('unknown subrepo type %s') % state[2])
340 raise util.Abort(_('unknown subrepo type %s') % state[2])
341 return types[state[2]](ctx, path, state[:2])
341 return types[state[2]](ctx, path, state[:2])
342
342
343 def nullsubrepo(ctx, path, pctx):
344 """return an empty subrepo in pctx for the extant subrepo in ctx"""
345 # subrepo inherently violates our import layering rules
346 # because it wants to make repo objects from deep inside the stack
347 # so we manually delay the circular imports to not break
348 # scripts that don't use our demand-loading
349 global hg
350 import hg as h
351 hg = h
352
353 pathutil.pathauditor(ctx.repo().root)(path)
354 state = ctx.substate[path]
355 if state[2] not in types:
356 raise util.Abort(_('unknown subrepo type %s') % state[2])
357 subrev = ''
358 if state[2] == 'hg':
359 subrev = "0" * 40
360 return types[state[2]](pctx, path, (state[0], subrev))
361
343 def newcommitphase(ui, ctx):
362 def newcommitphase(ui, ctx):
344 commitphase = phases.newcommitphase(ui)
363 commitphase = phases.newcommitphase(ui)
345 substate = getattr(ctx, "substate", None)
364 substate = getattr(ctx, "substate", None)
General Comments 0
You need to be logged in to leave comments. Login now