diff mercurial/cmdutil.py @ 29622:9c2cc107547f stable

cmdutil: warnings not issued in remove if subrepopath overlaps Previously a subrepository "sub" would cause no warnings to be issued for a file "subnot/a" if it is not removed when calling: hg remove -S "subnot/a"
author Hannes Oldenburg <hannes.christian.oldenburg@gmail.com>
date Fri, 22 Jul 2016 11:29:42 +0000
parents 1b38cfde9530
children bc5148d0a446
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Wed Jul 20 14:12:45 2016 -0500
+++ b/mercurial/cmdutil.py	Fri Jul 22 11:29:42 2016 +0000
@@ -2481,14 +2481,15 @@
     for f in files:
         def insubrepo():
             for subpath in wctx.substate:
-                if f.startswith(subpath):
+                if f.startswith(subpath + '/'):
                     return True
             return False
 
         count += 1
         ui.progress(_('deleting'), count, total=total, unit=_('files'))
         isdir = f in deleteddirs or wctx.hasdir(f)
-        if f in repo.dirstate or isdir or f == '.' or insubrepo():
+        if (f in repo.dirstate or isdir or f == '.'
+            or insubrepo() or f in subs):
             continue
 
         if repo.wvfs.exists(f):