[PATCH 3 of 6] branches: port to generic templater

Mads Kiilerich mads at kiilerich.com
Thu Oct 2 10:27:19 CDT 2014


On 10/02/2014 04:59 PM, Yuya Nishihara wrote:
> @@ -1093,7 +1094,11 @@ def branches(ui, repo, active=False, clo
>       Returns 0.
>       """
>   
> -    hexfunc = ui.debugflag and hex or short
> +    fm = ui.formatter('branches', opts)
> +    if fm or ui.debugflag:
> +        hexfunc = hex
> +    else:
> +        hexfunc = short

I don't remember if I mentioned it before, but I think we reuse this 
pattern so often that we should introduce something like 
ui.hexfunc(alwaysfull=fm).

/Mads



More information about the Mercurial-devel mailing list