changeset 16756:2e3513e7348a

subrepo: make subrepo.subrepo(<not a subrepo path>) fail Until now, when calling subrepo.subrepo with a path at which there is no subrepo, a "nullstate" tuple would be returned. However, this is not very useful (the tuple can't really be used for creating a subrepo), so we'd just as soon have the function just fail, and leave it up to the caller to decide what to do. The motivation for doing this now is to simplify the solution for (issue3056).
author Dov Feldstern <dfeldstern@gmail.com>
date Sun, 20 May 2012 21:11:34 +0300
parents d0b9ebba41e9
children 923bd97b86a0
files mercurial/subrepo.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/subrepo.py	Sun May 20 14:40:36 2012 -0500
+++ b/mercurial/subrepo.py	Sun May 20 21:11:34 2012 +0300
@@ -268,7 +268,7 @@
     hg = h
 
     scmutil.pathauditor(ctx._repo.root)(path)
-    state = ctx.substate.get(path, nullstate)
+    state = ctx.substate[path]
     if state[2] not in types:
         raise util.Abort(_('unknown subrepo type %s') % state[2])
     return types[state[2]](ctx, path, state[:2])