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

pavanpc (Pavan Kumar PC) phabricator at mercurial-scm.org
Mon Nov 13 05:35:00 EST 2017


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

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:



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


More information about the Mercurial-devel mailing list