formatter: unblock storing fctx as a template resource
To keep templateformatter._renderitem() simple, a repo instance is looked
through ctx if available. This is probably good for future subrepo support
where ctx.repo() may be different from the global repo.
templater: process mapping dict by resource callables
A resource item is a callable, so let's make it look up a resource object
by itself.
templater: convert resources to a table of callables for future extension
I'm going to add a full templating support to the annotate command. As the
annotate is a filectx-oriented command, we'll need a way to look up a ctx
from a bounded fctx only when necessary.
This is the minimal change to support that. I'm thinking of defining a proper
interface to look up template resources to fix other issues, but that isn't
ready yet.
(Changes from V1: just updated tests and patch descriptions.)
rebase: on abort, don't strip commits that didn't need rebased (
issue5822)
I clearly missed adding this condition in
78496ac30025 (rebase: allow
rebase even if some revisions need no rebase (BC) (
issue5422),
2017-05-11). Perhaps I should have opted for the "revdone" solution I
mentioned there...
Differential Revision: https://phab.mercurial-scm.org/D2879
rebase: avoid defining two lists with the same contents
In abort(), there's "dstates" and "rebased" that are identical, which
they seem to have been since
0806823370d8 (rebase: properly calculate
descendant set when aborting (
issue3332), 2012-03-22). Let's
de-duplicate. I don't know what "dstates" means, but "rebased" makes
sense (it's the list of rebased revisions), so let's pick that.
Differential Revision: https://phab.mercurial-scm.org/D2878
tests: demonstrate aborted rebase strips commits that didn't need rebasing
I haven't verified, but this has probably been broken ever since I
added the feature in
78496ac30025 (rebase: allow rebase even if some
revisions need no rebase (BC) (
issue5422), 2017-05-11).
Differential Revision: https://phab.mercurial-scm.org/D2877