|
|
@@ -49,7 +49,24 @@ my $in = { -changelog => 0 };
|
|
|
while (<STDIN>) {
|
|
|
if ($ontty) {
|
|
|
# dispatch according to mtn(1) command
|
|
|
- if ($cmd eq "status") {
|
|
|
+ if ($cmd eq "update") {
|
|
|
+ # colorize branch/revision information
|
|
|
+ s/(expanded\s+selector\s+')([^']*)('\s+->\s+')([^']*)/$1$color->{-positive}$2$color->{-none}$3$color->{-positive}$4$color->{-none}/o;
|
|
|
+
|
|
|
+ s/((?:updating\s+along\s+branch|expanding\s+selection)\s+')([^']*)(')/$1$color->{-positive}$2$color->{-none}$3/o;
|
|
|
+ s/(expanded\s+to\s+')([^']*)(')/$1$color->{-standout}$2$color->{-none}$3/o;
|
|
|
+ s/((?:already\s+up\s+to\s+date\s+at|selected\s+update\s+target|updated\s+to\s+base\s+revision)\s+)(\S+)/$1$color->{-standout}$2$color->{-none}/o;
|
|
|
+ s/((?:switching\s+to\s+branch|next\s+commit\s+will\s+use\s+branch)\s+)(\S+)/$1$color->{-positive}$2$color->{-none}$3/o;
|
|
|
+
|
|
|
+ # colorize status list
|
|
|
+ s/(\s+dropping\s+)(\S+)/$1$color->{-negative}$2$color->{-none}/o;
|
|
|
+ s/(\s+modifying\s+)(\S+)/$1$color->{-positive}$2$color->{-none}/o;
|
|
|
+ s/(\s+adding\s+)(\S+)/$1$color->{-standout}$color->{-positive}$2$color->{-none}/o;
|
|
|
+
|
|
|
+ # colorize errors
|
|
|
+ s/(misuse:)(.+)$/$1$color->{-negative}$2$color->{-none}/o;
|
|
|
+ }
|
|
|
+ elsif ($cmd eq "status") {
|
|
|
# colorize headers
|
|
|
s/^(Current branch:\s+)(\S+)/$1$color->{-standout}$2$color->{-none}/o;
|
|
|
s/^(Changes against parent\s+)(\S+)/$1$color->{-standout}$2$color->{-none}/o;
|