changeset 30779:1d375f272c3d draft

subrepo: check that subrepo paths are not existing files This check has to happen early one, as the .hgsub file is being parsed. This should provide an early error message.
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Tue, 09 Sep 2014 12:16:30 -0400
parents b19c2679289c
children 73ac9c2778be
files mercurial/subrepo.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -140,6 +140,10 @@
 
     state = {}
     for path, src in p[''].items():
+
+        if os.path.isfile(path):
+            raise util.Abort(_('subrepository path is an existing file: %s')
+                             % path)
         kind = 'hg'
         if src.startswith('['):
             if ']' not in src: