Mercurial > hg
changeset 1867:91ebf29c1595
add -f/--force to remove command.
else to remove modified file, must use "hg revert; hg rm"
or "rm; hg rm --after".
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Wed, 08 Mar 2006 15:14:24 -0800 |
parents | 1ed809a2104e |
children | 6a3d5a56f19c |
files | mercurial/commands.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Wed Mar 08 11:21:45 2006 -0800 +++ b/mercurial/commands.py Wed Mar 08 15:14:24 2006 -0800 @@ -1920,7 +1920,7 @@ def okaytoremove(abs, rel, exact): modified, added, removed, deleted, unknown = repo.changes(files=[abs]) reason = None - if modified: + if modified and not opts['force']: reason = _('is modified') elif added: reason = _('has been marked for add') @@ -2564,7 +2564,8 @@ "^remove|rm": (remove, [('I', 'include', [], _('include names matching the given patterns')), - ('X', 'exclude', [], _('exclude names matching the given patterns'))], + ('X', 'exclude', [], _('exclude names matching the given patterns')), + ('f', 'force', None, _('remove file even if modified'))], _('hg remove [OPTION]... FILE...')), "rename|mv": (rename,