templates and the log --debug output the extra fields

Steve Fink sphink at gmail.com
Mon Jan 4 21:42:10 UTC 2021


On 1/3/21 7:48 AM, Uwe Brauer wrote:
> Can anybody please point out to me the required syntax for this field?

I've never played with this stuff before, but it was intriguing, and
this seemed to work for the basic case when saved to a file
/tmp/templatestuff:

%include map-cmdline.default

[templates]
changeset =
'{cset}{branches}{bookmarks}{ltopic}{tags}{parents}{luser}{ldate}{summary}{lfiles}\n'

ltopic = "{if(get(extras, "topic"),label("log.topic",
"topic:       {get(extras, "topic")}\n"))}"

----

I ran with `hg log --style /tmp/templatestuff`. (You'd probably want to
override changeset_verbose, changeset_brief, etc. as well.)

I will also note that this kind of goes against the idea of topics, as
things that only apply to draft revisions, and so I could imagine it
breaking if stale topics were discarded at some time in the future. But
I see the usefulness of this information. In my case, it wouldn't work,
because I'd really want to see it for landed patches but Mozilla now
lands via phabricator, which doesn't get access to the original revision
so could never know what topics it might contain.





More information about the Mercurial mailing list