Patchwork [3,of,4] remove: add a label for messages about removed files

login
register
mail settings
Submitter Boris Feld
Date Aug. 14, 2018, 3:13 p.m.
Message ID <1839790fc6c3dd1960b2.1534259589@FB-lair>
Download mbox | patch
Permalink /patch/33716/
State Accepted
Headers show

Comments

Boris Feld - Aug. 14, 2018, 3:13 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1534239588 -7200
#      Tue Aug 14 11:39:48 2018 +0200
# Node ID 1839790fc6c3dd1960b2eea5570dc5a99830e47f
# Parent  f1ff4db1948456b14a5b8ac2ee7ccda467a7eea9
# EXP-Topic addremovelabel
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 1839790fc6c3
remove: add a label for messages about removed files

Keeping consistency between addremove and remove seems a good idea.

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2134,7 +2134,8 @@  def forget(ui, repo, match, prefix, expl
 
     for f in forget:
         if ui.verbose or not match.exact(f) or interactive:
-            ui.status(_('removing %s\n') % match.rel(f))
+            ui.status(_('removing %s\n') % match.rel(f),
+                      label='addremove.removed')
 
     if not dryrun:
         rejected = wctx.forget(forget, prefix)
@@ -2267,7 +2268,8 @@  def remove(ui, repo, m, prefix, after, f
     for f in list:
         if ui.verbose or not m.exact(f):
             progress.increment()
-            ui.status(_('removing %s\n') % m.rel(f))
+            ui.status(_('removing %s\n') % m.rel(f),
+                      label='addremove.removed')
     progress.complete()
 
     if not dryrun:
diff --git a/tests/test-remove.t b/tests/test-remove.t
--- a/tests/test-remove.t
+++ b/tests/test-remove.t
@@ -520,6 +520,14 @@  test dry-run for remove
   deleting [===========================================>] 1/1\r (no-eol) (esc)
                                                               \r (no-eol) (esc)
   removing a
+  $ hg remove a -nv --color debug
+  \r (no-eol) (esc)
+  deleting [===========================================>] 1/1\r (no-eol) (esc)
+                                                              \r (no-eol) (esc)
+  \r (no-eol) (esc)
+  deleting [===========================================>] 1/1\r (no-eol) (esc)
+                                                              \r (no-eol) (esc)
+  [addremove.removed ui.status|removing a]
   $ hg diff
 
   $ cat >> .hg/hgrc <<EOF