Mercurial > hg
annotate tests/test-convert-bzr-ghosts.t @ 41247:a89b20a49c13
rust-cpython: using MissingAncestors from Python code
As precedently done with LazyAncestors on cpython.rs, we test for the
presence of the 'rustext' module.
incrementalmissingrevs() has two callers within the Mercurial core:
`setdiscovery.partialdiscovery` and the `only()` revset.
This move shows a significant discovery performance improvement
in cases where the baseline is slow: using perfdiscovery on the PyPy
repos, prepared with `contrib/discovery-helper <repo> 50 100`, we
get averaged medians of 403ms with the Rust version vs 742ms without
(about 45% better).
But there are still indications that performance can be worse in cases
the baseline is fast, possibly due to the conversion from Python to
Rust and back becoming the bottleneck. We could measure this on
mozilla-central in cases were the delta is just a few changesets.
This requires confirmation, but if that's the reason, then an
upcoming `partialdiscovery` fully in Rust should solve the problem.
Differential Revision: https://phab.mercurial-scm.org/D5551
author | Georges Racinet <georges.racinet@octobus.net> |
---|---|
date | Fri, 30 Nov 2018 14:35:57 +0100 |
parents | 5abc47d4ca6b |
children | 26127236b229 |
rev | line source |
---|---|
26066
89872688893f
tests: move '#require bzr' into .t files
Gregory Szorc <gregory.szorc@gmail.com>
parents:
16913
diff
changeset
|
1 #require bzr |
7053 | 2 |
12515
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
3 $ . "$TESTDIR/bzr-definitions" |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
4 $ cat > ghostcreator.py <<EOF |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
5 > import sys |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
6 > from bzrlib import workingtree |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
7 > wt = workingtree.WorkingTree.open('.') |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
8 > |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
9 > message, ghostrev = sys.argv[1:] |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
10 > wt.set_parent_ids(wt.get_parent_ids() + [ghostrev]) |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
11 > wt.commit(message) |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
12 > EOF |
7053 | 13 |
12515
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
14 ghost revisions |
7053 | 15 |
12515
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
16 $ mkdir test-ghost-revisions |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
17 $ cd test-ghost-revisions |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
18 $ bzr init -q source |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
19 $ cd source |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
20 $ echo content > somefile |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
21 $ bzr add -q somefile |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
22 $ bzr commit -q -m 'Initial layout setup' |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
23 $ echo morecontent >> somefile |
39707
5abc47d4ca6b
tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents:
39222
diff
changeset
|
24 $ "$PYTHON" ../../ghostcreator.py 'Commit with ghost revision' ghostrev |
12515
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
25 $ cd .. |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
26 $ hg convert source source-hg |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
27 initializing destination source-hg repository |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
28 scanning source... |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
29 sorting... |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
30 converting... |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
31 1 Initial layout setup |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
32 0 Commit with ghost revision |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
33 $ glog -R source-hg |
39222
7a88643bc0ef
tests: show added/modified/removed files when logging repos converted from bzr
Matt Harbison <matt_harbison@yahoo.com>
parents:
32940
diff
changeset
|
34 o 1@source "Commit with ghost revision" files+: [], files-: [], files: [somefile] |
12515
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
35 | |
39222
7a88643bc0ef
tests: show added/modified/removed files when logging repos converted from bzr
Matt Harbison <matt_harbison@yahoo.com>
parents:
32940
diff
changeset
|
36 o 0@source "Initial layout setup" files+: [somefile], files-: [], files: [] |
12515
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
37 |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16060
diff
changeset
|
38 |
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16060
diff
changeset
|
39 $ cd .. |