author | Martin von Zweigbergk <martinvonz@google.com> |
Wed, 06 Feb 2019 22:32:50 -0800 | |
changeset 41610 | d683aca738cd |
parent 39707 | 5abc47d4ca6b |
child 42107 | 8890fce7c13d |
permissions | -rw-r--r-- |
31729
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
1 |
Require a destination |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
2 |
$ cat >> $HGRCPATH <<EOF |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
3 |
> [extensions] |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
4 |
> rebase = |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
5 |
> [commands] |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
6 |
> rebase.requiredest = True |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
7 |
> EOF |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
8 |
$ hg init repo |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
9 |
$ cd repo |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
10 |
$ echo a >> a |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
11 |
$ hg commit -qAm aa |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
12 |
$ echo b >> b |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
13 |
$ hg commit -qAm bb |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
14 |
$ hg up ".^" |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
15 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
16 |
$ echo c >> c |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
17 |
$ hg commit -qAm cc |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
18 |
$ hg rebase |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
19 |
abort: you must specify a destination |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
20 |
(use: hg rebase -d REV) |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
21 |
[255] |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
22 |
$ hg rebase -d 1 |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
23 |
rebasing 2:5db65b93a12b "cc" (tip) |
35393
4441705b7111
tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents:
35385
diff
changeset
|
24 |
saved backup bundle to $TESTTMP/repo/.hg/strip-backup/5db65b93a12b-4fb789ec-rebase.hg |
31729
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
25 |
$ hg rebase -d 0 -r . -q |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
26 |
$ HGPLAIN=1 hg rebase |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
27 |
rebasing 2:889b0bc6a730 "cc" (tip) |
35393
4441705b7111
tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents:
35385
diff
changeset
|
28 |
saved backup bundle to $TESTTMP/repo/.hg/strip-backup/889b0bc6a730-41ec4f81-rebase.hg |
31729
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
29 |
$ hg rebase -d 0 -r . -q |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
30 |
$ hg --config commands.rebase.requiredest=False rebase |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
31 |
rebasing 2:279de9495438 "cc" (tip) |
35393
4441705b7111
tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents:
35385
diff
changeset
|
32 |
saved backup bundle to $TESTTMP/repo/.hg/strip-backup/279de9495438-ab0a5128-rebase.hg |
31729
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
33 |
|
31730
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
34 |
Requiring dest should not break continue or other rebase options |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
35 |
$ hg up 1 -q |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
36 |
$ echo d >> c |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
37 |
$ hg commit -qAm dc |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
38 |
$ hg log -G -T '{rev} {desc}' |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
39 |
@ 3 dc |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
40 |
| |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
41 |
| o 2 cc |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
42 |
|/ |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
43 |
o 1 bb |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
44 |
| |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
45 |
o 0 aa |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
46 |
|
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
47 |
$ hg rebase -d 2 |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
48 |
rebasing 3:0537f6b50def "dc" (tip) |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
49 |
merging c |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
50 |
warning: conflicts while merging c! (edit, then use 'hg resolve --mark') |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
51 |
unresolved conflicts (see hg resolve, then hg rebase --continue) |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
52 |
[1] |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
53 |
$ echo d > c |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
54 |
$ hg resolve --mark --all |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
55 |
(no more unresolved files) |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
56 |
continue: hg rebase --continue |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
57 |
$ hg rebase --continue |
31731
b5afec71c1f9
rebase: allow destination-free continue and abort (issue5513)
Ryan McElroy <rmcelroy@fb.com>
parents:
31730
diff
changeset
|
58 |
rebasing 3:0537f6b50def "dc" (tip) |
35393
4441705b7111
tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents:
35385
diff
changeset
|
59 |
saved backup bundle to $TESTTMP/repo/.hg/strip-backup/0537f6b50def-be4c7386-rebase.hg |
31732
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
60 |
|
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
61 |
$ cd .. |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
62 |
|
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
63 |
Check rebase.requiredest interaction with pull --rebase |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
64 |
$ hg clone repo clone |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
65 |
updating to branch default |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
66 |
3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
67 |
$ cd repo |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
68 |
$ echo e > e |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
69 |
$ hg commit -qAm ee |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
70 |
$ cd .. |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
71 |
$ cd clone |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
72 |
$ echo f > f |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
73 |
$ hg commit -qAm ff |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
74 |
$ hg pull --rebase |
31733
ae6bab095c66
rebase: abort hg pull --rebase if rebase.requiredest is set (issue5514)
Ryan McElroy <rmcelroy@fb.com>
parents:
31732
diff
changeset
|
75 |
abort: rebase destination required by configuration |
ae6bab095c66
rebase: abort hg pull --rebase if rebase.requiredest is set (issue5514)
Ryan McElroy <rmcelroy@fb.com>
parents:
31732
diff
changeset
|
76 |
(use hg pull followed by hg rebase -d DEST) |
31732
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
77 |
[255] |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
78 |
|
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
79 |
Setup rebase with multiple destinations |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
80 |
|
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
81 |
$ cd $TESTTMP |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
82 |
|
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
83 |
$ cat >> $TESTTMP/maprevset.py <<EOF |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
84 |
> from __future__ import absolute_import |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
85 |
> from mercurial import registrar, revset, revsetlang, smartset |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
86 |
> revsetpredicate = registrar.revsetpredicate() |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
87 |
> cache = {} |
36272
164ed6d54fdf
tests: add b prefixes to test-rebase-dest.t
Augie Fackler <augie@google.com>
parents:
35709
diff
changeset
|
88 |
> @revsetpredicate(b'map') |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
89 |
> def map(repo, subset, x): |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
90 |
> """(set, mapping)""" |
36272
164ed6d54fdf
tests: add b prefixes to test-rebase-dest.t
Augie Fackler <augie@google.com>
parents:
35709
diff
changeset
|
91 |
> setarg, maparg = revsetlang.getargs(x, 2, 2, b'') |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
92 |
> rset = revset.getset(repo, smartset.fullreposet(repo), setarg) |
36272
164ed6d54fdf
tests: add b prefixes to test-rebase-dest.t
Augie Fackler <augie@google.com>
parents:
35709
diff
changeset
|
93 |
> mapstr = revsetlang.getstring(maparg, b'') |
164ed6d54fdf
tests: add b prefixes to test-rebase-dest.t
Augie Fackler <augie@google.com>
parents:
35709
diff
changeset
|
94 |
> map = dict(a.split(b':') for a in mapstr.split(b',')) |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
95 |
> rev = rset.first() |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
96 |
> desc = repo[rev].description() |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
97 |
> newdesc = map.get(desc) |
36272
164ed6d54fdf
tests: add b prefixes to test-rebase-dest.t
Augie Fackler <augie@google.com>
parents:
35709
diff
changeset
|
98 |
> if newdesc == b'null': |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
99 |
> revs = [-1] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
100 |
> else: |
36272
164ed6d54fdf
tests: add b prefixes to test-rebase-dest.t
Augie Fackler <augie@google.com>
parents:
35709
diff
changeset
|
101 |
> query = revsetlang.formatspec(b'desc(%s)', newdesc) |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
102 |
> revs = repo.revs(query) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
103 |
> return smartset.baseset(revs) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
104 |
> EOF |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
105 |
|
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
106 |
$ cat >> $HGRCPATH <<EOF |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
107 |
> [ui] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
108 |
> allowemptycommit=1 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
109 |
> [extensions] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
110 |
> drawdag=$TESTDIR/drawdag.py |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
111 |
> [phases] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
112 |
> publish=False |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
113 |
> [alias] |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
114 |
> tglog = log -G --template "{rev}: {node|short} {desc} {instabilities}" -r 'sort(all(), topo)' |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
115 |
> [extensions] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
116 |
> maprevset=$TESTTMP/maprevset.py |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
117 |
> [experimental] |
34865
a0100f34e20b
config: replace experimental.stabilization by experimental.evolution
Boris Feld <boris.feld@octobus.net>
parents:
34006
diff
changeset
|
118 |
> evolution=true |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
119 |
> EOF |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
120 |
|
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
121 |
$ rebasewithdag() { |
39707
5abc47d4ca6b
tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents:
36272
diff
changeset
|
122 |
> N=`"$PYTHON" -c "print($N+1)"` |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
123 |
> hg init repo$N && cd repo$N |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
124 |
> hg debugdrawdag |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
125 |
> hg rebase "$@" > _rebasetmp |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
126 |
> r=$? |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
127 |
> grep -v 'saved backup bundle' _rebasetmp |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
128 |
> [ $r -eq 0 ] && rm -f .hg/localtags && hg tglog |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
129 |
> cd .. |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
130 |
> return $r |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
131 |
> } |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
132 |
|
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
133 |
Destination resolves to an empty set: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
134 |
|
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
135 |
$ rebasewithdag -s B -d 'SRC - SRC' <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
136 |
> C |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
137 |
> | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
138 |
> B |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
139 |
> | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
140 |
> A |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
141 |
> EOS |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
142 |
nothing to rebase - empty destination |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
143 |
[1] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
144 |
|
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
145 |
Multiple destinations and --collapse are not compatible: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
146 |
|
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
147 |
$ rebasewithdag -s C+E -d 'SRC^^' --collapse <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
148 |
> C F |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
149 |
> | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
150 |
> B E |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
151 |
> | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
152 |
> A D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
153 |
> EOS |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
154 |
abort: --collapse does not work with multiple destinations |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
155 |
[255] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
156 |
|
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
157 |
Multiple destinations cannot be used with --base: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
158 |
|
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
159 |
$ rebasewithdag -b B+E -d 'SRC^^' --collapse <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
160 |
> B E |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
161 |
> | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
162 |
> A D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
163 |
> EOS |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
164 |
abort: unknown revision 'SRC'! |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
165 |
[255] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
166 |
|
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
167 |
Rebase to null should work: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
168 |
|
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
169 |
$ rebasewithdag -r A+C+D -d 'null' <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
170 |
> C D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
171 |
> | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
172 |
> A B |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
173 |
> EOS |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
174 |
already rebased 0:426bada5c675 "A" (A) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
175 |
already rebased 2:dc0947a82db8 "C" (C) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
176 |
rebasing 3:004dc1679908 "D" (D tip) |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
177 |
o 4: d8d8601abd5e D |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
178 |
|
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
179 |
o 2: dc0947a82db8 C |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
180 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
181 |
| o 1: fc2b737bb2e5 B |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
182 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
183 |
o 0: 426bada5c675 A |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
184 |
|
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
185 |
Destination resolves to multiple changesets: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
186 |
|
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
187 |
$ rebasewithdag -s B -d 'ALLSRC+SRC' <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
188 |
> C |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
189 |
> | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
190 |
> B |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
191 |
> | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
192 |
> Z |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
193 |
> EOS |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
194 |
abort: rebase destination for f0a671a46792 is not unique |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
195 |
[255] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
196 |
|
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
197 |
Destination is an ancestor of source: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
198 |
|
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
199 |
$ rebasewithdag -s B -d 'SRC' <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
200 |
> C |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
201 |
> | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
202 |
> B |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
203 |
> | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
204 |
> Z |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
205 |
> EOS |
34006 | 206 |
abort: source and destination form a cycle |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
207 |
[255] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
208 |
|
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
209 |
Switch roots: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
210 |
|
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
211 |
$ rebasewithdag -s 'all() - roots(all())' -d 'roots(all()) - ::SRC' <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
212 |
> C F |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
213 |
> | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
214 |
> B E |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
215 |
> | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
216 |
> A D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
217 |
> EOS |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
218 |
rebasing 2:112478962961 "B" (B) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
219 |
rebasing 4:26805aba1e60 "C" (C) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
220 |
rebasing 3:cd488e83d208 "E" (E) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
221 |
rebasing 5:0069ba24938a "F" (F tip) |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
222 |
o 9: d150ff263fc8 F |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
223 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
224 |
o 8: 66f30a1a2eab E |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
225 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
226 |
| o 7: 93db94ffae0e C |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
227 |
| | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
228 |
| o 6: d0071c3b0c88 B |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
229 |
| | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
230 |
| o 1: 058c1e1fb10a D |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
231 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
232 |
o 0: 426bada5c675 A |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
233 |
|
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
234 |
Different destinations for merge changesets with a same root: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
235 |
|
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
236 |
$ rebasewithdag -s B -d '((parents(SRC)-B-A)::) - (::ALLSRC)' <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
237 |
> C G |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
238 |
> |\| |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
239 |
> | F |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
240 |
> | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
241 |
> B E |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
242 |
> |\| |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
243 |
> A D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
244 |
> EOS |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
245 |
rebasing 3:a4256619d830 "B" (B) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
246 |
rebasing 6:8e139e245220 "C" (C tip) |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
247 |
o 8: 51e2ce92e06a C |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
248 |
|\ |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
249 |
| o 7: 2ed0c8546285 B |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
250 |
| |\ |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
251 |
o | | 5: 8fdb2c1feb20 G |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
252 |
| | | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
253 |
| | o 4: cd488e83d208 E |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
254 |
| | | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
255 |
o | | 2: a6661b868de9 F |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
256 |
/ / |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
257 |
| o 1: 058c1e1fb10a D |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
258 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
259 |
o 0: 426bada5c675 A |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
260 |
|
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
261 |
Move to a previous parent: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
262 |
|
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
263 |
$ rebasewithdag -s E+F+G -d 'SRC^^' <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
264 |
> H |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
265 |
> | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
266 |
> D G |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
267 |
> |/ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
268 |
> C F |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
269 |
> |/ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
270 |
> B E # E will be ignored, since E^^ is empty |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
271 |
> |/ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
272 |
> A |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
273 |
> EOS |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
274 |
rebasing 4:33441538d4aa "F" (F) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
275 |
rebasing 6:cf43ad9da869 "G" (G) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
276 |
rebasing 7:eef94f3b5f03 "H" (H tip) |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
277 |
o 10: b3d84c6666cf H |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
278 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
279 |
| o 5: f585351a92f8 D |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
280 |
|/ |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
281 |
o 3: 26805aba1e60 C |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
282 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
283 |
| o 9: f7c28a1a15e2 G |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
284 |
|/ |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
285 |
o 1: 112478962961 B |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
286 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
287 |
| o 8: 02aa697facf7 F |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
288 |
|/ |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
289 |
| o 2: 7fb047a69f22 E |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
290 |
|/ |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
291 |
o 0: 426bada5c675 A |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
292 |
|
34006 | 293 |
Source overlaps with destination: |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
294 |
|
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
295 |
$ rebasewithdag -s 'B+C+D' -d 'map(SRC, "B:C,C:D")' <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
296 |
> B C D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
297 |
> \|/ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
298 |
> A |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
299 |
> EOS |
34006 | 300 |
rebasing 2:dc0947a82db8 "C" (C) |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
301 |
rebasing 1:112478962961 "B" (B) |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
302 |
o 5: 5fe9935d5222 B |
34006 | 303 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
304 |
o 4: 12d20731b9e0 C |
34006 | 305 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
306 |
o 3: b18e25de2cf5 D |
34006 | 307 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
308 |
o 0: 426bada5c675 A |
34006 | 309 |
|
310 |
Detect cycles early: |
|
311 |
||
312 |
$ rebasewithdag -r 'all()-Z' -d 'map(SRC, "A:B,B:C,C:D,D:B")' <<'EOS' |
|
313 |
> A B C |
|
314 |
> \|/ |
|
315 |
> | D |
|
316 |
> |/ |
|
317 |
> Z |
|
318 |
> EOS |
|
319 |
abort: source and destination form a cycle |
|
320 |
[255] |
|
321 |
||
322 |
Detect source is ancestor of dest in runtime: |
|
323 |
||
324 |
$ rebasewithdag -r 'C+B' -d 'map(SRC, "C:B,B:D")' -q <<'EOS' |
|
325 |
> D |
|
326 |
> | |
|
327 |
> B C |
|
328 |
> \| |
|
329 |
> A |
|
330 |
> EOS |
|
331 |
abort: source is ancestor of destination |
|
332 |
[255] |
|
333 |
||
334 |
"Already rebased" fast path still works: |
|
335 |
||
336 |
$ rebasewithdag -r 'all()' -d 'SRC^' <<'EOS' |
|
337 |
> E F |
|
338 |
> /| | |
|
339 |
> B C D |
|
340 |
> \|/ |
|
341 |
> A |
|
342 |
> EOS |
|
343 |
already rebased 1:112478962961 "B" (B) |
|
344 |
already rebased 2:dc0947a82db8 "C" (C) |
|
345 |
already rebased 3:b18e25de2cf5 "D" (D) |
|
346 |
already rebased 4:312782b8f06e "E" (E) |
|
347 |
already rebased 5:ad6717a6a58e "F" (F tip) |
|
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
348 |
o 5: ad6717a6a58e F |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
349 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
350 |
o 3: b18e25de2cf5 D |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
351 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
352 |
| o 4: 312782b8f06e E |
34006 | 353 |
| |\ |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
354 |
+---o 2: dc0947a82db8 C |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
355 |
| | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
356 |
| o 1: 112478962961 B |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
357 |
|/ |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
358 |
o 0: 426bada5c675 A |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
359 |
|
34006 | 360 |
Massively rewrite the DAG: |
361 |
||
362 |
$ rebasewithdag -r 'all()' -d 'map(SRC, "A:I,I:null,H:A,B:J,J:C,C:H,D:E,F:G,G:K,K:D,E:B")' <<'EOS' |
|
363 |
> D G K |
|
364 |
> | | | |
|
365 |
> C F J |
|
366 |
> | | | |
|
367 |
> B E I |
|
368 |
> \| | |
|
369 |
> A H |
|
370 |
> EOS |
|
371 |
rebasing 4:701514e1408d "I" (I) |
|
372 |
rebasing 0:426bada5c675 "A" (A) |
|
373 |
rebasing 1:e7050b6e5048 "H" (H) |
|
374 |
rebasing 5:26805aba1e60 "C" (C) |
|
375 |
rebasing 7:cf89f86b485b "J" (J) |
|
376 |
rebasing 2:112478962961 "B" (B) |
|
377 |
rebasing 3:7fb047a69f22 "E" (E) |
|
378 |
rebasing 8:f585351a92f8 "D" (D) |
|
379 |
rebasing 10:ae41898d7875 "K" (K tip) |
|
380 |
rebasing 9:711f53bbef0b "G" (G) |
|
381 |
rebasing 6:64a8289d2492 "F" (F) |
|
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
382 |
o 21: 3735afb3713a F |
34006 | 383 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
384 |
o 20: 07698142d7a7 G |
34006 | 385 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
386 |
o 19: 33aba52e7e72 K |
34006 | 387 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
388 |
o 18: 9fdae89dc5a1 D |
34006 | 389 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
390 |
o 17: 277dda9a65ee E |
34006 | 391 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
392 |
o 16: 9c74fd8657ad B |
34006 | 393 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
394 |
o 15: 6527eb0688bb J |
34006 | 395 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
396 |
o 14: e94d655b928d C |
34006 | 397 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
398 |
o 13: 620d6d349459 H |
34006 | 399 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
400 |
o 12: a569a116758f A |
34006 | 401 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
402 |
o 11: 2bf1302f5c18 I |
34006 | 403 |
|
404 |
Resolve instability: |
|
405 |
||
406 |
$ rebasewithdag <<'EOF' -r 'orphan()-obsolete()' -d 'max((successors(max(roots(ALLSRC) & ::SRC)^)-obsolete())::)' |
|
407 |
> F2 |
|
408 |
> | |
|
409 |
> J E E2 |
|
410 |
> | |/ |
|
411 |
> I2 I | E3 |
|
412 |
> \| |/ |
|
413 |
> H | G |
|
414 |
> | | | |
|
415 |
> B2 D F |
|
416 |
> | |/ # rebase: B -> B2 |
|
417 |
> N C # amend: E -> E2 |
|
418 |
> | | # amend: E2 -> E3 |
|
419 |
> M B # rebase: F -> F2 |
|
420 |
> \| # amend: I -> I2 |
|
421 |
> A |
|
422 |
> EOF |
|
35709
1a09dad8b85a
evolution: report new unstable changesets
Martin von Zweigbergk <martinvonz@google.com>
parents:
35393
diff
changeset
|
423 |
6 new orphan changesets |
34006 | 424 |
rebasing 16:5c432343bf59 "J" (J tip) |
425 |
rebasing 3:26805aba1e60 "C" (C) |
|
426 |
rebasing 6:f585351a92f8 "D" (D) |
|
427 |
rebasing 10:ffebc37c5d0b "E3" (E3) |
|
428 |
rebasing 13:fb184bcfeee8 "F2" (F2) |
|
429 |
rebasing 11:dc838ab4c0da "G" (G) |
|
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
430 |
o 22: 174f63d574a8 G |
34006 | 431 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
432 |
o 21: c9d9fbe76705 F2 |
34006 | 433 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
434 |
o 20: 0a03c2ede755 E3 |
34006 | 435 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
436 |
o 19: 228d9d2541b1 D |
34006 | 437 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
438 |
o 18: cd856b400c95 C |
34006 | 439 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
440 |
o 17: 9148200c858c J |
34006 | 441 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
442 |
o 15: eb74780f5094 I2 |
34006 | 443 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
444 |
o 12: 78309edd643f H |
34006 | 445 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
446 |
o 5: 4b4531bd8e1d B2 |
34006 | 447 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
448 |
o 4: 337c285c272b N |
34006 | 449 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
450 |
o 2: 699bc4b6fa22 M |
34006 | 451 |
| |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
452 |
o 0: 426bada5c675 A |
34006 | 453 |