Martin von Zweigbergk <martinvonz@google.com> [Tue, 23 Feb 2016 10:59:25 -0800] rev 28226
merge: use any() instead of for loop when checking for dirty subrepos
I think it's both simpler and clearer to use any() than the current
for loop.
While at it, also drop the call to sorted(), since it doesn't matter
which order we iterate over subrepos.
Kostia Balytskyi <ikostia@fb.com> [Wed, 24 Feb 2016 19:31:55 +0000] rev 28225
templater: fix list templating bug
High-level use case: printing a list of objects with formatter
when each object in turn contains a list of properties (like
when % template symbol is used in {things % '{thing}'}
Let the top-level list contain one thing with two properties:
objs = [{
'props': [
{ 'value': 1, 'show': 1 },
{ 'value': 2 }]
}]
(please note that second property does not have 'show' key)
If a templateformatter is used to print this with template
"{props % '{if(show, value)}'}"
current implementation will print value for both properties,
which is a bug. This happens because in `templater.runmap`
function we only rewrite mapping values with existing new
values for each item. If some mapping value is missing in
the item, it will not be removed.
Pierre-Yves David <pierre-yves.david@fb.com> [Wed, 24 Feb 2016 16:58:07 +0100] rev 28224
histedit: also handle locally missing nodes when reading obsolescence
The previous version of the code was interpreting markers to a missing
node as a prune in all cases. The expected way to handle such
situation is to keep reading markers, only turning successors into
"prune" if they are at the end of a chain.
We update the code and add a test for this.
Jun Wu <quark@fb.com> [Wed, 24 Feb 2016 18:42:59 +0000] rev 28223
chgserver: auto exit after being idle for too long or lose the socket file
This is a part of the one server per config series. In multiple-server setup,
new server may be started for a temporary config change like in command line,
--config extensions.foo=bar.py. This may end up with a lot of not so useful
server processes. Other questions are about socket file and process management,
How to stop these processes? What if a new server wants to listen on a same
address, replacing the old one?
This patch introduces AutoExitMixIn, which will:
1. Exit after being idle for too long. So useless servers won't run forever.
2. Periodically check the ownership of socket file, exit if it is no longer
owned. This brings strong consistency between the filesystem and the
process, and handles some race conditions neatly.
Since rename is atomic, a new server can just have a same server address
with an old one and won't worry about how to make sure the old server is
killed, address conflict, service downtime issues.
The user can safely stop all servers by simply removing the socket files,
without worrying about outdated or accidentally removed pidfiles.
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 22 Feb 2016 23:36:04 +0100] rev 28222
unionrepo: properly handle hidden linkrev in revlog (issue5070)
The unionrepository have to do some special magic to handle linkrev of the
unioned filerev and manifestrev. That logic was done from a repoview and
obsolescence marker affecting bundled changeset could lead to a crash. We now
ensure we operate on unfiltered repository.
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 22 Feb 2016 23:34:54 +0100] rev 28221
bundlerepo: properly handle hidden linkrev in manifestlog (issue4945)
The bundlerepository have to do some special magic to handle linkrev of the
bundled manifest. That logic was done from a repoview and obsolescence marker
affecting bundled changeset could lead to a crash. We now ensure we operate on
unfiltered repository.
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 22 Feb 2016 18:35:40 +0100] rev 28220
bundlerepo: properly handle hidden linkrev in filelog (issue4945)
The bundlerepository have to do some special magic to handle linkrev of the
bundlerepo filerev. That logic was done from a repoview and obsolescence marker
affecting bundled changeset could lead to a crash. We now ensure we operate on
unfiltered repository.
Jun Wu <quark@fb.com> [Wed, 24 Feb 2016 18:42:14 +0000] rev 28219
check-code: allow old style class with special comments
The following chgserver change will use an old style class to comply with
SocketServer's code style. This patch made it possible to pass check-code.
Matt Mackall <mpm@selenic.com> [Wed, 24 Feb 2016 15:55:44 -0600] rev 28218
merge with stable
Durham Goode <durham@fb.com> [Wed, 24 Feb 2016 10:41:15 -0800] rev 28217
revset: use smartset minus operator
Previously, revsets like 'X - Y' were translated to be 'X and not Y'. This can
be expensive, since if Y is a single commit then 'not Y' becomes a huge set and
sometimes the query optimizer doesn't account for it well.
This patch changes revsets to use the built in smartset minus operator, which is
often smarter than 'X and not Y'.
On a large repo this saves 2.2 seconds on rebase and histedit because "X:: - X"
becomes almost instant.
Relevant performance numbers from revsetbenchmark.py
revset #13: roots((tip~100::) - (tip~100::tip))
plain min max first last reverse rev..rst rev..ast sort sor..rst sor..ast
0) 0.001080 0.001107 0.001102 0.001118 0.001121 0.001114 0.001141 0.001123 0.001099 0.001123 0.001137
1) 0.000708 65% 0.000738 66% 0.000735 66% 0.000739 66% 0.000784 69% 0.000780 70% 0.000807 70% 0.000756 67% 0.000727 66% 0.000759 67% 0.000808 71%
revset #14: roots((0::) - (0::tip))
plain min max first last reverse rev..rst rev..ast sort sor..rst sor..ast
0) 0.131304 0.079168 0.133129 0.076560 0.048179 0.133349 0.049153 0.077097 0.129689 0.076212 0.048543
1) 0.065066 49% 0.036941 46% 0.066063 49% 0.034755 45% 0.048558 0.071091 53% 0.047679 0.034984 45% 0.064572 49% 0.035680 46% 0.048508
revset #22: (not public() - obsolete())
plain min max first last reverse rev..rst rev..ast sort sor..rst sor..ast
0) 0.000139 0.000133 0.000133 0.000138 0.000134 0.000155 0.000157 0.000152 0.000157 0.000156 0.000153
1) 0.000108 77% 0.000129 0.000129 0.000134 0.000132 0.000127 81% 0.000151 0.000147 0.000127 80% 0.000152 0.000149
revset #25: (20000::) - (20000)
plain min max first last reverse rev..rst rev..ast sort sor..rst sor..ast
0) 0.050560 0.045513 0.022593 0.043588 0.021909 0.045517 0.021822 0.044660 0.049740 0.044227 0.021819
1) 0.018614 36% 0.000171 0% 0.019659 87% 0.000168 0% 0.015543 70% 0.021069 46% 0.015623 71% 0.000180 0% 0.018658 37% 0.000186 0% 0.015750 72%