subrepo: handle local added subrepo case correctly
authorMatt Mackall <mpm@selenic.com>
Mon, 23 May 2011 22:49:10 -0500
changeset 14417 25137d99a5ed
parent 14416 253bda94372e
child 14418 0174d1f79280
subrepo: handle local added subrepo case correctly
mercurial/subrepo.py
--- a/mercurial/subrepo.py	Mon May 23 23:22:47 2011 +0300
+++ b/mercurial/subrepo.py	Mon May 23 22:49:10 2011 -0500
@@ -137,6 +137,10 @@
         elif ld == a: # remote removed, local unchanged
             debug(s, "remote removed, remove")
             wctx.sub(s).remove()
+        elif a == nullstate: # not present in remote or ancestor
+            debug(s, "local added, keep")
+            sm[s] = l
+            continue
         else:
             if repo.ui.promptchoice(
                 _(' local changed subrepository %s which remote removed\n'