mercurial/subrepo.py
changeset 13018 96956105e92d
parent 13016 9efc316a6716
parent 13017 d0e21c5fde41
child 13027 7f2ecb64140d
--- a/mercurial/subrepo.py	Wed Nov 17 21:30:13 2010 +0100
+++ b/mercurial/subrepo.py	Thu Nov 18 23:15:13 2010 +0100
@@ -21,7 +21,15 @@
     p = config.config()
     def read(f, sections=None, remap=None):
         if f in ctx:
-            p.parse(f, ctx[f].data(), sections, remap, read)
+            try:
+                data = ctx[f].data()
+            except IOError, err:
+                if err.errno != errno.ENOENT:
+                    raise
+                # handle missing subrepo spec files as removed
+                ui.warn(_("warning: subrepo spec file %s not found\n") % f)
+                return
+            p.parse(f, data, sections, remap, read)
         else:
             raise util.Abort(_("subrepo spec file %s not found") % f)