Show More
@@ -4842,11 +4842,18 b' def remove(ui, repo, *pats, **opts):' | |||||
4842 | s = repo.status(match=m, clean=True) |
|
4842 | s = repo.status(match=m, clean=True) | |
4843 | modified, added, deleted, clean = s[0], s[1], s[3], s[6] |
|
4843 | modified, added, deleted, clean = s[0], s[1], s[3], s[6] | |
4844 |
|
4844 | |||
|
4845 | # warn about failure to delete explicit files/dirs | |||
|
4846 | wctx = repo[None] | |||
4845 | for f in m.files(): |
|
4847 | for f in m.files(): | |
4846 |
if f |
|
4848 | if f in repo.dirstate or f in wctx.dirs(): | |
4847 | if os.path.exists(m.rel(f)): |
|
4849 | continue | |
|
4850 | if os.path.exists(m.rel(f)): | |||
|
4851 | if os.path.isdir(m.rel(f)): | |||
|
4852 | ui.warn(_('not removing %s: no tracked files\n') % m.rel(f)) | |||
|
4853 | else: | |||
4848 | ui.warn(_('not removing %s: file is untracked\n') % m.rel(f)) |
|
4854 | ui.warn(_('not removing %s: file is untracked\n') % m.rel(f)) | |
4849 | ret = 1 |
|
4855 | # missing files will generate a warning elsewhere | |
|
4856 | ret = 1 | |||
4850 |
|
4857 | |||
4851 | if force: |
|
4858 | if force: | |
4852 | list = modified + deleted + clean + added |
|
4859 | list = modified + deleted + clean + added |
@@ -265,4 +265,17 b' test that commit does not crash if the u' | |||||
265 | nothing changed |
|
265 | nothing changed | |
266 | [1] |
|
266 | [1] | |
267 |
|
267 | |||
268 | $ cd .. |
|
268 | handling of untracked directories and missing files | |
|
269 | ||||
|
270 | $ mkdir d1 | |||
|
271 | $ echo a > d1/a | |||
|
272 | $ hg rm --after d1 | |||
|
273 | not removing d1: no tracked files | |||
|
274 | [1] | |||
|
275 | $ hg add d1/a | |||
|
276 | $ rm d1/a | |||
|
277 | $ hg rm --after d1 | |||
|
278 | removing d1/a | |||
|
279 | $ hg rm --after nosuch | |||
|
280 | nosuch: No such file or directory | |||
|
281 | [1] |
General Comments 0
You need to be logged in to leave comments.
Login now