Commit Graph

1223 Commits

Author SHA1 Message Date
Gregory Szorc
27315bd014 revset: optimize baseset.__sub__ (issue4313)
f5a63a5506d2 regressed performance of baseset.__sub__ by introducing
a lazyset. This patch restores that lost performance by eagerly
evaluating baseset.__sub__ if the other set is a baseset.

revsetbenchmark.py results impacted by this change:

revset #6: roots(0::tip)
0) wall 2.923473 comb 2.920000 user 2.920000 sys 0.000000 (best of 4)
1) wall 0.077614 comb 0.080000 user 0.080000 sys 0.000000 (best of 100)

revset #23: roots((0:tip)::)
0) wall 2.875178 comb 2.880000 user 2.880000 sys 0.000000 (best of 4)
1) wall 0.154519 comb 0.150000 user 0.150000 sys 0.000000 (best of 61)

On the author's machine, this slowdown manifested during evaluation of
'roots(%ln::)' in phases.retractboundary after unbundling the Firefox
repository. Using `time hg unbundle firefox.hg` as a benchmark:

Before: 8:00
After:  4:28
Delta: -3:32

For reference, the subset and cs baseset instances impacted by this
change were of lengths 193634 and 193627, respectively.

Explicit test coverage of roots(%ln::), while similar to the existing
roots(0::tip) benchmark, has been added.
2014-07-24 12:12:12 -07:00
Danek Duvall
151b68d8da tests: cat error messages are different on Solaris 2014-07-21 11:27:24 -07:00
Yuya Nishihara
ba9d664628 mergetools: add --nofork option to gvimdiff.diffargs for extdiff
Without --nofork, temporary files are removed immediately before gvimdiff
starts.  "-d -g -O" are put just for consistency with gvimdiff.args.
2014-07-12 20:07:24 +09:00
anatoly techtonik
bff9cb0660 contrib/vagrant: use Vagrant for running tests on virtual machine
$ cd contrib/vagrant
  $ vagrant up
  $ vagrant ssh -c ./run-tests.sh

Repository is shared at /hgshared in guest machine.
2014-07-05 16:32:28 +03:00
Augie Fackler
e112e0adb8 check-code: drop ban on callable() which was restored in Python 3.2
A followup will restore use of callable() in place of the awkward
hasattr() construction we were using to be one step closer to Python
3.
2014-06-23 09:22:53 -04:00
Sean Farley
f850db4e51 bash_completion: add -l|--list support for shelve
This was overlooked previously and found via 'hg shelve -p -l <tab>' (to show
the diff of the shelved commit).
2014-06-06 00:21:46 -05:00
Sean Farley
1002b6c612 memfilectx: call super.__init__ instead of duplicating code
This patch changes the calling signature of memfilectx's __init__ to fall in
line with the other file contexts.

Calling code and tests have been updated accordingly.
2013-08-15 16:49:27 -05:00
Matt Mackall
1a7f325519 docker: check for docker.io first 2014-05-29 16:01:39 -07:00
Mads Kiilerich
31abc68338 buildrpm: include release version in .tar.gz name
Official releases are fully indentified by the version number, these builds are
not.

Specs are however traditionally not versioned.
2014-05-20 04:07:58 +02:00
Mads Kiilerich
d77462b1b9 buildrpm: remove prompt for uncommitted changes - it was a bad idea
We want a command that is useful in scripts, not an interactive command.
2014-05-15 01:48:37 +02:00
Mads Kiilerich
1e6c7ac0e7 buildrpm: collect code for building local hg and using it in one place 2014-05-15 01:48:37 +02:00
Mads Kiilerich
f12464b8db buildrpm: various minor cleanup 2014-05-20 03:57:21 +02:00
Gregory Szorc
5d78314d10 fix_bytes: loosen blacklist matching requirements
On my Linux machine, paths seen by 2to3 include the build directory. We
switch from an exact to substring match to allow 2to3 to work in more
environments.
2014-05-10 14:54:39 -07:00
Pierre-Yves David
73ae570dcf mergetools.hgrc: add minimal configuration for editmerge
The ``editmerge`` script is shipped in contrib and opens an editor on
every conflicting file. It needs minimal configuration to inject the
config marker in the file before opening. Otherwise it behaves the
same as ``internal:local`` and bad things happen.
2014-05-29 12:25:25 -07:00
Ali Vakilzade
1c061098e4 vim: use try catch in vim plugin to avoid conflicts 2014-05-03 19:11:51 +04:30
Matt Mackall
362480f7d9 docker: update package target to packages/ 2014-05-27 12:09:34 -07:00
Pierre-Yves David
c15a68e583 revsetbenchmark: support for running on other repo
We add a -R/--repo option to run the benchmarks on another repository. This is
very useful as some repository are bigger/more interesting  than the mercurial one.
2014-04-29 14:12:32 -07:00
Pierre-Yves David
aef1228e4b revsetbenchmark: automatically finds the perf extension
Before this changeset, you had to stand in the root of the mercurial repo to run
the `revsetbenchmark.py` script. Otherwise, the perf extension would not be
found a `./contrib/perf.py` and the script would crash in panic.

We now figure out the contrib directory from the location of this script. This
makes it possible to run the script from other location that the mercurial repo
root (but you still need to be in the core mercurial repository)
2014-04-29 13:18:22 -07:00
Pierre-Yves David
b73ad46444 revset-benchmark: add max(::(tip~20) - obsolete())
This revset is used in evolve. The new revset lazyness should make it all faster
but in practice it is significantly slower.

Below is a timing for this entry on my Mercurial repo.

2.9.2) ! wall 0.034598 comb 0.040000 user 0.040000 sys 0.000000 (best of 100)
3.0+@) ! wall 0.062268 comb 0.060000 user 0.060000 sys 0.000000 (best of 100)

The ~20 have been taken arbitrary.
2014-05-19 14:39:19 -07:00
Steven Brown
b97c015cd5 check-code: check for consistent usage of the websub filter in hgweb templates
The check-code tool now expects the "desc" keyword to be followed by the
"websub" filter, with the following exceptions:
a) It has no filters at all, e.g. a changeset description in the raw style
   templates or the repository description in the summary page.
b) It is followed by the "firstline" filter, e.g. the first line of the
   changeset description is displayed as a summary or title.
2014-05-17 17:11:06 +08:00
Pierre-Yves David
0c7ef71682 revsetbenchmark: add author(mpm) or author(lmoscovicz) to the canonical list
This matters as `author(mpm)` have a lot of matches evenly split in the repo,
while `author(lmoscoviz)` have less match (and later). This changes the execution
path of the "or" operator a lot.
2014-04-30 18:40:20 -07:00
Pierre-Yves David
3e36aa9f14 revsetbenchmark: use optparse to retrieve argument
We need more flexibility. For example we'll want to run the benchmark on other
repository.
2014-04-29 11:40:42 -07:00
Pierre-Yves David
5909fe016c revsetbenchmark: add a usage message when no arguments are passed
This increase the odd someone who didn't wrote will it find out how to use this
script.
2014-04-25 13:35:31 -07:00
Pierre-Yves David
939d348711 revsetbenchmark: add ::tip and draft() to the canonical list
The want to test element on different side of the iterators.
2014-04-29 19:15:36 -07:00
Matt Mackall
dc3027aa51 build: initial support for in-tree autobuilding recipes 2014-05-07 17:58:13 -05:00
Gregory Szorc
b477c96e34 debugshell: declare command using decorator 2014-05-04 21:19:31 -07:00
Matt Mackall
ff4d16ffda check-code: look at shebang to identify Python scripts 2014-05-05 13:37:59 -05:00
Pierre-Yves David
b42c62324c revset: inline spanset containment check (fix perf regression)
Calling a function is super expensive in python. We inline the trivial range
comparison to get back to more sensible performance on common revset operation.

Benchmark result below:

Revision mapping:
0) bced32a3fd6c 2.9.2 release
1) 2ab64f462d81 current @
2) This revision


revset #0: public()
0) wall 0.010890 comb 0.010000 user 0.010000 sys 0.000000 (best of 201)
1) wall 0.012109 comb 0.010000 user 0.010000 sys 0.000000 (best of 199)
2) wall 0.012211 comb 0.020000 user 0.020000 sys 0.000000 (best of 197)

revset #1: :10000 and public()
0) wall 0.007141 comb 0.010000 user 0.010000 sys 0.000000 (best of 361)
1) wall 0.014139 comb 0.010000 user 0.010000 sys 0.000000 (best of 186)
2) wall 0.008334 comb 0.010000 user 0.010000 sys 0.000000 (best of 308)

revset #2: draft()
0) wall 0.009610 comb 0.010000 user 0.010000 sys 0.000000 (best of 279)
1) wall 0.010942 comb 0.010000 user 0.010000 sys 0.000000 (best of 243)
2) wall 0.011036 comb 0.010000 user 0.010000 sys 0.000000 (best of 239)

revset #3: :10000 and draft()
0) wall 0.006852 comb 0.010000 user 0.010000 sys 0.000000 (best of 383)
1) wall 0.014641 comb 0.010000 user 0.010000 sys 0.000000 (best of 183)
2) wall 0.008314 comb 0.010000 user 0.010000 sys 0.000000 (best of 299)

We can see this changeset gains back the regression for `and` operation on
spanset.  We are still a bit slowerfor the `public()` and `draft()`. Predicates
not touched by this changeset.
2014-04-28 15:15:36 -07:00
Pierre-Yves David
34283e2be8 revsetbenchmark: fix error raising
We want to display the commands, not all arguments of the function. (The old
code actually crash, failing to joining a list of lists.)
2014-04-25 13:44:51 -07:00
Mads Kiilerich
87448a2943 contrib: remove mergetools.hgrc premerge=False for Beyond Compare and Araxis
There can be good reasons to disable premerge no matter which merge tool is
used. Most tools will do just fine without premerge and handle the simple
merges more or less automatic and silent. We _could_ thus disable premerge for
most tools. But without premerge, the merge tool will be launched for each file
- that makes it a slow and expensive process to perform big simple merges. It
  is thus better to consistently stick to the default premerge=True.

The mergetools.hgrc configuration for most tools implicitly use the default
premerge=True but Araxis and the Linux entry for Beyond Compare had
premerge=False. These lines has been removed.

These settings were introduced by de7cda55270e without further explanation of
why they should be good.

(We have seen some crashes on Windows with Araxis where a merge failed after a
lot of Araxis flashing. I haven't been able to reproduce it and do not know
exactly what happened. Enabling premerge avoids the problems.)
2014-04-17 14:54:46 +02:00
FUJIWARA Katsunori
0ba1f1ddab check-code: detect "% inside _()" when there are leading whitespaces
Before this patch, "contrib/check-code.py" can't detect "% inside _()"
correctly, when there are leading whitespaces before the format
string, like below:

    _(
      "format string %s" % v)

This patch adds regexp pattern "[ \t\n]*" before the pattern matching
against the format string.

"[\s\n]" can't be used in this purpose, because "\s" is automatically
replaced with "[ \t]" by "_preparepats()" and "\s" in "[]" causes
nested "[]" unexpectedly.
2014-04-16 03:05:00 +09:00
Andrew Shadura
eb789f07b1 hgk: use hg export to write commits
Instead of calling internal command, use hg export to produce changeset
diffs compatible with hg import directly.
2014-03-15 18:27:51 +01:00
Andrew Shadura
7953c9bd23 hgk: add .diff extension when exporting commits
Append the .diff extension automatically.
2014-03-25 22:47:59 +01:00
Durham Goode
13db32b575 revset: improve _descendants performance
Previously revset._descendants would iterate over the entire subset (which is
often the entire repo) and test if each rev was in the descendants list. This is
really slow on large repos (3+ seconds).

Now we iterate over the descendants and test if they're in the subset.
This affects advancing and retracting the phase boundary (3.5 seconds down to
0.8 seconds, which is even faster than it was in 2.9). Also affects commands
that move the phase boundary (commit and rebase, presumably).

The new revsetbenchmark indicates an improvement from 0.2 to 0.12 seconds. So
future revset changes should be able to notice regressions.

I removed a bad test. It was recently added and tested '1:: and reverse(all())',
which has an amibiguous output direction.  Previously it printed in reverse order,
because we iterated over the subset (the reverse part). Now it prints in normal
order because we iterate over the 1:: . Since the revset itself doesn't imply an
order, I removed the test.
2014-03-25 14:10:01 -07:00
Durham Goode
af886934bd revsetbenchmark: remove python 2.7 dependency
revsetbenchmark.py used check_output which only exists in python 2.7. This
fixes it.
2014-03-31 16:29:39 -07:00
Matt Mackall
c9eb4517fa merge with stable 2014-04-01 15:11:19 -05:00
FUJIWARA Katsunori
0eed53de6c i18n: fix "% inside _()" problems
Before this patch, "contrib/check-code.py" can't detect these
problems, because the regexp pattern to detect "% inside _()" doesn't
suppose the case that format string consists of multiple string
components concatenated implicitly or explicitly,

This patch does below for that regexp pattern to detect "% inside _()"
problems in such case.

  - put "+" into separator part ("[ \t\n]") for explicit concatenation
    ("...." + "...." style)

  - enclose "component and separator" part by "(?:....)+" for
    concatenation itself ("...." "...." or "...." + "....")
2014-04-01 02:46:03 +09:00
FUJIWARA Katsunori
01d8b27701 i18n: fix "% inside _()" problems
Before this patch, "contrib/check-code.py" can't detect these
problems, because the regexp pattern to detect "% inside _()" doesn't
suppose the case that the format string and "%" aren't placed in the
same line.

This patch replaces "\s" in that regexp pattern with "[ \t\n]" to
detect "% inside _()" problems in such case.

"[\s\n]" can't be used in this purpose, because "\s" is automatically
replaced with "[ \t]" by "_preparepats()" and "\s" in "[]" causes
nested "[]" unexpectedly.
2014-04-01 02:46:03 +09:00
Gregory Szorc
f89981fba5 revsetbenchmark: add entry for ::rev::
Revsets of the form ::rev:: were identified as the source behind the
regressions in issue 4201. Ensure we have explicit coverage of that
revset.
2014-03-28 16:12:05 -07:00
Pierre-Yves David
2df0f51a30 revsetbenchmark: add a summary at the end of execution
The summary list timing per revset making it much more easier to compare
revision to each other.
2014-03-26 18:51:49 -07:00
Pierre-Yves David
63b573d0ad revsetbenchmark: retrieve the benchmark value in python
We retrieve the output of the perf extension and print it ourself. This open the
door to processing of this data in the script.
2014-03-26 18:39:56 -07:00
Pierre-Yves David
b9be167079 revsetbenchmark: get revision to benchmark in a function
And move it to proper subprocess call.
2014-03-26 18:36:19 -07:00
Pierre-Yves David
9aaf552368 revsetbenchmark: convert revision display to proper subprocesscall 2014-03-26 18:27:17 -07:00
Pierre-Yves David
9af19c7201 revsetbenchmark: convert performance call to proper subprocess call 2014-03-26 18:26:18 -07:00
Pierre-Yves David
2214b66655 revsetbenchmark: convert update to proper subprocess call 2014-03-26 18:14:15 -07:00
Matt Mackall
cf6b799f9a revsetbenchmark: fix semicolon 2014-03-27 16:52:24 -05:00
Pierre-Yves David
05c4763edb revsetbenchmark: simplify and convert the script to python
The script is now in python. That translation is very raw, more improvement to
comes:

The "current code" and "base" entry have been dropped.  This is trivial to get
same result using a tagged revision or "." in the list of benchmarked revision.
2014-03-26 18:03:30 -07:00
Pierre-Yves David
258f4d6aa6 revsetbenchmapi: fix template
The revision description missed an \n
2014-03-26 16:38:08 -07:00
Pierre-Yves David
8dd85d0996 perf: unroll the result in perfrevset
With the new lazy revset implementation, we need to actually read all elements
to trigger all the computations. Otherwise a no-op if of course much faster than
the full work.
2014-03-26 17:25:11 -07:00
FUJIWARA Katsunori
f557533576 contrib: add "hgperf" command to measure performance of commands easily
Newly added "hgperf" command repeats "dispatch.runcommand()" for
specified Mercurial command and measure performance of it in the same
manner of "contrib/perf.py" extension.

Users (mainly developers) can examine performance of the target
command easily, without adding new entry for it to "contrib/perf.py"
extension.
2014-02-15 19:51:20 +09:00