Commit Graph

1255 Commits

Author SHA1 Message Date
Durham Goode
ce250e375a revset: lower weight for _intlist function
The histedit command uses a revset like:

(_intlist('1234\x001235')) and merge()

Previously the optimizer gave a weight of 1.5 to the _intlist side (1 for the
function, 0.5 for the string) which caused it to process the merge() side first.
This caused it to evaluate merge against every commit in the repo, which took
2.5 seconds on a large repo.

I changed the weight of _intlist to 0, since it's a trivial calculation, which
makes it process intlist first, which makes merge apply only to the revs in the
list. Which makes the revset take 0.15 seconds now. Cutting off 2.4 seconds off
our histedit performance.

>From the revset benchmark:
revset #25: (_intlist('20000\x0020001')) and merge()
0) obsolete feature not enabled but 54243 markers found!
! wall 0.036767 comb 0.040000 user 0.040000 sys 0.000000 (best of 100)
1) obsolete feature not enabled but 54243 markers found!
! wall 0.000198 comb 0.000000 user 0.000000 sys 0.000000 (best of 9084)
2014-09-12 14:21:18 -07:00
Durham Goode
79319b785d revset: make parents() O(number of parents)
Strip executes a revset like this:

max(parents(_intlist('1234\x001235')) - _intlist('1234\x001235'))

Previously the parents() revset would do 'subset & parents' which iterates over
each item in the subset and checks if it's in parents.  subset is usually the
entire repo (a spanset) so this takes a while.

Reversing the parameters to be 'parents & subset' means the operation becomes
O(number of parents) instead of O(size of repo). It also means the result gets
evaluated immediately (since parents isn't a lazy set), but I think this is a
win in most scenarios.

This shaves 0.3 seconds off strip (amend/histedit/rebase/etc) for large repositories.

revset #0: parents(20000)
0) obsolete feature not enabled but 54243 markers found!
! wall 0.006256 comb 0.010000 user 0.010000 sys 0.000000 (best of 289)
1) obsolete feature not enabled but 54243 markers found!
! wall 0.000391 comb 0.000000 user 0.000000 sys 0.000000 (best of 4323)
2014-09-12 15:00:51 -07:00
Durham Goode
9d2bd7f0b2 revset: make descendants() lazier
Previously descendants() would force the provided subset to become a set.  In
the case of revsets like '(%ld::) - (%ld)' (as used by histedit) this would
force the '- (%ld)' set to be evaluated, which produced a set containing every
commit in the repo (except %ld). This takes 0.6s on large repos.

This changes descendants to trust the subset to implement __contains__
efficiently, which improves the above revset to 0.16s. Shaving 0.4 seconds off
of histedit.

revset #27: (20000::) - (20000)
0) obsolete feature not enabled but 54243 markers found!
! wall 0.023640 comb 0.020000 user 0.020000 sys 0.000000 (best of 100)
1) obsolete feature not enabled but 54243 markers found!
! wall 0.019589 comb 0.020000 user 0.020000 sys 0.000000 (best of 100)

This commit removes the final revset related perf hotspot from histedit.
Combined with the previous two patches, they shave a little over 3 seconds off
histedit on large repos.
2014-09-12 16:21:13 -07:00
Yuya Nishihara
6684fe223e check-code: look for misuse of __bool__ 2014-09-17 00:28:37 +09:00
Mike Edgar
97e4932db0 contrib/synthrepo: return None to delete files on commit, don't raise IOError
The internal commit API was changed in 2eef89bfd70d to expect None from the
filectx function when a file is to be deleted, not an IOError. This change
keeps synthrepo up-to-date.
2014-09-15 16:07:54 -04:00
Steve Borho
44742e8431 wix: contrib/sample.hgrc is no more 2014-09-15 09:36:12 -05:00
Mads Kiilerich
0cfacaa1bd dockerrpm: create a yum/dnf repo from the generated rpms
This gives "PPA" functionality where users easily can stay uptodate with latest
nightly build.
2014-08-31 13:41:09 +02:00
Mads Kiilerich
eff8053e22 docker: add CentOS 5
There is no official CentOS 5 docker template so we use one from saltstack.
2014-05-15 01:48:37 +02:00
Mads Kiilerich
b06c2984ad docker: use stable tags for fedora and centos
A moving target is rarely useful.
2014-08-31 13:41:09 +02:00
Mads Kiilerich
13ebf84a6d dockerrpm: prepare source outside docker and just run rpmbuild inside docker
Simplifies the rpm build process.

We will use platform specific rpmbuild directories and will not clean them and
will drop the explicit copy to build directory.
2014-05-30 14:14:33 +02:00
Mads Kiilerich
111ff86a5d dockerrpm: run docker build process as the current user, not as root
Docker can be run by ordinary users if they are in the docker group. The build
process would however be run as a root user, only protected by the sandboxing.
That caused problems with the shared directory where rpmbuild would be picky
about building from sources owned by less privileged users and producing files
owned by root.

Instead, add a build user with the right uid/gid to the image and run the
docker process as that user.
2014-05-30 14:14:33 +02:00
Mads Kiilerich
907b2db860 dockerrpm: better handling of specification of docker name 2014-05-30 14:14:33 +02:00
Mads Kiilerich
269cde03e7 dockerrpm: check that docker is running correctly before building 2014-05-30 14:14:33 +02:00
Mads Kiilerich
a4d490eeb3 buildrpm: introduce --rpmdir instead of using hardcoded rpmbuild dir
Used as rpm _topdir when preparing spec and source and building rpms.
2014-08-31 13:40:53 +02:00
Mads Kiilerich
adcba0a4e6 buildrpm: introduce --withpython for building rpms that includes Python 2.7 2014-05-15 01:50:11 +02:00
Mads Kiilerich
f5261c89a9 buildrpm: introduce --prepare for preparing without actually building rpms 2014-08-31 12:51:06 +02:00
Siddharth Agarwal
8432654231 fedora: remove sample.hgrc from shipped files
sample.hgrc was long obsolete and was removed in c4f6b10a363a.
2014-09-02 14:10:08 -07:00
Gregory Szorc
94580f82da revsetbenchmark: add revset with lazyset subtraction
The added revset is used by obsolescence and currently results in
recursion in __contains__ between 2 lazysets. We should have
coverage of this revset.
2014-08-30 15:17:37 +02:00
Matt Mackall
fc6de0f1aa contrib: drop obsolete sample.hgrc
This was full of bad suggestions and is obsoleted by hg config --edit.
2014-08-29 17:15:49 +02:00
Matt Mackall
108b8a7b71 contrib: drop old convert-repo script
This has been obsolete since 2007.
2014-08-29 17:14:45 +02:00
Mads Kiilerich
5d1360e0ed cleanup: make sure we always access members of imported modules
This will make sure we get import errors, even if demandimport is enabled.

This will also mute some pyflakes 'imported but unused' warnings.
2014-08-15 04:37:45 +02:00
Matt Mackall
2b52e463fe check-code: extend try/except/finally check for multiple except clauses 2014-08-14 16:39:27 -05:00
Matt Mackall
65aa1f6760 hg-test-mode: make exit code highlight work again 2014-08-12 12:53:23 -05:00
Matt Mackall
3cbc9a8820 hg-test-mode: don't highlight variables in output
This was disabling highlighting the rest of the line for $REASONS.
Instead, we only highlight when we think we're on a 'command' line.
2014-08-12 00:42:05 -05:00
Pierre-Yves David
4c3d1d5f78 check-code: allow an escape pattern to be specified for testpattern
Before this patch it was impossible to introduce a #no-xxx comment to disable a
test pattern warning.
2014-08-02 17:04:53 -07:00
Pierre-Yves David
1a25f452db check-code: capture "wc" as a word
Otherwise entries such as "wcchange" give false negative
2014-08-02 17:01:55 -07:00
Matt Mackall
e82fc40f9c hg-test-mode: colorize HGFOO and TESTFOO environment variables 2014-08-10 23:13:12 -05:00
Matt Mackall
d5b665f1bb contrib: add emacs mode for *.t files 2014-08-08 17:45:36 -05:00
Matt Mackall
7cba48bf37 whitespace: nuke triple blank lines in **.py 2014-08-07 14:58:12 -05:00
Matt Mackall
c16790ef08 check-commit: spot growing whitespace
We discourage PEP-8-style double blank lines, spot them creeping in.
2014-08-07 14:57:20 -05:00
Matt Mackall
aeec96d347 contrib: add check-commit hook script to sanity-check commits 2014-08-06 02:45:55 -05:00
Pierre-Yves David
2017698ec4 simplemerge: burn "minimal" feature to the ground
Matt Mackall said:

  The goal of simplemerge should have always been to be a drop-in
  replacement for RCS merge. Please nuke this minimization thing entirely.

This whole things is now dead.
2014-08-05 14:56:25 -07:00
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