[PATCH 4 of 4] addremove: add associated color for the new labels
Boris Feld
boris.feld at octobus.net
Tue Aug 14 11:13:10 EDT 2018
# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1532531519 -7200
# Wed Jul 25 17:11:59 2018 +0200
# Node ID 00aa59103dca14f7c66b72b39e55ed68e619125b
# Parent 1839790fc6c3dd1960b2eea5570dc5a99830e47f
# EXP-Topic addremovelabel
# Available At https://bitbucket.org/octobus/mercurial-devel/
# hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 00aa59103dca
addremove: add associated color for the new labels
We use classic color: green is added, red is removed.
diff --git a/mercurial/color.py b/mercurial/color.py
--- a/mercurial/color.py
+++ b/mercurial/color.py
@@ -83,6 +83,8 @@ except ImportError:
'grep.filename': 'magenta',
'grep.user': 'magenta',
'grep.date': 'magenta',
+ 'addremove.added': 'green',
+ 'addremove.removed': 'red',
'bookmarks.active': 'green',
'branches.active': 'none',
'branches.closed': 'black bold',
diff --git a/tests/test-diff-color.t b/tests/test-diff-color.t
--- a/tests/test-diff-color.t
+++ b/tests/test-diff-color.t
@@ -22,7 +22,7 @@ Setup
> c
> EOF
$ hg ci -Am adda
- adding a
+ \x1b[0;32madding a\x1b[0m (esc)
$ cat > a <<EOF
> c
> c
@@ -218,7 +218,7 @@ issue3712: test colorization of subrepo
$ hg init sub
$ echo b > sub/b
$ hg -R sub commit -Am 'create sub'
- adding b
+ \x1b[0;32madding b\x1b[0m (esc)
$ echo 'sub = sub' > .hgsub
$ hg add .hgsub
$ hg commit -m 'add subrepo sub'
diff --git a/tests/test-status-color.t b/tests/test-status-color.t
--- a/tests/test-status-color.t
+++ b/tests/test-status-color.t
@@ -168,10 +168,10 @@ Make sure ui.formatted=False works
$ touch modified removed deleted ignored
$ echo "^ignored$" > .hgignore
$ hg ci -A -m 'initial checkin'
- adding .hgignore
- adding deleted
- adding modified
- adding removed
+ \x1b[0;32madding .hgignore\x1b[0m (esc)
+ \x1b[0;32madding deleted\x1b[0m (esc)
+ \x1b[0;32madding modified\x1b[0m (esc)
+ \x1b[0;32madding removed\x1b[0m (esc)
$ hg log --color=debug
[log.changeset changeset.draft|changeset: 0:389aef86a55e]
[log.tag|tag: tip]
@@ -296,10 +296,10 @@ check 'status -q' and some combinations
$ touch modified removed deleted ignored
$ echo "^ignored$" > .hgignore
$ hg commit -A -m 'initial checkin'
- adding .hgignore
- adding deleted
- adding modified
- adding removed
+ \x1b[0;32madding .hgignore\x1b[0m (esc)
+ \x1b[0;32madding deleted\x1b[0m (esc)
+ \x1b[0;32madding modified\x1b[0m (esc)
+ \x1b[0;32madding removed\x1b[0m (esc)
$ touch added unknown ignored
$ hg add added
$ echo "test" >> modified
More information about the Mercurial-devel
mailing list