Mercurial > public > mercurial-scm > hg
diff mercurial/commands.py @ 17848:66f0c78350ab stable
remove: don't return error on directories with tracked files
Spotted by Sergey <sergemp@mail.ru>
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 22 Oct 2012 16:06:47 -0500 |
parents | b623e323c561 |
children | 6da47b655d97 |
line wrap: on
line diff
--- a/mercurial/commands.py Sat Oct 20 21:43:46 2012 -0400 +++ b/mercurial/commands.py Mon Oct 22 16:06:47 2012 -0500 @@ -4842,11 +4842,18 @@ s = repo.status(match=m, clean=True) modified, added, deleted, clean = s[0], s[1], s[3], s[6] + # warn about failure to delete explicit files/dirs + wctx = repo[None] for f in m.files(): - if f not in repo.dirstate and not os.path.isdir(m.rel(f)): - if os.path.exists(m.rel(f)): + if f in repo.dirstate or f in wctx.dirs(): + continue + if os.path.exists(m.rel(f)): + if os.path.isdir(m.rel(f)): + ui.warn(_('not removing %s: no tracked files\n') % m.rel(f)) + else: ui.warn(_('not removing %s: file is untracked\n') % m.rel(f)) - ret = 1 + # missing files will generate a warning elsewhere + ret = 1 if force: list = modified + deleted + clean + added