Mercurial > hg
annotate tests/test-rebase-dest.t @ 35325:71edd38c4bb4
overlayworkingctx: add ``tomemctx()``
Differential Revision: https://phab.mercurial-scm.org/D1242
author | Phil Cohen <phillco@fb.com> |
---|---|
date | Thu, 07 Dec 2017 22:26:07 -0800 |
parents | 3398603c5621 |
children | 469b06b4c3ca |
rev | line source |
---|---|
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) |
33332
3b7cb3d17137
rebase: use scmutil.cleanupnodes (issue5606) (BC)
Jun Wu <quark@fb.com>
parents:
31733
diff
changeset
|
24 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/5db65b93a12b-4fb789ec-rebase.hg (glob) |
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) |
33332
3b7cb3d17137
rebase: use scmutil.cleanupnodes (issue5606) (BC)
Jun Wu <quark@fb.com>
parents:
31733
diff
changeset
|
28 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/889b0bc6a730-41ec4f81-rebase.hg (glob) |
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) |
33332
3b7cb3d17137
rebase: use scmutil.cleanupnodes (issue5606) (BC)
Jun Wu <quark@fb.com>
parents:
31733
diff
changeset
|
32 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/279de9495438-ab0a5128-rebase.hg (glob) |
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) |
33332
3b7cb3d17137
rebase: use scmutil.cleanupnodes (issue5606) (BC)
Jun Wu <quark@fb.com>
parents:
31733
diff
changeset
|
59 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/0537f6b50def-be4c7386-rebase.hg (glob) |
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 = {} |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
88 > @revsetpredicate('map') |
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)""" |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
91 > setarg, maparg = revsetlang.getargs(x, 2, 2, '') |
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) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
93 > mapstr = revsetlang.getstring(maparg, '') |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
94 > map = dict(a.split(':') for a in mapstr.split(',')) |
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) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
98 > if newdesc == 'null': |
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: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
101 > query = revsetlang.formatspec('desc(%s)', newdesc) |
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] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
114 > tglog = log -G --template "{rev}: {desc} {instabilities}" -r 'sort(all(), topo)' |
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() { |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
122 > N=`$PYTHON -c "print($N+1)"` |
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) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
177 o 4: D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
178 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
179 o 2: C |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
180 | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
181 | o 1: B |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
182 | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
183 o 0: A |
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) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
222 o 9: F |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
223 | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
224 o 8: E |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
225 | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
226 | o 7: C |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
227 | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
228 | o 6: B |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
229 | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
230 | o 1: D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
231 | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
232 o 0: A |
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) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
247 o 8: C |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
248 |\ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
249 | o 7: B |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
250 | |\ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
251 o | | 5: G |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
252 | | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
253 | | o 4: E |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
254 | | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
255 o | | 2: F |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
256 / / |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
257 | o 1: D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
258 | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
259 o 0: A |
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) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
277 o 10: H |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
278 | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
279 | o 5: D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
280 |/ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
281 o 3: C |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
282 | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
283 | o 9: G |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
284 |/ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
285 o 1: B |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
286 | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
287 | o 8: F |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
288 |/ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
289 | o 2: E |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
290 |/ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
291 o 0: A |
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) |
34006 | 302 o 5: B |
303 | | |
304 o 4: C | |
305 | | |
306 o 3: D | |
307 | | |
308 o 0: A | |
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) | |
348 o 5: F | |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
349 | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
350 o 3: D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
351 | |
34006 | 352 | o 4: E |
353 | |\ | |
354 +---o 2: C | |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
355 | | |
34006 | 356 | o 1: B |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
357 |/ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
358 o 0: A |
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) | |
382 o 21: F | |
383 | | |
384 o 20: G | |
385 | | |
386 o 19: K | |
387 | | |
388 o 18: D | |
389 | | |
390 o 17: E | |
391 | | |
392 o 16: B | |
393 | | |
394 o 15: J | |
395 | | |
396 o 14: C | |
397 | | |
398 o 13: H | |
399 | | |
400 o 12: A | |
401 | | |
402 o 11: I | |
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 | |
423 rebasing 16:5c432343bf59 "J" (J tip) | |
424 rebasing 3:26805aba1e60 "C" (C) | |
425 rebasing 6:f585351a92f8 "D" (D) | |
426 rebasing 10:ffebc37c5d0b "E3" (E3) | |
427 rebasing 13:fb184bcfeee8 "F2" (F2) | |
428 rebasing 11:dc838ab4c0da "G" (G) | |
429 o 22: G | |
430 | | |
431 o 21: F2 | |
432 | | |
433 o 20: E3 | |
434 | | |
435 o 19: D | |
436 | | |
437 o 18: C | |
438 | | |
439 o 17: J | |
440 | | |
441 o 15: I2 | |
442 | | |
443 o 12: H | |
444 | | |
445 o 5: B2 | |
446 | | |
447 o 4: N | |
448 | | |
449 o 2: M | |
450 | | |
451 o 0: A | |
452 |