Martin von Zweigbergk <martinvonz@google.com> [Thu, 07 Nov 2019 13:40:53 -0800] rev 4951
obslog: make {succnodes} be full hex nodes
It should be up to the user to shorten the nodeid as much or as little
as they like.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 08 Nov 2019 07:19:18 -0800] rev 4950
obslog: remove now-unused code for plain styling
We now always use a non-plain formatter for the non-local-filtering
code paths, so we can remove the code for plain styling.
I couldn't figure out how to replace the fm.formatlist() by something
less about formatting, so I've only removed the irrelevant arguments
from those calls.
Martin von Zweigbergk <martinvonz@google.com> [Thu, 07 Nov 2019 23:17:34 -0800] rev 4949
obslog: redefine default output as a template, unless -f was given
This was easier than I expected to do without affecting any test
output at all.
`hg obslog -f` is pretty broken with templating. For example, it
inserts a single "date" field, but it provides two values for it if
the dates are different. That results in a traceback when running
e.g. `hg obslog -f -Tfoo` with non-local obsmarkers with different
dates. We need to figure out what we want to put in the template for
the filtered case. I've just left it out for now.
Martin von Zweigbergk <martinvonz@google.com> [Thu, 07 Nov 2019 23:15:29 -0800] rev 4948
obslog: add newline after all markers in non-graphlog to match graphlog
I'd also be fine with doing the reverse if that's preferred, but I
really want them to be the same so they can use the same template.
Martin von Zweigbergk <martinvonz@google.com> [Thu, 07 Nov 2019 22:24:50 -0800] rev 4947
obslog: make reason for unavailable patch part of template
We need the reason to be in the template in order to be able to
templatize the whole output.
Martin von Zweigbergk <martinvonz@google.com> [Thu, 07 Nov 2019 16:34:01 -0800] rev 4946
obslog: make content and description patches available to templater
The code was repeatedly calling fm.write() with the same field
("patch" and "descdiff"). I think that led to the value constantly
getting replaced, so when it was used in a template (as {patch} or
{descdiff}), it would only get the last value, which was always an
empty string.
This patch fixes it by writing the full patch to a temporary buffer
and then assigning the whole patch to the formatter field.
Martin von Zweigbergk <martinvonz@google.com> [Thu, 07 Nov 2019 17:22:44 -0800] rev 4945
obslog: rename {desc-diff} to {descdiff} since the former is invalid
Martin von Zweigbergk <martinvonz@google.com> [Thu, 07 Nov 2019 17:22:16 -0800] rev 4944
tests: demonstrate broken {patch} and {desc-diff} template keywords
Anton Shestakov <av6@dwimlabs.net> [Fri, 15 Nov 2019 11:48:17 +0700] rev 4943
topic: drop compat.successorssets(), it's not used
The only place in topics that uses successorssets function is in evolvebits.py,
and it's using that function from obsutil directly.
Anton Shestakov <av6@dwimlabs.net> [Fri, 15 Nov 2019 11:37:34 +0700] rev 4942
topic: drop compat.getmarkers() and use obsutil.getmarkers() directly
The function in question was moved from obsolete to obsutil in a14e2e7f7d1f (hg
4.3).
See also 6aff4bb3970d for hgext3rd/evolve.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 15 Nov 2019 08:14:06 -0800] rev 4941
cmdrewrite: avoid accessing scmutil.status fields by index
Support for indexed access is going away in Mercurial. Accessing the
fields by name is clearer anyway.
Martin von Zweigbergk <martinvonz@google.com> [Thu, 07 Nov 2019 23:10:26 -0800] rev 4940
obslog: avoid using a formatter after calling end() on it
I don't know if makes a difference, but it feels wrong to use it after
calling end(). We can simply use the parent formatter in this case.
Martin von Zweigbergk <martinvonz@google.com> [Thu, 07 Nov 2019 15:00:57 -0800] rev 4939
obslog: use plural name "effects" for list of all effects
Same reasoning as the previous patch, but here the singular was used
for the list instead.
This patch also renames the variable that represents the list of
effects to plural "effects" to reduce confusion.
Martin von Zweigbergk <martinvonz@google.com> [Thu, 07 Nov 2019 13:21:20 -0800] rev 4938
obslog: use singular name "succnode" for each element of {succnodes}
The name that we pass for formatlist() is the name of each
element. After this patch, you'll write '{succnodes % "{succnode}"}'
instead of the confusing '{succnodes % "{succnodes}"}' (where the two
"succnodes" refer to different things.
Users can write templates that are compatible across this change by
using e.g. '{succnodes % "{if(succnode, succnode, succnodes)}"}'.