D1336: Summary: hg rm -A option prints the message of every file in the repo. This is not very user friendly for a big repository with thousands of files. So enabling this feature only when run in --verbose mode (hg rm -Av)

pavanpc (Pavan Kumar PC) phabricator at mercurial-scm.org
Wed Nov 8 07:11:37 EST 2017


pavanpc created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

TEST PLAN
  check if the message is printed in verbose mode.
  
    cd  hg-crew/tests
    rt test-remove.t

REPOSITORY
  rHG Mercurial

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
@@ -168,11 +168,11 @@
                                                               \r (no-eol) (esc)
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
-20 state added, options -A
+20 state added, options -Av
 
   $ echo b > bar
   $ hg add bar
-  $ remove -A bar
+  $ remove -Av bar
   \r (no-eol) (esc)
   deleting [===========================================>] 1/1\r (no-eol) (esc)
                                                               \r (no-eol) (esc)
@@ -189,9 +189,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 +205,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 +357,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
@@ -2967,18 +2967,19 @@
 
     if force:
         list = modified + deleted + clean + added
-    elif after:
+    elif after or ui.verbose:
         list = deleted
-        remaining = modified + added + clean
-        total = len(remaining)
-        count = 0
-        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))
-            ret = 1
-        ui.progress(_('skipping'), None)
+        if ui.verbose:
+            remaining = modified + added + clean
+            total = len(remaining)
+            count = 0
+            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))
+                ret = 1
+            ui.progress(_('skipping'), None)
     else:
         list = deleted + clean
         total = len(modified) + len(added)



To: pavanpc, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list