Commit Graph

1264 Commits

Author SHA1 Message Date
Yuya Nishihara
095547c625 test-commandserver: remove redundant banner output
Since test output was inlined, "testing <func>" message should no longer
be necessary.
2014-09-28 16:59:30 +09:00
Yuya Nishihara
1d33f9598f test-commandserver: split helper functions to new hgclient module
This prepares for porting test-commandserver.py to .t test.

Though command-server test needs many Python codes, .t test will be more
readable than .py test thanks to inlined output.
2014-09-28 13:31:16 +09:00
Pierre-Yves David
e1494119f1 revsetbenchmark: add a rebase-related revset to the benchmark list 2014-09-23 17:12:27 -07:00
Pierre-Yves David
a74e4ee649 revsetbenchmark: allow comments ('#' prefix) in the revset input 2014-09-23 17:09:19 -07:00
Pierre-Yves David
250b8754d7 revsetbenchmark: make it clear that revsets may be read from stdin 2014-09-23 17:08:49 -07:00
Mike Edgar
919b082a9b contrib/synthrepo: pass options to ctx.diff as kwargs, not a dict 2014-09-12 21:38:52 -04:00
Mike Edgar
6431a1d631 contrib/synthrepo: only generate 2 parents if model contains merges
If `hg analyze` is run on a revision set which contains no merges, then
`hg synthesize` will raise IndexError trying to select from p2distance,
which will be empty.
2014-09-12 17:43:37 -04:00
Mads Kiilerich
d45e42f05e contrib: add OS X p4merge to mergetools.hgrc 2014-08-27 16:39:44 +02:00
Gregory Szorc
34df9cb908 revsetbenchmarks: add an additional roots() benchmark
The existing roots(x - y) revset only considered the most recent 100
revisions. This was a good start. But expanding it to the full history
of the repository can dramatically increase execution time and thus
constitutes a useful benchmark.
2014-09-07 11:33:22 -07:00
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