Mercurial > hg
annotate tests/test-rebase-dest.t @ 35089:69ea10d5b00c
hgweb: show obsolescence status of a commit
As with phases, spartan theme shows a simple "obsolete: yes" on its own line
(this allows replacing "yes" with something more useful in future, like output
of obsfate* template functions). Everywhere else a new "tag" is added to the
same line that has phase, branch, etc of a changeset; in gitweb and monoblue
the element has gray background, in paper and coal the element is gray with a
dashed underline.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Sat, 18 Nov 2017 12:04:08 +0800 |
parents | a0100f34e20b |
children | 3398603c5621 |
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] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
118 > rebase.multidest=true |
34865
a0100f34e20b
config: replace experimental.stabilization by experimental.evolution
Boris Feld <boris.feld@octobus.net>
parents:
34006
diff
changeset
|
119 > evolution=true |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
120 > EOF |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
121 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
122 $ rebasewithdag() { |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
123 > N=`$PYTHON -c "print($N+1)"` |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
124 > hg init repo$N && cd repo$N |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
125 > hg debugdrawdag |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
126 > hg rebase "$@" > _rebasetmp |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
127 > r=$? |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
128 > grep -v 'saved backup bundle' _rebasetmp |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
129 > [ $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
|
130 > cd .. |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
131 > return $r |
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 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
134 Destination resolves to an empty set: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
135 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
136 $ rebasewithdag -s B -d 'SRC - SRC' <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
137 > C |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
138 > | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
139 > B |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
140 > | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
141 > A |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
142 > EOS |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
143 nothing to rebase - empty destination |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
144 [1] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
145 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
146 Multiple destinations and --collapse are not compatible: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
147 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
148 $ rebasewithdag -s C+E -d 'SRC^^' --collapse <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
149 > C F |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
150 > | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
151 > B E |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
152 > | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
153 > A D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
154 > EOS |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
155 abort: --collapse does not work with multiple destinations |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
156 [255] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
157 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
158 Multiple destinations cannot be used with --base: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
159 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
160 $ rebasewithdag -b B+E -d 'SRC^^' --collapse <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
161 > B E |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
162 > | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
163 > A D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
164 > EOS |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
165 abort: unknown revision 'SRC'! |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
166 [255] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
167 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
168 Rebase to null should work: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
169 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
170 $ rebasewithdag -r A+C+D -d 'null' <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
171 > C D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
172 > | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
173 > A B |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
174 > EOS |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
175 already rebased 0:426bada5c675 "A" (A) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
176 already rebased 2:dc0947a82db8 "C" (C) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
177 rebasing 3:004dc1679908 "D" (D tip) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
178 o 4: D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
179 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
180 o 2: C |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
181 | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
182 | o 1: B |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
183 | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
184 o 0: A |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
185 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
186 Destination resolves to multiple changesets: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
187 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
188 $ rebasewithdag -s B -d 'ALLSRC+SRC' <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
189 > C |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
190 > | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
191 > B |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
192 > | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
193 > Z |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
194 > EOS |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
195 abort: rebase destination for f0a671a46792 is not unique |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
196 [255] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
197 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
198 Destination is an ancestor of source: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
199 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
200 $ rebasewithdag -s B -d 'SRC' <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
201 > C |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
202 > | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
203 > B |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
204 > | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
205 > Z |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
206 > EOS |
34006 | 207 abort: source and destination form a cycle |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
208 [255] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
209 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
210 Switch roots: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
211 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
212 $ 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
|
213 > C F |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
214 > | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
215 > B E |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
216 > | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
217 > A D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
218 > EOS |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
219 rebasing 2:112478962961 "B" (B) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
220 rebasing 4:26805aba1e60 "C" (C) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
221 rebasing 3:cd488e83d208 "E" (E) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
222 rebasing 5:0069ba24938a "F" (F tip) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
223 o 9: F |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
224 | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
225 o 8: E |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
226 | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
227 | o 7: C |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
228 | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
229 | o 6: B |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
230 | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
231 | o 1: D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
232 | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
233 o 0: A |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
234 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
235 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
|
236 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
237 $ 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
|
238 > C G |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
239 > |\| |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
240 > | F |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
241 > | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
242 > B E |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
243 > |\| |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
244 > A D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
245 > EOS |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
246 rebasing 3:a4256619d830 "B" (B) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
247 rebasing 6:8e139e245220 "C" (C tip) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
248 o 8: C |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
249 |\ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
250 | o 7: B |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
251 | |\ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
252 o | | 5: G |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
253 | | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
254 | | o 4: E |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
255 | | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
256 o | | 2: F |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
257 / / |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
258 | o 1: D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
259 | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
260 o 0: A |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
261 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
262 Move to a previous parent: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
263 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
264 $ rebasewithdag -s E+F+G -d 'SRC^^' <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
265 > H |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
266 > | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
267 > D G |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
268 > |/ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
269 > C F |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
270 > |/ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
271 > 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
|
272 > |/ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
273 > A |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
274 > EOS |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
275 rebasing 4:33441538d4aa "F" (F) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
276 rebasing 6:cf43ad9da869 "G" (G) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
277 rebasing 7:eef94f3b5f03 "H" (H tip) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
278 o 10: H |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
279 | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
280 | o 5: D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
281 |/ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
282 o 3: C |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
283 | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
284 | o 9: G |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
285 |/ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
286 o 1: B |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
287 | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
288 | o 8: F |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
289 |/ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
290 | o 2: E |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
291 |/ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
292 o 0: A |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
293 |
34006 | 294 Source overlaps with destination: |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
295 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
296 $ 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
|
297 > B C D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
298 > \|/ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
299 > A |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
300 > EOS |
34006 | 301 rebasing 2:dc0947a82db8 "C" (C) |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
302 rebasing 1:112478962961 "B" (B) |
34006 | 303 o 5: B |
304 | | |
305 o 4: C | |
306 | | |
307 o 3: D | |
308 | | |
309 o 0: A | |
310 | |
311 Detect cycles early: | |
312 | |
313 $ rebasewithdag -r 'all()-Z' -d 'map(SRC, "A:B,B:C,C:D,D:B")' <<'EOS' | |
314 > A B C | |
315 > \|/ | |
316 > | D | |
317 > |/ | |
318 > Z | |
319 > EOS | |
320 abort: source and destination form a cycle | |
321 [255] | |
322 | |
323 Detect source is ancestor of dest in runtime: | |
324 | |
325 $ rebasewithdag -r 'C+B' -d 'map(SRC, "C:B,B:D")' -q <<'EOS' | |
326 > D | |
327 > | | |
328 > B C | |
329 > \| | |
330 > A | |
331 > EOS | |
332 abort: source is ancestor of destination | |
333 [255] | |
334 | |
335 "Already rebased" fast path still works: | |
336 | |
337 $ rebasewithdag -r 'all()' -d 'SRC^' <<'EOS' | |
338 > E F | |
339 > /| | | |
340 > B C D | |
341 > \|/ | |
342 > A | |
343 > EOS | |
344 already rebased 1:112478962961 "B" (B) | |
345 already rebased 2:dc0947a82db8 "C" (C) | |
346 already rebased 3:b18e25de2cf5 "D" (D) | |
347 already rebased 4:312782b8f06e "E" (E) | |
348 already rebased 5:ad6717a6a58e "F" (F tip) | |
349 o 5: F | |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
350 | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
351 o 3: D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
352 | |
34006 | 353 | o 4: E |
354 | |\ | |
355 +---o 2: C | |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
356 | | |
34006 | 357 | o 1: B |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
358 |/ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
359 o 0: A |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
360 |
34006 | 361 Massively rewrite the DAG: |
362 | |
363 $ 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' | |
364 > D G K | |
365 > | | | | |
366 > C F J | |
367 > | | | | |
368 > B E I | |
369 > \| | | |
370 > A H | |
371 > EOS | |
372 rebasing 4:701514e1408d "I" (I) | |
373 rebasing 0:426bada5c675 "A" (A) | |
374 rebasing 1:e7050b6e5048 "H" (H) | |
375 rebasing 5:26805aba1e60 "C" (C) | |
376 rebasing 7:cf89f86b485b "J" (J) | |
377 rebasing 2:112478962961 "B" (B) | |
378 rebasing 3:7fb047a69f22 "E" (E) | |
379 rebasing 8:f585351a92f8 "D" (D) | |
380 rebasing 10:ae41898d7875 "K" (K tip) | |
381 rebasing 9:711f53bbef0b "G" (G) | |
382 rebasing 6:64a8289d2492 "F" (F) | |
383 o 21: F | |
384 | | |
385 o 20: G | |
386 | | |
387 o 19: K | |
388 | | |
389 o 18: D | |
390 | | |
391 o 17: E | |
392 | | |
393 o 16: B | |
394 | | |
395 o 15: J | |
396 | | |
397 o 14: C | |
398 | | |
399 o 13: H | |
400 | | |
401 o 12: A | |
402 | | |
403 o 11: I | |
404 | |
405 Resolve instability: | |
406 | |
407 $ rebasewithdag <<'EOF' -r 'orphan()-obsolete()' -d 'max((successors(max(roots(ALLSRC) & ::SRC)^)-obsolete())::)' | |
408 > F2 | |
409 > | | |
410 > J E E2 | |
411 > | |/ | |
412 > I2 I | E3 | |
413 > \| |/ | |
414 > H | G | |
415 > | | | | |
416 > B2 D F | |
417 > | |/ # rebase: B -> B2 | |
418 > N C # amend: E -> E2 | |
419 > | | # amend: E2 -> E3 | |
420 > M B # rebase: F -> F2 | |
421 > \| # amend: I -> I2 | |
422 > A | |
423 > EOF | |
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) | |
430 o 22: G | |
431 | | |
432 o 21: F2 | |
433 | | |
434 o 20: E3 | |
435 | | |
436 o 19: D | |
437 | | |
438 o 18: C | |
439 | | |
440 o 17: J | |
441 | | |
442 o 15: I2 | |
443 | | |
444 o 12: H | |
445 | | |
446 o 5: B2 | |
447 | | |
448 o 4: N | |
449 | | |
450 o 2: M | |
451 | | |
452 o 0: A | |
453 |