commitctx: extract _filecommit too
This function is exclusively used in `commitctx`. So we should extract it too
for consistency and to reduce the `localrepo` bloat.
This is part of a larger refactoring/cleanup of the commitctx code to clarify
and augment the logic gathering metadata useful for copy tracing. The current
code is a tad too long and entangled to make such update easy.
Differential Revision: https://phab.mercurial-scm.org/D8710
commitctx: extract the function in a dedicated module
the function have few callers (< 15) is quite long a mostly independent from the
repository itself. It seems like a good candidate to reduce the bloatness of the
localrepository class. Extracting it will help us cleaning the code up and
splitting it into more reasonable-size function.
We don't use a copy trick because the amount of code extract is quite small
(<5%) and the de-indent means every single line change anyway. So this is not
deemed valuable to do so.
This is part of a larger refactoring/cleanup of the commitctx code to clarify
and augment the logic gathering metadata useful for copy tracing. The current
code is a tad too long and entangled to make such update easy.
Differential Revision: https://phab.mercurial-scm.org/D8709
commitctx: document a fast path in _filecommit
This block cut off a lot of logic, documenting the why and how seems useful to
future reader.
This is part of a larger refactoring/cleanup of the commitctx code to clarify
and augment the logic gathering metadata useful for copy tracing. The current
code is a tad too long and entangled to make such update easy. We start with
easy and small cleanup.
Differential Revision: https://phab.mercurial-scm.org/D8700
hgweb: simplify now that we always have a single path
Both `templatedir()` and `web.templatepath` are now always a single
path (or None).
Differential Revision: https://phab.mercurial-scm.org/D8788
templater: simplify stylemap() now that templatedir() returns a single path
Differential Revision: https://phab.mercurial-scm.org/D8787
templater: make templatepaths() return a single path, or None
The function returns either a singleton list or an empty list, so it
makes more sense to return a value or None. The plural in the name
also doesn't make sense, but `templatepath()` is already taken, so I
renamed it to `templatedir()` instead.
Differential Revision: https://phab.mercurial-scm.org/D8786
templater: simplify templatepaths() to avoid iterating a singleton list
The function iterates over a hard-coded list of one element since
d844e220792a (templater: don't search randomly for templates - trust
util.datapath, 2014-09-28).
Differential Revision: https://phab.mercurial-scm.org/D8785