# HG changeset patch # User Bryan O'Sullivan # Date 1126720203 25200 # Node ID 7a70dafbf4b9fa230d8a1387665f2008f4fb0463 # Parent 3b4f05ff31304bdf3abfef8d72ca50122d4cd765 Make remove command really unlink files. diff --git a/doc/hg.1.txt b/doc/hg.1.txt --- a/doc/hg.1.txt +++ b/doc/hg.1.txt @@ -432,7 +432,8 @@ remove [options] [files ...]:: This command schedules the files to be removed at the next commit. This only removes files from the current branch, not from the - entire project history. + entire project history. If the files still exist in the working + directory, they will be deleted from it. aliases: rm diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -1313,6 +1313,11 @@ def remove(ui, repo, pat, *pats, **opts) if okaytoremove(abs, rel, exact): if not exact: ui.status('removing %s\n' % rel) names.append(abs) + for name in names: + try: + os.unlink(name) + except OSError, inst: + if inst.errno != errno.ENOENT: raise repo.remove(names) def revert(ui, repo, *names, **opts):