Mercurial > hg
annotate tests/test-convert-bzr-merges.t @ 33377:5d63e5f40bea
revset: define successors revset
This revset returns all successors, including transit nodes and the source
nodes (to be consistent with existing revsets like "ancestors").
To filter out transit nodes, use `successors(X)-obsolete()`.
To filter out divergent case, use `successors(X)-divergent()-obsolete()`.
The revset could be useful to define rebase destination, like:
`max(successors(BASE)-divergent()-obsolete())`. The `max` is to deal with
splits.
There are other implementations where `successors` returns just one level of
successors, and `allsuccessors` returns everything. I think `successors`
returning all successors by default is more user friendly. We have seen
cases in production where people use 1-level `successors` while they really
want `allsuccessors`. So it seems better to just have one single revset
returning all successors by default to avoid user errors.
In the future we might want to add `depth` keyword argument to it and for
other revsets like `ancestors` etc. Or even build some flexible indexing
syntax [1] to satisfy people having the depth limit requirement.
[1]: https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-July/101140.html
author | Jun Wu <quark@fb.com> |
---|---|
date | Mon, 10 Jul 2017 10:56:40 -0700 |
parents | 89872688893f |
children | 30a027c0e327 |
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 |
89872688893f
tests: move '#require bzr' into .t files
Gregory Szorc <gregory.szorc@gmail.com>
parents:
16913
diff
changeset
|
2 |
12516
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
3 N.B. bzr 1.13 has a bug that breaks this test. If you see this |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
4 test fail, check your bzr version. Upgrading to bzr 1.13.1 |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
5 should fix it. |
7053 | 6 |
12516
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
7 $ . "$TESTDIR/bzr-definitions" |
8084
5b3fee9c1f4d
Add comment about this test failing under bzr 1.13 due to a bug in bzr.
Greg Ward <greg-hg@gerg.ca>
parents:
7604
diff
changeset
|
8 |
12516
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
9 test multiple merges at once |
7053 | 10 |
12516
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
11 $ mkdir test-multimerge |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
12 $ cd test-multimerge |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
13 $ bzr init -q source |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
14 $ cd source |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
15 $ echo content > file |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
16 $ bzr add -q file |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
17 $ bzr commit -q -m 'Initial add' |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
18 $ cd .. |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
19 $ bzr branch -q source source-branch1 |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
20 $ cd source-branch1 |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
21 $ echo morecontent >> file |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
22 $ echo evenmorecontent > file-branch1 |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
23 $ bzr add -q file-branch1 |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
24 $ bzr commit -q -m 'Added branch1 file' |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
25 $ cd ../source |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
26 $ sleep 1 |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
27 $ echo content > file-parent |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
28 $ bzr add -q file-parent |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
29 $ bzr commit -q -m 'Added parent file' |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
30 $ cd .. |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
31 $ bzr branch -q source source-branch2 |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
32 $ cd source-branch2 |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
33 $ echo somecontent > file-branch2 |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
34 $ bzr add -q file-branch2 |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
35 $ bzr commit -q -m 'Added brach2 file' |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
36 $ sleep 1 |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
37 $ cd ../source |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
38 $ bzr merge -q ../source-branch1 |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
39 $ bzr merge -q --force ../source-branch2 |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
40 $ bzr commit -q -m 'Merged branches' |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
41 $ cd .. |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
42 $ hg convert --datesort source source-hg |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
43 initializing destination source-hg repository |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
44 scanning source... |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
45 sorting... |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
46 converting... |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
47 4 Initial add |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
48 3 Added branch1 file |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
49 2 Added parent file |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
50 1 Added brach2 file |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
51 0 Merged branches |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
52 $ glog -R source-hg |
16060
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
12516
diff
changeset
|
53 o 5@source "(octopus merge fixup)" files: |
12516
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
54 |\ |
16060
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
12516
diff
changeset
|
55 | o 4@source "Merged branches" files: file-branch2 |
12516
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
56 | |\ |
16060
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
12516
diff
changeset
|
57 o---+ 3@source-branch2 "Added brach2 file" files: file-branch2 |
12516
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
58 / / |
16060
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
12516
diff
changeset
|
59 | o 2@source "Added parent file" files: file-parent |
12516
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
60 | | |
16060
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
12516
diff
changeset
|
61 o | 1@source-branch1 "Added branch1 file" files: file file-branch1 |
12516
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
62 |/ |
16060
f84dda152a55
convert/bzr: convert all branches (issue3229) (BC)
Patrick Mezard <pmezard@gmail.com>
parents:
12516
diff
changeset
|
63 o 0@source "Initial add" files: file |
12516
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
64 |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
65 $ manifest source-hg tip |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
66 % manifest of tip |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
67 644 file |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
68 644 file-branch1 |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
69 644 file-branch2 |
90efbd1a2a56
tests: unify test-convert-bzr-merges
Matt Mackall <mpm@selenic.com>
parents:
8084
diff
changeset
|
70 644 file-parent |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16060
diff
changeset
|
71 |
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16060
diff
changeset
|
72 $ cd .. |