Patchwork D1336: remove: print message for each file in verbose mode only while using `-A`

login
register
mail settings
Submitter phabricator
Date Nov. 13, 2017, 10:35 a.m.
Message ID <1db6addae3b59773d307965e492edb47@localhost.localdomain>
Download mbox | patch
Permalink /patch/25501/
State Not Applicable
Headers show

Comments

phabricator - Nov. 13, 2017, 10:35 a.m.
pavanpc updated this revision to Diff 3435.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1336?vs=3424&id=3435

REVISION DETAIL
  https://phab.mercurial-scm.org/D1336

AFFECTED FILES
  mercurial/cmdutil.py
  tests/test-remove.t

CHANGE DETAILS




To: pavanpc, #hg-reviewers
Cc: lothiraldan, mitrandir, mharbison72, mercurial-devel

Patch

diff --git a/tests/test-remove.t b/tests/test-remove.t
--- a/tests/test-remove.t
+++ b/tests/test-remove.t
@@ -179,7 +179,6 @@ 
   \r (no-eol) (esc)
   skipping [===========================================>] 1/1\r (no-eol) (esc)
                                                               \r (no-eol) (esc)
-  not removing bar: file still exists
   exit code: 1
   A bar
   ./bar
@@ -189,9 +188,9 @@ 
                                                               \r (no-eol) (esc)
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
-21 state clean, options -A
+21 state clean, options -Av
 
-  $ remove -A foo
+  $ remove -Av foo
   \r (no-eol) (esc)
   deleting [===========================================>] 1/1\r (no-eol) (esc)
                                                               \r (no-eol) (esc)
@@ -205,10 +204,10 @@ 
   ./foo
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
-22 state modified, options -A
+22 state modified, options -Av
 
   $ echo b >> foo
-  $ remove -A foo
+  $ remove -Av foo
   \r (no-eol) (esc)
   deleting [===========================================>] 1/1\r (no-eol) (esc)
                                                               \r (no-eol) (esc)
@@ -357,10 +356,10 @@ 
                                                               \r (no-eol) (esc)
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
-dir, options -A
+dir, options -Av
 
   $ rm test/bar
-  $ remove -A test
+  $ remove -Av test
   \r (no-eol) (esc)
   deleting [===========================================>] 1/1\r (no-eol) (esc)
                                                               \r (no-eol) (esc)
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2975,8 +2975,9 @@ 
         for f in remaining:
             count += 1
             ui.progress(_('skipping'), count, total=total, unit=_('files'))
-            warnings.append(_('not removing %s: file still exists\n')
-                    % m.rel(f))
+            if ui.verbose:
+                warnings.append(_('not removing %s: file still exists\n')
+                        % m.rel(f))
             ret = 1
         ui.progress(_('skipping'), None)
     else: