mercurial/subrepo.py
branchstable
changeset 16596 95ca6c8b38da
parent 16595 2de6ac4ac17c
child 16683 525fdb738975
child 17024 33b057778cd2
--- a/mercurial/subrepo.py	Fri May 04 14:19:52 2012 +0200
+++ b/mercurial/subrepo.py	Fri May 04 14:19:55 2012 +0200
@@ -43,11 +43,16 @@
     rev = {}
     if '.hgsubstate' in ctx:
         try:
-            for l in ctx['.hgsubstate'].data().splitlines():
+            for i, l in enumerate(ctx['.hgsubstate'].data().splitlines()):
                 l = l.lstrip()
                 if not l:
                     continue
-                revision, path = l.split(" ", 1)
+                try:
+                    revision, path = l.split(" ", 1)
+                except ValueError:
+                    raise util.Abort(_("invalid subrepository revision "
+                                       "specifier in .hgsubstate line %d")
+                                     % (i + 1))
                 rev[path] = revision
         except IOError, err:
             if err.errno != errno.ENOENT: