Patchwork [3,of,5] rm: drop misleading 'use -f' hint for the rm --after 'not removing' warning

login
register
mail settings
Submitter Mads Kiilerich
Date Dec. 9, 2012, 10:52 p.m.
Message ID <afa6761200e0e85ffa45.1355093564@mk-desktop>
Download mbox | patch
Permalink /patch/36/
State Accepted
Commit 0c2f0048125de3f5299dd472e8121b981add898e
Headers show

Comments

Mads Kiilerich - Dec. 9, 2012, 10:52 p.m.
# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1355092396 -3600
# Node ID afa6761200e0e85ffa458f2c49094140d0be04a5
# Parent  8d1607787b2ba9d4bff99653d7c43c2ce2fb3e7f
rm: drop misleading 'use -f' hint for the rm --after 'not removing' warning

A warning mentioning 'forgetting' or 'recording delete' would be more correct
than 'not removing' but also more confusing.
Matt Harbison - Dec. 10, 2012, 3:11 a.m.
On Sun, 09 Dec 2012 23:52:44 +0100, Mads Kiilerich wrote:

> # HG changeset patch
> # User Mads Kiilerich <madski at unity3d.com>
> # Date 1355092396 -3600
> # Node ID afa6761200e0e85ffa458f2c49094140d0be04a5
> # Parent  8d1607787b2ba9d4bff99653d7c43c2ce2fb3e7f
> rm: drop misleading 'use -f' hint for the rm --after 'not removing' warning

...

> @@ -220,7 +220,7 @@
>  
>    $ rm test/bar
>    $ remove -A test
> -  not removing test/foo: file still exists (use -f to force removal) (glob)
> +  not removing test/foo: file still exists
>    removing test/bar (glob)
>    exit code: 1
>    R test/bar

This still needs a (glob) for Windows, doesn't it?

--Matt

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4880,8 +4880,7 @@ 
     elif after:
         list = deleted
         for f in modified + added + clean:
-            ui.warn(_('not removing %s: file still exists (use -f'
-                      ' to force removal)\n') % m.rel(f))
+            ui.warn(_('not removing %s: file still exists\n') % m.rel(f))
             ret = 1
     else:
         list = deleted + clean
diff --git a/tests/test-remove.t b/tests/test-remove.t
--- a/tests/test-remove.t
+++ b/tests/test-remove.t
@@ -107,7 +107,7 @@ 
   $ echo b > bar
   $ hg add bar
   $ remove -A bar
-  not removing bar: file still exists (use -f to force removal)
+  not removing bar: file still exists
   exit code: 1
   A bar
   ./bar
@@ -117,7 +117,7 @@ 
 21 state clean, options -A
 
   $ remove -A foo
-  not removing foo: file still exists (use -f to force removal)
+  not removing foo: file still exists
   exit code: 1
   ? bar
   ./bar
@@ -128,7 +128,7 @@ 
 
   $ echo b >> foo
   $ remove -A foo
-  not removing foo: file still exists (use -f to force removal)
+  not removing foo: file still exists
   exit code: 1
   M foo
   ? bar
@@ -220,7 +220,7 @@ 
 
   $ rm test/bar
   $ remove -A test
-  not removing test/foo: file still exists (use -f to force removal) (glob)
+  not removing test/foo: file still exists
   removing test/bar (glob)
   exit code: 1
   R test/bar