FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Tue, 08 Mar 2016 23:04:53 +0900] rev 28394
revset: replace extpredicate by revsetpredicate of registrar
This patch consists of changes below (these can't be applied
separately).
- replace revset.extpredicate by registrar.revsetpredicate in
extensions
- remove setup() on an instance named as revsetpredicate in
uisetup()/extsetup() of each extensions
registrar.revsetpredicate doesn't have setup() API.
- put new entry for revsetpredicate into extraloaders in dispatch
This causes implicit loading predicate functions at loading
extension.
This loading mechanism requires that an extension has an instance
named as revsetpredicate, and this is reason why
largefiles/__init__.py is also changed in this patch.
Before this patch, test-revset.t tests that all decorated revset
predicates are loaded by explicit setup() at once ("all or nothing").
Now, test-revset.t tests that any revset predicate isn't loaded at
failure of loading extension, because loading itself is executed by
dispatch and it can't be controlled on extension side.
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.
timeless <timeless@mozdev.org> [Tue, 08 Mar 2016 14:32:03 +0000] rev 28383
hghave: improve description of Hypothesis
timeless <timeless@mozdev.org> [Wed, 02 Mar 2016 21:39:55 +0000] rev 28382
purge: use absolute_import
timeless <timeless@mozdev.org> [Wed, 02 Mar 2016 21:38:32 +0000] rev 28381
record: use absolute_import
timeless <timeless@mozdev.org> [Wed, 02 Mar 2016 21:36:14 +0000] rev 28380
relink: use absolute_import
timeless <timeless@mozdev.org> [Wed, 02 Mar 2016 21:33:55 +0000] rev 28379
schemas: use absolute_import
timeless <timeless@mozdev.org> [Wed, 02 Mar 2016 21:30:51 +0000] rev 28378
shelve: use absolute_import
timeless <timeless@mozdev.org> [Wed, 02 Mar 2016 21:26:36 +0000] rev 28377
strip: use absolute_import
Martijn Pieters <mjpieters@fb.com> [Fri, 04 Mar 2016 14:44:32 +0000] rev 28376
graphmod: augment the graph to include more information about the edges
The walker knows when an edge leads to a direct parent, a grandparent (skipping
revisions not part of the revset) and parents that are missing altogether
(neither it nor a grandparent is in the revset). Add this information to the
parents sequence yielded.
Martijn Pieters <mjpieters@fb.com> [Fri, 04 Mar 2016 14:44:32 +0000] rev 28375
graphmod: refactor state handling
Move ASCII graph state to a dictionary, to clarify what is being tracked. Move
the 'seen' state (tracking currently active edges) into this structure.
Yuya Nishihara <yuya@tcha.org> [Thu, 11 Jun 2015 23:04:14 +0900] rev 28374
templater: move label() function from color extension
ui.label() is no-op by default, so we can just call ui.label() by label()
template function no matter if the color is enabled or not.
Yuya Nishihara <yuya@tcha.org> [Thu, 11 Jun 2015 22:58:27 +0900] rev 28373
templater: make label() take unknown symbol as color literal
Instead of the mapping hack introduced by
b775a2029e8d, this patch changes the
way how a label symbol is evaluated. This is still hackish, but should be more
predictable in that it doesn't depend on the known color effects.
This change is intended to eliminate the reference to color._effects so that
color.templatelabel() can be merged with templater.label().
timeless <timeless@mozdev.org> [Wed, 02 Mar 2016 15:50:34 +0000] rev 28372
convert: monotone use absolute_import
timeless <timeless@mozdev.org> [Wed, 02 Mar 2016 15:31:15 +0000] rev 28371
convert: p4 use absolute_import
timeless <timeless@mozdev.org> [Wed, 02 Mar 2016 15:26:49 +0000] rev 28370
convert: hg use absolute_import
timeless <timeless@mozdev.org> [Wed, 02 Mar 2016 14:56:29 +0000] rev 28369
convert: cvsps use absolute_import
timeless <timeless@mozdev.org> [Wed, 02 Mar 2016 14:23:23 +0000] rev 28368
convert: darcs use absolute_import
timeless <timeless@mozdev.org> [Wed, 02 Mar 2016 09:00:58 +0000] rev 28367
convert: filemap use absolute_import
timeless <timeless@mozdev.org> [Wed, 02 Mar 2016 08:58:01 +0000] rev 28366
convert: gnuarch use absolute_import
timeless <timeless@mozdev.org> [Wed, 02 Mar 2016 20:42:13 +0000] rev 28365
convert: git use absolute_import