comparison 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
comparison
equal deleted inserted replaced
29621:d3df009ab117 29622:9c2cc107547f
2479 total = len(files) 2479 total = len(files)
2480 count = 0 2480 count = 0
2481 for f in files: 2481 for f in files:
2482 def insubrepo(): 2482 def insubrepo():
2483 for subpath in wctx.substate: 2483 for subpath in wctx.substate:
2484 if f.startswith(subpath): 2484 if f.startswith(subpath + '/'):
2485 return True 2485 return True
2486 return False 2486 return False
2487 2487
2488 count += 1 2488 count += 1
2489 ui.progress(_('deleting'), count, total=total, unit=_('files')) 2489 ui.progress(_('deleting'), count, total=total, unit=_('files'))
2490 isdir = f in deleteddirs or wctx.hasdir(f) 2490 isdir = f in deleteddirs or wctx.hasdir(f)
2491 if f in repo.dirstate or isdir or f == '.' or insubrepo(): 2491 if (f in repo.dirstate or isdir or f == '.'
2492 or insubrepo() or f in subs):
2492 continue 2493 continue
2493 2494
2494 if repo.wvfs.exists(f): 2495 if repo.wvfs.exists(f):
2495 if repo.wvfs.isdir(f): 2496 if repo.wvfs.isdir(f):
2496 warnings.append(_('not removing %s: no tracked files\n') 2497 warnings.append(_('not removing %s: no tracked files\n')