Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.py @ 24548:c780a63f61ca stable
forget: cleanup the output for an inexact case match on icasefs
Previously, specifying a file name but not matching the dirstate case yielded
the following, even though the file was actually removed:
$ hg forget capsdir1/capsdir/abc.txt
not removing capsdir\a.txt: file is already untracked
removing CapsDir\A.txt
[1]
This change doesn't appear to cause any extra filesystem accesses, even if a
nonexistant file is specified.
If a directory is specified without a case match, it is (and was previously)
still silently ignored.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 31 Mar 2015 17:42:46 -0400 |
parents | ac41aa4a66ab |
children | 6e73c66a6919 |
comparison
equal
deleted
inserted
replaced
24537:2bb13f2b778c | 24548:c780a63f61ca |
---|---|
2042 if not explicitonly: | 2042 if not explicitonly: |
2043 for f in match.files(): | 2043 for f in match.files(): |
2044 if f not in repo.dirstate and not repo.wvfs.isdir(f): | 2044 if f not in repo.dirstate and not repo.wvfs.isdir(f): |
2045 if f not in forgot: | 2045 if f not in forgot: |
2046 if repo.wvfs.exists(f): | 2046 if repo.wvfs.exists(f): |
2047 # Don't complain if the exact case match wasn't given. | |
2048 # But don't do this until after checking 'forgot', so | |
2049 # that subrepo files aren't normalized, and this op is | |
2050 # purely from data cached by the status walk above. | |
2051 if repo.dirstate.normalize(f) in repo.dirstate: | |
2052 continue | |
2047 ui.warn(_('not removing %s: ' | 2053 ui.warn(_('not removing %s: ' |
2048 'file is already untracked\n') | 2054 'file is already untracked\n') |
2049 % match.rel(f)) | 2055 % match.rel(f)) |
2050 bad.append(f) | 2056 bad.append(f) |
2051 | 2057 |