Mercurial > hg
annotate tests/test-convert-bzr-ghosts.t @ 31971:73e9328e5307
obsolescence: add test case D-3 for obsolescence markers exchange
About 3 years ago, in August 2014, the logic to select what markers to select on
push was ported from the evolve extension to Mercurial core. However, for some
unclear reasons, the tests for that logic were not ported alongside.
I realised it a couple of weeks ago while working on another push related issue.
I've made a clean up pass on the tests and they are now ready to integrate the
core test suite. This series of changesets do not change any logic. I just adds
test for logic that has been around for about 10 versions of Mercurial.
They are a patch for each test case. It makes it easier to review and postpone
one with documentation issues without rejecting the wholes series.
This patch introduce case D3: missing prune target (prune not in "pushed set")
Each test case comes it in own test file. It help parallelism and does not
introduce a significant overhead from having a single unified giant test file.
Here are timing to support this claim.
# Multiple test files version:
# run-tests.py --local -j 1 test-exchange-*.t
53.40s user 6.82s system 85% cpu 1:10.76 total
52.79s user 6.97s system 85% cpu 1:09.97 total
52.94s user 6.82s system 85% cpu 1:09.69 total
# Single test file version:
# run-tests.py --local -j 1 test-exchange-obsmarkers.t
52.97s user 6.85s system 85% cpu 1:10.10 total
52.64s user 6.79s system 85% cpu 1:09.63 total
53.70s user 7.00s system 85% cpu 1:11.17 total
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Mon, 10 Apr 2017 16:54:43 +0200 |
parents | 89872688893f |
children | 75be14993fda |
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 |
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
24 $ python ../../ghostcreator.py 'Commit with ghost revision' ghostrev |
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 |
16060
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
12515
diff
changeset
|
34 o 1@source "Commit with ghost revision" files: somefile |
12515
b6a784e39ad4
tests: unify test-convert-bzr-ghosts
Matt Mackall <mpm@selenic.com>
parents:
7058
diff
changeset
|
35 | |
16060
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
12515
diff
changeset
|
36 o 0@source "Initial layout setup" files: somefile |
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 .. |