[PATCH] Enable color support for the branches command

Nicolas Dumazet nicdumz at gmail.com
Thu Jul 29 03:52:10 CDT 2010


Hello!

On Thu, 29 Jul 2010 00:38:13 -0600
Jeremy Whitlock <jcscoobyrs at gmail.com> wrote:

> # HG changeset patch
> # User Jeremy Whitlock <jcscoobyrs at gmail.com>
> # Date 1280379903 21600
> # Node ID ff03b97e4525883cb4d6da3e4052b6834f39eba1
> # Parent  efcdf6a953a09efbf06129556a1d07c3ee04e0e0

Interestingly, Gmail shows a cset that is completely borked,
apparently having troubles with line endings, while Sylpheed is just happy
with the patch

> Enable color support for the branches command.

Sorry, I missed this on IRC, it should probably be:
  color: enable branches support
(dont resend the patch, a crew member can fix it easily before pushing it ;)

Otherwise I dont have major complaints.

[...]

> +echo "[extensions]" >> $HGRCPATH
> +echo "color =" >> $HGRCPATH
> +echo "[color]" >> $HGRCPATH
> +echo "branches.active = green" >> $HGRCPATH
> +echo "branches.closed = blue" >> $HGRCPATH
> +echo "branches.current = red" >> $HGRCPATH
> +echo "branches.inactive = magenta" >> $HGRCPATH

I wonder how the user is supposed to know that he can override the
label "branches.inactive" for example, as it's not documented?

Is it something that is missing in this patch? is it a shortcoming in
our current code?
Any suggestions on how to improve this system?

Regards,
-Nicolas.

> +echo "log.changeset = cyan" >> $HGRCPATH
> +
> +echo '-------'
> +hg branches --color=always
> +echo '-------'
> +hg branches --color=always --closed
> diff -r efcdf6a953a0 -r ff03b97e4525 tests/test-branches.out
> --- a/tests/test-branches.out	Tue Jul 27 16:04:00 2010 -0500
> +++ b/tests/test-branches.out	Wed Jul 28 23:05:03 2010 -0600
> @@ -242,3 +242,27 @@
>  date:        Thu Jan 01 00:00:09 1970 +0000
>  summary:     prune bad branch
>  
> +3 files updated, 0 files merged, 2 files removed, 0 files unresolved
> +2 files updated, 0 files merged, 3 files removed, 0 files unresolved
> +-------
> +b                             13:6ac12926b8c3
> +a branch name much longer than the default justification used by branches 7:10ff5895aa57
> +a                              5:d8cbc61dbaa6 (inactive)
> +default                        0:19709c5a4e75 (inactive)
> +-------
> +b                             13:6ac12926b8c3
> +a branch name much longer than the default justification used by branches 7:10ff5895aa57
> +c                             14:717d2e6fabe1 (closed)
> +a                              5:d8cbc61dbaa6 (inactive)
> +default                        0:19709c5a4e75 (inactive)
> +-------
> +b                             13:6ac12926b8c3
> +a branch name much longer than the default justification used by branches 7:10ff5895aa57
> +a                              5:d8cbc61dbaa6 (inactive)
> +default                        0:19709c5a4e75 (inactive)
> +-------
> +b                             13:6ac12926b8c3
> +a branch name much longer than the default justification used by branches 7:10ff5895aa57
> +c                             14:717d2e6fabe1 (closed)
> +a                              5:d8cbc61dbaa6 (inactive)
> +default                        0:19709c5a4e75 (inactive)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


-- 
Nicolas Dumazet — NicDumZ


More information about the Mercurial-devel mailing list