Patchwork [2,of,4] add: add a label for messages about added files

login
register
mail settings
Submitter Boris Feld
Date Aug. 14, 2018, 3:13 p.m.
Message ID <f1ff4db1948456b14a5b.1534259588@FB-lair>
Download mbox | patch
Permalink /patch/33719/
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 1534238105 -7200
#      Tue Aug 14 11:15:05 2018 +0200
# Node ID f1ff4db1948456b14a5b8ac2ee7ccda467a7eea9
# Parent  4c46bfaba3767b33a7c29c9ceb3dde57ba5d9653
# EXP-Topic addremovelabel
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r f1ff4db19484
add: add a label for messages about added files

Keeping consistency between addremove and add seems a good idea.

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2035,7 +2035,8 @@  def add(ui, repo, match, prefix, explici
                 cca(f)
             names.append(f)
             if ui.verbose or not exact:
-                ui.status(_('adding %s\n') % match.rel(f))
+                ui.status(_('adding %s\n') % match.rel(f),
+                          label='addremove.added')
 
     for subpath in sorted(wctx.substate):
         sub = wctx.sub(subpath)
diff --git a/tests/test-add.t b/tests/test-add.t
--- a/tests/test-add.t
+++ b/tests/test-add.t
@@ -12,6 +12,9 @@ 
   $ hg forget a
   $ hg add
   adding a
+  $ hg forget a
+  $ hg add --color debug
+  [addremove.added ui.status|adding a]
   $ hg st
   A a
   $ mkdir dir