FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Tue, 08 Mar 2016 23:04:53 +0900] rev 28393
registrar: define revsetpredicate to decorate revset predicate
revsetpredicate is used to replace revset.predicate and
revset.extpredicate in subsequent patches.
This patch also adds loadpredicate() to revset, because this
combination helps to figure out how the name of safe predicate is put
into safesymbols.
This patch still uses safesymbols set to examine whether the predicate
corresponded to the 'name' is safe from DoS attack or not, because
just setting func._safe property needs changes below for such
examination.
before:
name in revset.safesymbols
after:
getattr(revset.symbols.get(name, None), '_safe', False)
"automatic registration" described in help doc of revsetpredicate
class will be achieved by the subsequent patch, which lists
loadpredicate() up in dispatch.extraloaders.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Tue, 08 Mar 2016 23:04:53 +0900] rev 28392
registrar: introduce new class for registration to replace funcregistrar
_funcregistrarbase differs from funcregistrar in points below:
- every code paths should use same class derived from
_funcregistrarbase to register functions in a same category
funcregistrar expects (3rd party) extensions to use (a class
derived from) delayregistrar.
- actual extra setup should be executed in another function
For example, marking revset predicate as "safe" is executed in a
class derived from _funcregistrarbase, but putting name of "safe"
predicate into safesymbols is executed in another function for it.
funcregistrar expects derived classes to do so.
New class is named as module private one, because code paths, which
register functions, should use not it directly but one derived from
it.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Tue, 08 Mar 2016 23:04:53 +0900] rev 28391
dispatch: make loading extra information from extension extensible
This patch makes loading extra information from extension module at
dispatching extensible. Factoring 'loadcmdtable()' into commands.py is
a part of generalization of loading extra information.
This extensibility assumes registration of new function like below,
for example:
- revset predicate
- fileset predicate
- template keyword
- template filter
- template function
- internal merge tool
- web command
This patch requires not loader function itself but container module
and the name of it, because listing loader function directly up
implies actual loading module of it, even if it isn't used at runtime
(for example, extensions don't always define revset predicate)
Durham Goode <durham@fb.com> [Thu, 04 Feb 2016 15:38:04 -0800] rev 28390
obsolete: fix n^2 marker computation behavior
Previously, if you ran obsolete.createmarkers with a bunch of markers that did
not have successors (like when you do a prune), it encountered a n^2 computation
behavior because the loop would read the changelog (to get ctx.parents()), then
add a marker, in a loop. Adding a marker invalidated the computehidden cache,
and reading the changelog recomputed it.
This resulted in pruning 150 commits taking 150+ seconds in a large repo.
The fix is to break the reading part of the loop to be separate from the writing
part.
timeless <timeless@mozdev.org> [Tue, 08 Mar 2016 17:26:12 +0000] rev 28389
bdiff: (pure) support array.array arrays (
issue5130)
Pierre-Yves David <pierre-yves.david@fb.com> [Wed, 09 Mar 2016 22:21:08 +0000] rev 28388
mq: restrict generated patch name to 75 characters (
issue5117)
Super long first line in description lead to very long file name that
windows is unhappy about. We restrict the name to 75 char to avoid the
issue.
75 seems fine and leave some extra room for '__#' suffix in case of conflict.
I does not seems worthwhile to add a dedicated config option to configure the
length. It can be done in the future if there is an actual user demand for it.
Matt Harbison <matt_harbison@yahoo.com> [Sun, 06 Mar 2016 14:30:34 -0500] rev 28387
files: don't recurse into subrepos without a path or -S (
issue5127)
The 'm.always()' check was needed for when a path to 'sub1' is given, and 'sub1'
contains a subrepo itself. But that also caused the automatic recursion when no
path was given. Instead, force -S when printing a subrepo if the subpath is an
exact match (which will unconditionally recurse once in the nested subrepo).
Durham Goode <durham@fb.com> [Tue, 08 Mar 2016 00:20:08 -0800] rev 28386
parsers: optimize filtered headrevs logic
The old native head revs logic would iterate over every node, starting from 0,
and check if every node was filtered (by testing it against the filteredrevs
python set). On large repos with hundreds of thousands of commits, this could
take 150ms.
This new logic iterates over the nodes in reverse order, and skips the filtered
check if we've seen an unfiltered child of the node. This saves approximately a
bagillion filteredrevs set checks, which shaves the time down from 150ms to
20ms during every branch cache write.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 07 Mar 2016 03:14:19 +0900] rev 28385
destutil: choose non-closed branch head at first (BC)
Before this patch, destupdate() returns the tipmost (descendant)
branch head regardless of closed or not. But updating to closed branch
head isn't reasonable for ordinary workflow, because:
- "hg heads" doesn't show closed heads (= updated parent itself) by
default
- subsequent committing on it re-opens closed branch
even if inactivation of closed head is needed, update destination
isn't it, because it should be merged into to another branch in
such case.
This patch chooses non-closed descendant branch head as default update
destination at first. If all descendant branch heads are closed,
destupdate() returns the tipmost closed branch head.
For simplicity, this patch chooses adding _destupdatebranchfallback()
instead largely changing _destupdatebranch().
This patch changes not only normal lookup code path, but also the "no
default branch" code path, for consistency.
Kostia Balytskyi <ikostia@fb.com> [Tue, 08 Mar 2016 04:08:33 -0800] rev 28384
formatter: make labels work with templated output
To describe the bug this fix is addressing, one can do
``$ hg status -T "{label('red', path)}\n" --color=debug``
and observe that the label is not applied before my fix and applied with it.