[PATCH] templatekw: export ui.paths as {peerpaths}

Sean Farley sean at farley.io
Thu Jul 13 14:13:20 EDT 2017


Yuya Nishihara <yuya at tcha.org> writes:

> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1499873754 -32400
> #      Thu Jul 13 00:35:54 2017 +0900
> # Node ID 0601429fa6973ef5eeb97032772ecbdc1c54c37d
> # Parent  660613df4ea547c78b4ae06e20e4af46399dc02f
> templatekw: export ui.paths as {peerpaths}
>
> It's sometimes useful to show hyperlinks in log output.
>
>   "{get(peerpaths, "default")}/rev/{node}"
>
> Since each path may have sub options, "{peerpaths}" is structured as a dict
> of dicts, but the inner dict is rendered as if it were a string URL. The
> implementation is ad-hoc, so there are some weird behaviors described in
> the test. We might need to introduce a proper way of handling a hybrid
> scalar object.
>
> This patch adds _hybrid.__getitem__() so d['path']['url'] works.
>
> The keyword is named as "peerpaths" since "paths" seemed too generic in
> log context.

I like this. Queued, thanks!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 800 bytes
Desc: not available
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20170713/aa156405/attachment.sig>


More information about the Mercurial-devel mailing list