Show More
@@ -1,76 +1,148 | |||
|
1 | #!/bin/sh | |
|
2 | ||
|
3 | . $TESTDIR/helpers.sh | |
|
1 | $ cat >> $HGRCPATH <<EOF | |
|
2 | > [extensions] | |
|
3 | > graphlog= | |
|
4 | > rebase= | |
|
5 | > | |
|
6 | > [alias] | |
|
7 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" | |
|
8 | > EOF | |
|
4 | 9 | |
|
5 | echo "[extensions]" >> $HGRCPATH | |
|
6 | echo "graphlog=" >> $HGRCPATH | |
|
7 | echo "rebase=" >> $HGRCPATH | |
|
10 | ||
|
11 | $ hg init a | |
|
12 | $ cd a | |
|
13 | ||
|
14 | $ echo c1 > common | |
|
15 | $ hg add common | |
|
16 | $ hg ci -m C1 | |
|
8 | 17 | |
|
9 | createrepo() { | |
|
10 | rm -rf repo | |
|
11 | hg init repo | |
|
12 | cd repo | |
|
13 | echo 'c1' >common | |
|
14 | hg add common | |
|
15 | hg commit -d '0 0' -m "C1" | |
|
18 | $ echo c2 >> common | |
|
19 | $ hg ci -m C2 | |
|
20 | ||
|
21 | $ echo c3 >> common | |
|
22 | $ hg ci -m C3 | |
|
23 | ||
|
24 | $ hg up -q -C 1 | |
|
25 | ||
|
26 | $ echo l1 >> extra | |
|
27 | $ hg add extra | |
|
28 | $ hg ci -m L1 | |
|
29 | created new head | |
|
30 | ||
|
31 | $ sed -e 's/c2/l2/' common > common.new | |
|
32 | $ mv common.new common | |
|
33 | $ hg ci -m L2 | |
|
16 | 34 | |
|
17 | echo 'c2' >>common | |
|
18 | hg commit -d '1 0' -m "C2" | |
|
35 | $ hg tglog | |
|
36 | @ 4: 'L2' | |
|
37 | | | |
|
38 | o 3: 'L1' | |
|
39 | | | |
|
40 | | o 2: 'C3' | |
|
41 | |/ | |
|
42 | o 1: 'C2' | |
|
43 | | | |
|
44 | o 0: 'C1' | |
|
45 | ||
|
19 | 46 | |
|
20 | echo 'c3' >>common | |
|
21 | hg commit -d '2 0' -m "C3" | |
|
47 | Conflicting rebase: | |
|
22 | 48 | |
|
23 | hg update -C 1 | |
|
24 | echo 'l1' >>extra | |
|
25 | hg add extra | |
|
26 | hg commit -d '3 0' -m "L1" | |
|
49 | $ hg rebase -s 3 -d 2 | |
|
50 | merging common | |
|
51 | warning: conflicts during merge. | |
|
52 | merging common failed! | |
|
53 | abort: fix unresolved conflicts with hg resolve then run hg rebase --continue | |
|
54 | [255] | |
|
55 | ||
|
56 | Abort: | |
|
57 | ||
|
58 | $ hg rebase --abort | |
|
59 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
60 | rebase aborted | |
|
27 | 61 | |
|
28 | sed -e 's/c2/l2/' common > common.new | |
|
29 | mv common.new common | |
|
30 | hg commit -d '4 0' -m "L2" | |
|
31 | } | |
|
32 | ||
|
33 | echo | |
|
34 | createrepo > /dev/null 2>&1 | |
|
35 | hg --config extensions.hgext.graphlog= glog --template '{rev}: {desc}\n' | |
|
62 | $ hg tglog | |
|
63 | @ 4: 'L2' | |
|
64 | | | |
|
65 | o 3: 'L1' | |
|
66 | | | |
|
67 | | o 2: 'C3' | |
|
68 | |/ | |
|
69 | o 1: 'C2' | |
|
70 | | | |
|
71 | o 0: 'C1' | |
|
72 | ||
|
73 | $ cd .. | |
|
36 | 74 | |
|
37 | echo | |
|
38 | echo '% Conflicting rebase' | |
|
39 | hg --config extensions.hgext.rebase= rebase -s 3 -d 2 | cleanrebase | |
|
75 | ||
|
76 | Constrcut new repo: | |
|
77 | ||
|
78 | $ hg init b | |
|
79 | $ cd b | |
|
80 | ||
|
81 | $ echo a > a | |
|
82 | $ hg ci -Am A | |
|
83 | adding a | |
|
84 | ||
|
85 | $ echo b > b | |
|
86 | $ hg ci -Am B | |
|
87 | adding b | |
|
40 | 88 | |
|
41 | echo | |
|
42 | echo '% Abort' | |
|
43 | hg --config extensions.hgext.rebase= rebase --abort | cleanrebase | |
|
89 | $ echo c > c | |
|
90 | $ hg ci -Am C | |
|
91 | adding c | |
|
92 | ||
|
93 | $ hg up -q 0 | |
|
44 | 94 | |
|
45 | hg --config extensions.hgext.graphlog= glog --template '{rev}: {desc}\n' | |
|
95 | $ echo b > b | |
|
96 | $ hg ci -Am 'B bis' | |
|
97 | adding b | |
|
98 | created new head | |
|
99 | ||
|
100 | $ echo c1 > c | |
|
101 | $ hg ci -Am C1 | |
|
102 | adding c | |
|
103 | ||
|
104 | Rebase and abort without generating new changesets: | |
|
46 | 105 | |
|
47 | createrepo() { | |
|
48 | rm -rf repo | |
|
49 | hg init repo | |
|
50 | cd repo | |
|
51 | echo "a">a | |
|
52 | hg ci -A -m'A' | |
|
53 | echo "b">b | |
|
54 | hg ci -A -m'B' | |
|
55 | echo "c">c | |
|
56 | hg ci -A -m'C' | |
|
57 | hg up 0 | |
|
58 | echo "b">b | |
|
59 | hg ci -A -m'B bis' | |
|
60 | echo "c1">c | |
|
61 | hg ci -A -m'C1' | |
|
62 | } | |
|
63 | echo | |
|
64 | echo '% Rebase and abort without generating new changesets' | |
|
106 | $ hg tglog | |
|
107 | @ 4: 'C1' | |
|
108 | | | |
|
109 | o 3: 'B bis' | |
|
110 | | | |
|
111 | | o 2: 'C' | |
|
112 | | | | |
|
113 | | o 1: 'B' | |
|
114 | |/ | |
|
115 | o 0: 'A' | |
|
116 | ||
|
117 | $ hg rebase -b 4 -d 2 | |
|
118 | merging c | |
|
119 | warning: conflicts during merge. | |
|
120 | merging c failed! | |
|
121 | abort: fix unresolved conflicts with hg resolve then run hg rebase --continue | |
|
122 | [255] | |
|
65 | 123 | |
|
66 | echo | |
|
67 | createrepo > /dev/null 2>&1 | |
|
68 | hg --config extensions.hgext.graphlog= glog --template '{rev}:{desc|short}\n' | |
|
69 | ||
|
70 | hg --config extensions.hgext.rebase= rebase -b 4 -d 2 | cleanrebase | |
|
124 | $ hg tglog | |
|
125 | @ 4: 'C1' | |
|
126 | | | |
|
127 | o 3: 'B bis' | |
|
128 | | | |
|
129 | | @ 2: 'C' | |
|
130 | | | | |
|
131 | | o 1: 'B' | |
|
132 | |/ | |
|
133 | o 0: 'A' | |
|
134 | ||
|
135 | $ hg rebase -a | |
|
136 | rebase aborted | |
|
71 | 137 | |
|
72 | hg --config extensions.hgext.graphlog= glog --template '{rev}:{desc|short}\n' | |
|
73 | ||
|
74 | hg rebase -a | cleanrebase | |
|
75 | hg glog --template '{rev}:{desc|short}\n' | |
|
76 | ||
|
138 | $ hg tglog | |
|
139 | @ 4: 'C1' | |
|
140 | | | |
|
141 | o 3: 'B bis' | |
|
142 | | | |
|
143 | | o 2: 'C' | |
|
144 | | | | |
|
145 | | o 1: 'B' | |
|
146 | |/ | |
|
147 | o 0: 'A' | |
|
148 |
@@ -1,106 +1,257 | |||
|
1 | #!/bin/sh | |
|
1 | $ cat >> $HGRCPATH <<EOF | |
|
2 | > [extensions] | |
|
3 | > graphlog= | |
|
4 | > rebase= | |
|
5 | > | |
|
6 | > [alias] | |
|
7 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" | |
|
8 | > theads = heads --template "{rev}: '{desc}' {branches}\n" | |
|
9 | > EOF | |
|
2 | 10 | |
|
3 | . $TESTDIR/helpers.sh | |
|
11 | $ hg init a | |
|
12 | $ cd a | |
|
4 | 13 | |
|
5 | createrepo() { | |
|
6 | rm -rf repo | |
|
7 | hg init repo | |
|
8 | cd repo | |
|
14 | $ echo a > a | |
|
15 | $ hg ci -Am A | |
|
16 | adding a | |
|
9 | 17 | |
|
10 | echo "a" > a | |
|
11 | hg commit -d '0 0' -A -m 'A' | |
|
18 | $ hg branch branch1 | |
|
19 | marked working directory as branch branch1 | |
|
20 | $ hg ci -m 'branch1' | |
|
21 | ||
|
22 | $ echo b > b | |
|
23 | $ hg ci -Am B | |
|
24 | adding b | |
|
25 | ||
|
26 | $ hg up -q 0 | |
|
12 | 27 | |
|
13 |
|
|
|
14 | hg commit -d '1 0' -m 'Branch1' | |
|
28 | $ hg branch branch2 | |
|
29 | marked working directory as branch branch2 | |
|
30 | $ hg ci -m 'branch2' | |
|
15 | 31 | |
|
16 |
|
|
|
17 | hg commit -A -d '2 0' -m 'B' | |
|
32 | $ echo c > C | |
|
33 | $ hg ci -Am C | |
|
34 | adding C | |
|
35 | ||
|
36 | $ hg up -q 2 | |
|
18 | 37 | |
|
19 | hg up 0 | |
|
20 | hg branch branch2 | |
|
21 | hg commit -d '3 0' -m 'Branch2' | |
|
38 | $ hg branch -f branch2 | |
|
39 | marked working directory as branch branch2 | |
|
40 | $ echo d > d | |
|
41 | $ hg ci -Am D | |
|
42 | adding d | |
|
43 | created new head | |
|
22 | 44 | |
|
23 |
|
|
|
24 | hg commit -A -d '4 0' -m 'C' | |
|
45 | $ echo e > e | |
|
46 | $ hg ci -Am E | |
|
47 | adding e | |
|
48 | ||
|
49 | $ hg update default | |
|
50 | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved | |
|
51 | ||
|
52 | $ hg branch branch3 | |
|
53 | marked working directory as branch branch3 | |
|
54 | $ hg ci -m 'branch3' | |
|
25 | 55 | |
|
26 | hg up 2 | |
|
27 | hg branch -f branch2 | |
|
28 | echo "d" > d | |
|
29 | hg commit -A -d '5 0' -m 'D' | |
|
56 | $ echo f > f | |
|
57 | $ hg ci -Am F | |
|
58 | adding f | |
|
59 | ||
|
60 | $ cd .. | |
|
30 | 61 | |
|
31 | echo "e" > e | |
|
32 | hg commit -A -d '6 0' -m 'E' | |
|
62 | ||
|
63 | Rebase part of branch2 (5-6) onto branch3 (8): | |
|
33 | 64 | |
|
34 | hg update default | |
|
65 | $ hg clone -q -u . a a1 | |
|
66 | $ cd a1 | |
|
35 | 67 | |
|
36 | hg branch branch3 | |
|
37 | hg commit -d '7 0' -m 'Branch3' | |
|
38 | ||
|
39 | echo "f" > f | |
|
40 | hg commit -A -d '8 0' -m 'F' | |
|
41 | } | |
|
68 | $ hg tglog | |
|
69 | @ 8: 'F' branch3 | |
|
70 | | | |
|
71 | o 7: 'branch3' branch3 | |
|
72 | | | |
|
73 | | o 6: 'E' branch2 | |
|
74 | | | | |
|
75 | | o 5: 'D' branch2 | |
|
76 | | | | |
|
77 | | | o 4: 'C' branch2 | |
|
78 | | | | | |
|
79 | +---o 3: 'branch2' branch2 | |
|
80 | | | | |
|
81 | | o 2: 'B' branch1 | |
|
82 | | | | |
|
83 | | o 1: 'branch1' branch1 | |
|
84 | |/ | |
|
85 | o 0: 'A' | |
|
86 | ||
|
87 | $ hg branches | |
|
88 | branch3 8:05b64c4ca2d8 | |
|
89 | branch2 6:b410fbec727a | |
|
90 | branch1 2:9d931918fcf7 (inactive) | |
|
91 | default 0:1994f17a630e (inactive) | |
|
42 | 92 | |
|
43 | echo | |
|
44 | createrepo > /dev/null 2>&1 | |
|
45 | hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n' | |
|
93 | $ hg theads | |
|
94 | 8: 'F' branch3 | |
|
95 | 6: 'E' branch2 | |
|
96 | 4: 'C' branch2 | |
|
97 | 2: 'B' branch1 | |
|
98 | 0: 'A' | |
|
99 | ||
|
100 | $ hg rebase --detach -s 5 -d 8 | |
|
101 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
46 | 102 | |
|
47 | echo | |
|
48 | echo '% Branches' | |
|
49 | hg branches | |
|
103 | $ hg branches | |
|
104 | branch3 8:c1d4b9719987 | |
|
105 | branch2 4:1be2b203ae5e | |
|
106 | branch1 2:9d931918fcf7 | |
|
107 | default 0:1994f17a630e (inactive) | |
|
108 | ||
|
109 | $ hg theads | |
|
110 | 8: 'E' branch3 | |
|
111 | 4: 'C' branch2 | |
|
112 | 2: 'B' branch1 | |
|
113 | 0: 'A' | |
|
50 | 114 | |
|
51 | echo | |
|
52 | echo '% Heads' | |
|
53 | hg heads --template '{rev}:{node|short} {desc} branch: {branches}\n' | |
|
115 | $ hg tglog | |
|
116 | @ 8: 'E' branch3 | |
|
117 | | | |
|
118 | o 7: 'D' branch3 | |
|
119 | | | |
|
120 | o 6: 'F' branch3 | |
|
121 | | | |
|
122 | o 5: 'branch3' branch3 | |
|
123 | | | |
|
124 | | o 4: 'C' branch2 | |
|
125 | | | | |
|
126 | | o 3: 'branch2' branch2 | |
|
127 | |/ | |
|
128 | | o 2: 'B' branch1 | |
|
129 | | | | |
|
130 | | o 1: 'branch1' branch1 | |
|
131 | |/ | |
|
132 | o 0: 'A' | |
|
133 | ||
|
134 | $ cd .. | |
|
54 | 135 | |
|
55 | echo | |
|
56 |
|
|
|
57 | hg --config extensions.hgext.rebase= rebase --detach -s 5 -d 8 | hidebackup | |
|
136 | ||
|
137 | Rebase head of branch3 (8) onto branch2 (6): | |
|
58 | 138 | |
|
59 | echo | |
|
60 | echo '% Branches' | |
|
61 | hg branches | |
|
139 | $ hg clone -q -u . a a2 | |
|
140 | $ cd a2 | |
|
62 | 141 | |
|
63 | echo | |
|
64 | echo '% Heads' | |
|
65 | hg heads --template '{rev}:{node|short} {desc} branch: {branches}\n' | |
|
66 | ||
|
67 | echo | |
|
68 | hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n' | |
|
142 | $ hg tglog | |
|
143 | @ 8: 'F' branch3 | |
|
144 | | | |
|
145 | o 7: 'branch3' branch3 | |
|
146 | | | |
|
147 | | o 6: 'E' branch2 | |
|
148 | | | | |
|
149 | | o 5: 'D' branch2 | |
|
150 | | | | |
|
151 | | | o 4: 'C' branch2 | |
|
152 | | | | | |
|
153 | +---o 3: 'branch2' branch2 | |
|
154 | | | | |
|
155 | | o 2: 'B' branch1 | |
|
156 | | | | |
|
157 | | o 1: 'branch1' branch1 | |
|
158 | |/ | |
|
159 | o 0: 'A' | |
|
160 | ||
|
161 | $ hg rebase --detach -s 8 -d 6 | |
|
162 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
69 | 163 | |
|
70 | echo | |
|
71 | echo '% Rebase head of branch3 (8) onto branch2 (6)' | |
|
72 | createrepo > /dev/null 2>&1 | |
|
73 | hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n' | |
|
164 | $ hg branches | |
|
165 | branch2 8:e1e80ed73210 | |
|
166 | branch3 7:75fd7b643dce | |
|
167 | branch1 2:9d931918fcf7 (inactive) | |
|
168 | default 0:1994f17a630e (inactive) | |
|
74 | 169 | |
|
75 | hg --config extensions.hgext.rebase= rebase --detach -s 8 -d 6 | hidebackup | |
|
170 | $ hg theads | |
|
171 | 8: 'F' branch2 | |
|
172 | 7: 'branch3' branch3 | |
|
173 | 4: 'C' branch2 | |
|
174 | 2: 'B' branch1 | |
|
175 | 0: 'A' | |
|
76 | 176 | |
|
77 | echo | |
|
78 | echo '% Branches' | |
|
79 | hg branches | |
|
177 | $ hg tglog | |
|
178 | @ 8: 'F' branch2 | |
|
179 | | | |
|
180 | | o 7: 'branch3' branch3 | |
|
181 | | | | |
|
182 | o | 6: 'E' branch2 | |
|
183 | | | | |
|
184 | o | 5: 'D' branch2 | |
|
185 | | | | |
|
186 | | | o 4: 'C' branch2 | |
|
187 | | | | | |
|
188 | | | o 3: 'branch2' branch2 | |
|
189 | | |/ | |
|
190 | o | 2: 'B' branch1 | |
|
191 | | | | |
|
192 | o | 1: 'branch1' branch1 | |
|
193 | |/ | |
|
194 | o 0: 'A' | |
|
195 | ||
|
196 | $ hg verify -q | |
|
80 | 197 | |
|
81 | echo | |
|
82 | echo '% Heads' | |
|
83 | hg heads --template '{rev}:{node|short} {desc} branch: {branches}\n' | |
|
198 | $ cd .. | |
|
199 | ||
|
84 | 200 | |
|
85 | echo | |
|
86 | hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n' | |
|
87 | hg verify -q | |
|
201 | Rebase entire branch3 (7-8) onto branch2 (6): | |
|
202 | ||
|
203 | $ hg clone -q -u . a a3 | |
|
204 | $ cd a3 | |
|
88 | 205 | |
|
89 | echo | |
|
90 | echo '% Rebase entire branch3 (7-8) onto branch2 (6)' | |
|
91 | createrepo > /dev/null 2>&1 | |
|
92 | hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n' | |
|
93 | ||
|
94 | hg --config extensions.hgext.rebase= rebase --detach -s 7 -d 6 | hidebackup | |
|
206 | $ hg tglog | |
|
207 | @ 8: 'F' branch3 | |
|
208 | | | |
|
209 | o 7: 'branch3' branch3 | |
|
210 | | | |
|
211 | | o 6: 'E' branch2 | |
|
212 | | | | |
|
213 | | o 5: 'D' branch2 | |
|
214 | | | | |
|
215 | | | o 4: 'C' branch2 | |
|
216 | | | | | |
|
217 | +---o 3: 'branch2' branch2 | |
|
218 | | | | |
|
219 | | o 2: 'B' branch1 | |
|
220 | | | | |
|
221 | | o 1: 'branch1' branch1 | |
|
222 | |/ | |
|
223 | o 0: 'A' | |
|
224 | ||
|
225 | $ hg rebase --detach -s 7 -d 6 | |
|
226 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
95 | 227 | |
|
96 | echo | |
|
97 | echo '% Branches' | |
|
98 | hg branches | |
|
228 | $ hg branches | |
|
229 | branch2 7:e1e80ed73210 | |
|
230 | branch1 2:9d931918fcf7 (inactive) | |
|
231 | default 0:1994f17a630e (inactive) | |
|
232 | ||
|
233 | $ hg theads | |
|
234 | 7: 'F' branch2 | |
|
235 | 4: 'C' branch2 | |
|
236 | 2: 'B' branch1 | |
|
237 | 0: 'A' | |
|
99 | 238 | |
|
100 | echo | |
|
101 | echo '% Heads' | |
|
102 | hg heads --template '{rev}:{node|short} {desc} branch: {branches}\n' | |
|
239 | $ hg tglog | |
|
240 | @ 7: 'F' branch2 | |
|
241 | | | |
|
242 | o 6: 'E' branch2 | |
|
243 | | | |
|
244 | o 5: 'D' branch2 | |
|
245 | | | |
|
246 | | o 4: 'C' branch2 | |
|
247 | | | | |
|
248 | | o 3: 'branch2' branch2 | |
|
249 | | | | |
|
250 | o | 2: 'B' branch1 | |
|
251 | | | | |
|
252 | o | 1: 'branch1' branch1 | |
|
253 | |/ | |
|
254 | o 0: 'A' | |
|
255 | ||
|
256 | $ hg verify -q | |
|
103 | 257 | |
|
104 | echo | |
|
105 | hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n' | |
|
106 | hg verify -q |
@@ -1,70 +1,142 | |||
|
1 | #!/bin/sh | |
|
2 | ||
|
3 | . $TESTDIR/helpers.sh | |
|
1 | $ cat >> $HGRCPATH <<EOF | |
|
2 | > [extensions] | |
|
3 | > graphlog= | |
|
4 | > rebase= | |
|
5 | > | |
|
6 | > [alias] | |
|
7 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" | |
|
8 | > EOF | |
|
4 | 9 | |
|
5 | echo "[extensions]" >> $HGRCPATH | |
|
6 | echo "graphlog=" >> $HGRCPATH | |
|
7 | echo "rebase=" >> $HGRCPATH | |
|
10 | ||
|
11 | $ hg init a | |
|
12 | $ cd a | |
|
13 | ||
|
14 | $ echo A > A | |
|
15 | $ hg add A | |
|
16 | $ hg ci -m A | |
|
8 | 17 | |
|
9 | BASE=`pwd` | |
|
18 | $ echo 'B' > B | |
|
19 | $ hg add B | |
|
20 | $ hg ci -m B | |
|
21 | ||
|
22 | $ echo C >> A | |
|
23 | $ hg ci -m C | |
|
10 | 24 | |
|
11 | addcommit () { | |
|
12 | echo $1 > $1 | |
|
13 | hg add $1 | |
|
14 | hg commit -d "${2} 0" -m $1 | |
|
15 | } | |
|
25 | $ hg up -q -C 0 | |
|
26 | ||
|
27 | $ echo D >> A | |
|
28 | $ hg ci -m D | |
|
29 | created new head | |
|
30 | ||
|
31 | $ echo E > E | |
|
32 | $ hg add E | |
|
33 | $ hg ci -m E | |
|
16 | 34 | |
|
17 | commit () { | |
|
18 | hg commit -d "${2} 0" -m $1 | |
|
19 | } | |
|
35 | $ hg up -q -C 0 | |
|
36 | ||
|
37 | $ hg branch 'notdefault' | |
|
38 | marked working directory as branch notdefault | |
|
39 | $ echo F >> A | |
|
40 | $ hg ci -m F | |
|
41 | ||
|
42 | $ cd .. | |
|
43 | ||
|
44 | ||
|
45 | Rebasing B onto E - check keep: | |
|
46 | ||
|
47 | $ hg clone -q -u . a a1 | |
|
48 | $ cd a1 | |
|
20 | 49 | |
|
21 | createrepo () { | |
|
22 | cd $BASE | |
|
23 | rm -rf a | |
|
24 | hg init a | |
|
25 | cd a | |
|
26 | addcommit "A" 0 | |
|
27 | addcommit "B" 1 | |
|
28 | echo "C" >> A | |
|
29 | commit "C" 2 | |
|
50 | $ hg tglog | |
|
51 | @ 5: 'F' notdefault | |
|
52 | | | |
|
53 | | o 4: 'E' | |
|
54 | | | | |
|
55 | | o 3: 'D' | |
|
56 | |/ | |
|
57 | | o 2: 'C' | |
|
58 | | | | |
|
59 | | o 1: 'B' | |
|
60 | |/ | |
|
61 | o 0: 'A' | |
|
62 | ||
|
63 | $ hg rebase -s 1 -d 4 --keep | |
|
64 | merging A | |
|
65 | warning: conflicts during merge. | |
|
66 | merging A failed! | |
|
67 | abort: fix unresolved conflicts with hg resolve then run hg rebase --continue | |
|
68 | [255] | |
|
30 | 69 | |
|
31 | hg update -C 0 | |
|
32 | echo "D" >> A | |
|
33 | commit "D" 3 | |
|
34 | addcommit "E" 4 | |
|
70 | Solve the conflict and go on: | |
|
35 | 71 | |
|
36 | hg update -C 0 | |
|
37 | hg branch 'notdefault' | |
|
38 | echo "F" >> A | |
|
39 | commit "F" 5 | |
|
40 | } | |
|
72 | $ echo 'conflict solved' > A | |
|
73 | $ rm A.orig | |
|
74 | $ hg resolve -m A | |
|
75 | $ hg rebase --continue | |
|
41 | 76 | |
|
42 | echo | |
|
43 | echo "% - Rebasing B onto E - check keep" | |
|
44 | createrepo > /dev/null 2>&1 | |
|
45 | hg glog --template '{rev}:{desc}:{branches}\n' | |
|
46 | hg rebase -s 1 -d 4 --keep | hidebackup | |
|
77 | $ hg tglog | |
|
78 | @ 7: 'C' | |
|
79 | | | |
|
80 | o 6: 'B' | |
|
81 | | | |
|
82 | | o 5: 'F' notdefault | |
|
83 | | | | |
|
84 | o | 4: 'E' | |
|
85 | | | | |
|
86 | o | 3: 'D' | |
|
87 | |/ | |
|
88 | | o 2: 'C' | |
|
89 | | | | |
|
90 | | o 1: 'B' | |
|
91 | |/ | |
|
92 | o 0: 'A' | |
|
93 | ||
|
94 | $ cd .. | |
|
95 | ||
|
96 | ||
|
97 | Rebase F onto E - check keepbranches: | |
|
98 | ||
|
99 | $ hg clone -q -u . a a2 | |
|
100 | $ cd a2 | |
|
47 | 101 | |
|
48 | echo | |
|
49 | echo "% - Solve the conflict and go on" | |
|
50 | echo 'conflict solved' > A | |
|
51 | rm A.orig | |
|
52 | hg resolve -m A | |
|
53 | hg rebase --continue | hidebackup | |
|
54 | hg glog --template '{rev}:{desc}:{branches}\n' | |
|
102 | $ hg tglog | |
|
103 | @ 5: 'F' notdefault | |
|
104 | | | |
|
105 | | o 4: 'E' | |
|
106 | | | | |
|
107 | | o 3: 'D' | |
|
108 | |/ | |
|
109 | | o 2: 'C' | |
|
110 | | | | |
|
111 | | o 1: 'B' | |
|
112 | |/ | |
|
113 | o 0: 'A' | |
|
114 | ||
|
115 | $ hg rebase -s 5 -d 4 --keepbranches | |
|
116 | merging A | |
|
117 | warning: conflicts during merge. | |
|
118 | merging A failed! | |
|
119 | abort: fix unresolved conflicts with hg resolve then run hg rebase --continue | |
|
120 | [255] | |
|
55 | 121 | |
|
56 | echo | |
|
57 | echo "% - Rebase F onto E - check keepbranches" | |
|
58 | createrepo > /dev/null 2>&1 | |
|
59 | hg glog --template '{rev}:{desc}:{branches}\n' | |
|
60 | hg rebase -s 5 -d 4 --keepbranches | hidebackup | |
|
122 | Solve the conflict and go on: | |
|
123 | ||
|
124 | $ echo 'conflict solved' > A | |
|
125 | $ rm A.orig | |
|
126 | $ hg resolve -m A | |
|
127 | $ hg rebase --continue | |
|
128 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
61 | 129 | |
|
62 | echo | |
|
63 | echo "% - Solve the conflict and go on" | |
|
64 | echo 'conflict solved' > A | |
|
65 | rm A.orig | |
|
66 | hg resolve -m A | |
|
67 | hg rebase --continue 2>&1 | hidebackup | |
|
68 | hg glog --template '{rev}:{desc}:{branches}\n' | |
|
69 | ||
|
70 | exit 0 | |
|
130 | $ hg tglog | |
|
131 | @ 5: 'F' notdefault | |
|
132 | | | |
|
133 | o 4: 'E' | |
|
134 | | | |
|
135 | o 3: 'D' | |
|
136 | | | |
|
137 | | o 2: 'C' | |
|
138 | | | | |
|
139 | | o 1: 'B' | |
|
140 | |/ | |
|
141 | o 0: 'A' | |
|
142 |
This diff has been collapsed as it changes many lines, (552 lines changed) Show them Hide them | |||
@@ -1,177 +1,441 | |||
|
1 | #!/bin/sh | |
|
2 | ||
|
3 | . $TESTDIR/helpers.sh | |
|
1 | $ cat >> $HGRCPATH <<EOF | |
|
2 | > [extensions] | |
|
3 | > graphlog= | |
|
4 | > rebase= | |
|
5 | > | |
|
6 | > [alias] | |
|
7 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" | |
|
8 | > EOF | |
|
4 | 9 | |
|
5 | echo "[extensions]" >> $HGRCPATH | |
|
6 | echo "graphlog=" >> $HGRCPATH | |
|
7 | echo "rebase=" >> $HGRCPATH | |
|
10 | Create repo a: | |
|
8 | 11 | |
|
9 | BASE=`pwd` | |
|
12 | $ hg init a | |
|
13 | $ cd a | |
|
10 | 14 | |
|
11 | addcommit () { | |
|
12 | echo $1 > $1 | |
|
13 | hg add $1 | |
|
14 | hg commit -d "${2} 0" -m $1 | |
|
15 | } | |
|
15 | $ echo A > A | |
|
16 | $ hg ci -Am A | |
|
17 | adding A | |
|
18 | $ echo B > B | |
|
19 | $ hg ci -Am B | |
|
20 | adding B | |
|
21 | $ echo C > C | |
|
22 | $ hg ci -Am C | |
|
23 | adding C | |
|
24 | $ echo D > D | |
|
25 | $ hg ci -Am D | |
|
26 | adding D | |
|
27 | ||
|
28 | $ hg up -q -C 0 | |
|
16 | 29 | |
|
17 | commit () { | |
|
18 | hg commit -d "${2} 0" -m $1 | |
|
19 | } | |
|
30 | $ echo E > E | |
|
31 | $ hg ci -Am E | |
|
32 | adding E | |
|
33 | created new head | |
|
34 | ||
|
35 | $ hg up -q -C 0 | |
|
36 | ||
|
37 | $ echo F > F | |
|
38 | $ hg ci -Am F | |
|
39 | adding F | |
|
40 | created new head | |
|
41 | ||
|
42 | $ hg merge -r 4 | |
|
43 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
44 | (branch merge, don't forget to commit) | |
|
45 | $ hg ci -m G | |
|
46 | ||
|
47 | $ hg up -q -C 5 | |
|
48 | ||
|
49 | $ echo H > H | |
|
50 | $ hg ci -Am H | |
|
51 | adding H | |
|
52 | created new head | |
|
20 | 53 | |
|
21 | createrepo () { | |
|
22 | cd $BASE | |
|
23 | rm -rf a | |
|
24 | hg init a | |
|
25 | cd a | |
|
26 | addcommit "A" 0 | |
|
27 | addcommit "B" 1 | |
|
28 | addcommit "C" 2 | |
|
29 | addcommit "D" 3 | |
|
54 | $ hg tglog | |
|
55 | @ 7: 'H' | |
|
56 | | | |
|
57 | | o 6: 'G' | |
|
58 | |/| | |
|
59 | o | 5: 'F' | |
|
60 | | | | |
|
61 | | o 4: 'E' | |
|
62 | |/ | |
|
63 | | o 3: 'D' | |
|
64 | | | | |
|
65 | | o 2: 'C' | |
|
66 | | | | |
|
67 | | o 1: 'B' | |
|
68 | |/ | |
|
69 | o 0: 'A' | |
|
70 | ||
|
71 | $ cd .. | |
|
72 | ||
|
73 | ||
|
74 | Rebasing B onto H: | |
|
75 | ||
|
76 | $ hg clone -q -u 3 a a1 | |
|
77 | $ cd a1 | |
|
78 | ||
|
79 | $ hg rebase --collapse --keepbranches | |
|
80 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
30 | 81 | |
|
31 | hg update -C 0 | |
|
32 | addcommit "E" 4 | |
|
33 | ||
|
34 | hg update -C 0 | |
|
35 | addcommit "F" 5 | |
|
82 | $ hg tglog | |
|
83 | @ 5: 'Collapsed revision | |
|
84 | | * B | |
|
85 | | * C | |
|
86 | | * D' | |
|
87 | o 4: 'H' | |
|
88 | | | |
|
89 | | o 3: 'G' | |
|
90 | |/| | |
|
91 | o | 2: 'F' | |
|
92 | | | | |
|
93 | | o 1: 'E' | |
|
94 | |/ | |
|
95 | o 0: 'A' | |
|
96 | ||
|
97 | $ hg manifest | |
|
98 | A | |
|
99 | B | |
|
100 | C | |
|
101 | D | |
|
102 | F | |
|
103 | H | |
|
36 | 104 | |
|
37 | hg merge -r 4 | |
|
38 | commit "G" 6 | |
|
105 | $ cd .. | |
|
39 | 106 | |
|
40 | hg update -C 5 | |
|
41 | addcommit "H" 7 | |
|
42 | } | |
|
107 | ||
|
108 | Rebasing G onto H: | |
|
43 | 109 | |
|
44 | createrepo > /dev/null 2>&1 | |
|
45 | hg glog --template '{rev}: {desc}\n' | |
|
46 | echo '% Rebasing B onto H' | |
|
47 | hg up -C 3 | |
|
48 | hg rebase --collapse --keepbranches | hidebackup | |
|
49 | hg glog --template '{rev}: {desc}\n' | |
|
50 | echo "Expected A, B, C, D, F, H" | |
|
51 | hg manifest | |
|
110 | $ hg clone -q -u . a a2 | |
|
111 | $ cd a2 | |
|
112 | ||
|
113 | $ hg rebase --base 6 --collapse | |
|
114 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
52 | 115 | |
|
53 | createrepo > /dev/null 2>&1 | |
|
54 | echo | |
|
55 | echo '% Rebasing G onto H' | |
|
56 | hg rebase --base 6 --collapse | hidebackup | |
|
57 | hg glog --template '{rev}: {desc}\n' | |
|
58 | echo "Expected A, E, F, H" | |
|
59 | hg manifest | |
|
116 | $ hg tglog | |
|
117 | @ 6: 'Collapsed revision | |
|
118 | | * E | |
|
119 | | * G' | |
|
120 | o 5: 'H' | |
|
121 | | | |
|
122 | o 4: 'F' | |
|
123 | | | |
|
124 | | o 3: 'D' | |
|
125 | | | | |
|
126 | | o 2: 'C' | |
|
127 | | | | |
|
128 | | o 1: 'B' | |
|
129 | |/ | |
|
130 | o 0: 'A' | |
|
131 | ||
|
132 | $ hg manifest | |
|
133 | A | |
|
134 | E | |
|
135 | F | |
|
136 | H | |
|
137 | ||
|
138 | $ cd .. | |
|
139 | ||
|
140 | ||
|
141 | Create repo b: | |
|
142 | ||
|
143 | $ hg init b | |
|
144 | $ cd b | |
|
145 | ||
|
146 | $ echo A > A | |
|
147 | $ hg ci -Am A | |
|
148 | adding A | |
|
149 | $ echo B > B | |
|
150 | $ hg ci -Am B | |
|
151 | adding B | |
|
152 | ||
|
153 | $ hg up -q 0 | |
|
154 | ||
|
155 | $ echo C > C | |
|
156 | $ hg ci -Am C | |
|
157 | adding C | |
|
158 | created new head | |
|
159 | ||
|
160 | $ hg merge | |
|
161 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
162 | (branch merge, don't forget to commit) | |
|
60 | 163 | |
|
61 | createrepocomplex () { | |
|
62 | cd $BASE | |
|
63 | rm -rf a | |
|
64 | hg init a | |
|
65 | cd a | |
|
66 | addcommit "A" 0 | |
|
67 | addcommit "B" 1 | |
|
164 | $ echo D > D | |
|
165 | $ hg ci -Am D | |
|
166 | adding D | |
|
167 | ||
|
168 | $ hg up -q 1 | |
|
169 | ||
|
170 | $ echo E > E | |
|
171 | $ hg ci -Am E | |
|
172 | adding E | |
|
173 | created new head | |
|
68 | 174 | |
|
69 | hg up 0 | |
|
70 | addcommit "C" 2 | |
|
71 | hg merge | |
|
72 | commit "D" 3 | |
|
175 | $ echo F > F | |
|
176 | $ hg ci -Am F | |
|
177 | adding F | |
|
178 | ||
|
179 | $ hg merge | |
|
180 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
181 | (branch merge, don't forget to commit) | |
|
182 | $ hg ci -m G | |
|
183 | ||
|
184 | $ hg up -q 0 | |
|
185 | ||
|
186 | $ echo H > H | |
|
187 | $ hg ci -Am H | |
|
188 | adding H | |
|
189 | created new head | |
|
73 | 190 | |
|
74 | hg up 1 | |
|
75 | addcommit "E" 4 | |
|
76 | ||
|
77 | addcommit "F" 5 | |
|
78 | ||
|
79 | hg merge | |
|
80 | commit "G" 6 | |
|
191 | $ hg tglog | |
|
192 | @ 7: 'H' | |
|
193 | | | |
|
194 | | o 6: 'G' | |
|
195 | | |\ | |
|
196 | | | o 5: 'F' | |
|
197 | | | | | |
|
198 | | | o 4: 'E' | |
|
199 | | | | | |
|
200 | | o | 3: 'D' | |
|
201 | | |\| | |
|
202 | | o | 2: 'C' | |
|
203 | |/ / | |
|
204 | | o 1: 'B' | |
|
205 | |/ | |
|
206 | o 0: 'A' | |
|
207 | ||
|
208 | $ cd .. | |
|
81 | 209 | |
|
82 | hg up 0 | |
|
83 | addcommit "H" 7 | |
|
84 | } | |
|
210 | ||
|
211 | Rebase and collapse - more than one external (fail): | |
|
212 | ||
|
213 | $ hg clone -q -u . b b1 | |
|
214 | $ cd b1 | |
|
85 | 215 | |
|
86 | echo | |
|
87 | createrepocomplex > /dev/null 2>&1 | |
|
88 | hg glog --template '{rev}: {desc}\n' | |
|
216 | $ hg rebase -s 2 --collapse | |
|
217 | abort: unable to collapse, there is more than one external parent | |
|
218 | [255] | |
|
219 | ||
|
220 | Rebase and collapse - E onto H: | |
|
89 | 221 | |
|
90 | echo | |
|
91 | echo '% Rebase and collapse - more than one external (fail)' | |
|
92 | hg rebase -s 2 --collapse | |
|
222 | $ hg rebase -s 4 --collapse | |
|
223 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
93 | 224 | |
|
94 | echo | |
|
95 | echo '% Rebase and collapse - E onto H' | |
|
96 | hg rebase -s 4 --collapse | hidebackup | |
|
97 | hg glog --template '{rev}: {desc}\n' | |
|
98 | echo "Expected A, B, C, E, F, H" | |
|
99 | hg manifest | |
|
225 | $ hg tglog | |
|
226 | @ 5: 'Collapsed revision | |
|
227 | |\ * E | |
|
228 | | | * F | |
|
229 | | | * G' | |
|
230 | | o 4: 'H' | |
|
231 | | | | |
|
232 | o | 3: 'D' | |
|
233 | |\ \ | |
|
234 | | o | 2: 'C' | |
|
235 | | |/ | |
|
236 | o / 1: 'B' | |
|
237 | |/ | |
|
238 | o 0: 'A' | |
|
239 | ||
|
240 | $ hg manifest | |
|
241 | A | |
|
242 | B | |
|
243 | C | |
|
244 | D | |
|
245 | E | |
|
246 | F | |
|
247 | H | |
|
100 | 248 | |
|
101 | createrepocomplex () { | |
|
102 | cd $BASE | |
|
103 | rm -rf a | |
|
104 | hg init a | |
|
105 | cd a | |
|
106 | addcommit "A" 0 | |
|
107 | addcommit "B" 1 | |
|
249 | $ cd .. | |
|
250 | ||
|
251 | ||
|
252 | Create repo c: | |
|
253 | ||
|
254 | $ hg init c | |
|
255 | $ cd c | |
|
256 | ||
|
257 | $ echo A > A | |
|
258 | $ hg ci -Am A | |
|
259 | adding A | |
|
260 | $ echo B > B | |
|
261 | $ hg ci -Am B | |
|
262 | adding B | |
|
263 | ||
|
264 | $ hg up -q 0 | |
|
265 | ||
|
266 | $ echo C > C | |
|
267 | $ hg ci -Am C | |
|
268 | adding C | |
|
269 | created new head | |
|
270 | ||
|
271 | $ hg merge | |
|
272 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
273 | (branch merge, don't forget to commit) | |
|
108 | 274 | |
|
109 | hg up 0 | |
|
110 | addcommit "C" 2 | |
|
111 | hg merge | |
|
112 | commit "D" 3 | |
|
275 | $ echo D > D | |
|
276 | $ hg ci -Am D | |
|
277 | adding D | |
|
278 | ||
|
279 | $ hg up -q 1 | |
|
113 | 280 | |
|
114 | hg up 1 | |
|
115 | addcommit "E" 4 | |
|
116 | ||
|
117 | echo "F" > E | |
|
118 | commit "F" 5 | |
|
281 | $ echo E > E | |
|
282 | $ hg ci -Am E | |
|
283 | adding E | |
|
284 | created new head | |
|
285 | $ echo F > E | |
|
286 | $ hg ci -m 'F' | |
|
287 | ||
|
288 | $ echo G > G | |
|
289 | $ hg ci -Am G | |
|
290 | adding G | |
|
291 | ||
|
292 | $ hg merge | |
|
293 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
294 | (branch merge, don't forget to commit) | |
|
295 | ||
|
296 | $ hg ci -m H | |
|
297 | ||
|
298 | $ hg up -q 0 | |
|
119 | 299 | |
|
120 | addcommit "G" 6 | |
|
121 | ||
|
122 | hg merge | |
|
123 | commit "H" 7 | |
|
300 | $ echo I > I | |
|
301 | $ hg ci -Am I | |
|
302 | adding I | |
|
303 | created new head | |
|
124 | 304 | |
|
125 | hg up 0 | |
|
126 | addcommit "I" 8 | |
|
127 | } | |
|
305 | $ hg tglog | |
|
306 | @ 8: 'I' | |
|
307 | | | |
|
308 | | o 7: 'H' | |
|
309 | | |\ | |
|
310 | | | o 6: 'G' | |
|
311 | | | | | |
|
312 | | | o 5: 'F' | |
|
313 | | | | | |
|
314 | | | o 4: 'E' | |
|
315 | | | | | |
|
316 | | o | 3: 'D' | |
|
317 | | |\| | |
|
318 | | o | 2: 'C' | |
|
319 | |/ / | |
|
320 | | o 1: 'B' | |
|
321 | |/ | |
|
322 | o 0: 'A' | |
|
323 | ||
|
324 | $ cd .. | |
|
128 | 325 | |
|
129 | echo | |
|
130 | createrepocomplex > /dev/null 2>&1 | |
|
131 | hg glog --template '{rev}: {desc}\n' | |
|
326 | ||
|
327 | Rebase and collapse - E onto I: | |
|
328 | ||
|
329 | $ hg clone -q -u . c c1 | |
|
330 | $ cd c1 | |
|
132 | 331 | |
|
133 | echo | |
|
134 | echo '% Rebase and collapse - E onto I' | |
|
135 | hg rebase -s 4 --collapse | hidebackup | |
|
136 | ||
|
137 | hg glog --template '{rev}: {desc}\n' | |
|
138 | ||
|
139 | echo "Expected A, B, C, E, G, I" | |
|
140 | hg manifest | |
|
332 | $ hg rebase -s 4 --collapse | |
|
333 | merging E | |
|
334 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
141 | 335 | |
|
142 | echo 'Cat E:' | |
|
143 | cat E | |
|
336 | $ hg tglog | |
|
337 | @ 5: 'Collapsed revision | |
|
338 | |\ * E | |
|
339 | | | * F | |
|
340 | | | * G | |
|
341 | | | * H' | |
|
342 | | o 4: 'I' | |
|
343 | | | | |
|
344 | o | 3: 'D' | |
|
345 | |\ \ | |
|
346 | | o | 2: 'C' | |
|
347 | | |/ | |
|
348 | o / 1: 'B' | |
|
349 | |/ | |
|
350 | o 0: 'A' | |
|
351 | ||
|
352 | $ hg manifest | |
|
353 | A | |
|
354 | B | |
|
355 | C | |
|
356 | D | |
|
357 | E | |
|
358 | G | |
|
359 | I | |
|
144 | 360 | |
|
145 | createrepocomplex () { | |
|
146 | cd $BASE | |
|
147 | rm -rf a | |
|
148 | hg init a | |
|
149 | cd a | |
|
150 | addcommit "A" 0 | |
|
151 | addcommit "B" 1 | |
|
361 | $ cat E | |
|
362 | F | |
|
363 | ||
|
364 | $ cd .. | |
|
365 | ||
|
366 | ||
|
367 | Create repo d: | |
|
368 | ||
|
369 | $ hg init d | |
|
370 | $ cd d | |
|
152 | 371 | |
|
153 | addcommit "C" 2 | |
|
154 | hg up 1 | |
|
372 | $ echo A > A | |
|
373 | $ hg ci -Am A | |
|
374 | adding A | |
|
375 | $ echo B > B | |
|
376 | $ hg ci -Am B | |
|
377 | adding B | |
|
378 | $ echo C > C | |
|
379 | $ hg ci -Am C | |
|
380 | adding C | |
|
381 | ||
|
382 | $ hg up -q 1 | |
|
155 | 383 | |
|
156 | addcommit "D" 3 | |
|
157 | ||
|
158 | hg merge | |
|
159 | commit "E" 4 | |
|
384 | $ echo D > D | |
|
385 | $ hg ci -Am D | |
|
386 | adding D | |
|
387 | created new head | |
|
388 | $ hg merge | |
|
389 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
390 | (branch merge, don't forget to commit) | |
|
160 | 391 | |
|
161 | hg up 0 | |
|
162 | addcommit "F" 5 | |
|
163 | } | |
|
392 | $ hg ci -m E | |
|
393 | ||
|
394 | $ hg up -q 0 | |
|
395 | ||
|
396 | $ echo F > F | |
|
397 | $ hg ci -Am F | |
|
398 | adding F | |
|
399 | created new head | |
|
164 | 400 | |
|
165 | echo | |
|
166 | createrepocomplex > /dev/null 2>&1 | |
|
167 | hg glog --template '{rev}: {desc}\n' | |
|
401 | $ hg tglog | |
|
402 | @ 5: 'F' | |
|
403 | | | |
|
404 | | o 4: 'E' | |
|
405 | | |\ | |
|
406 | | | o 3: 'D' | |
|
407 | | | | | |
|
408 | | o | 2: 'C' | |
|
409 | | |/ | |
|
410 | | o 1: 'B' | |
|
411 | |/ | |
|
412 | o 0: 'A' | |
|
413 | ||
|
414 | $ cd .. | |
|
415 | ||
|
416 | ||
|
417 | Rebase and collapse - B onto F: | |
|
418 | ||
|
419 | $ hg clone -q -u . d d1 | |
|
420 | $ cd d1 | |
|
168 | 421 | |
|
169 | echo | |
|
170 | echo '% Rebase and collapse - B onto F' | |
|
171 | hg rebase -s 1 --collapse | hidebackup | |
|
422 | $ hg rebase -s 1 --collapse | |
|
423 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
172 | 424 | |
|
173 | hg glog --template '{rev}: {desc}\n' | |
|
425 | $ hg tglog | |
|
426 | @ 2: 'Collapsed revision | |
|
427 | | * B | |
|
428 | | * C | |
|
429 | | * D | |
|
430 | | * E' | |
|
431 | o 1: 'F' | |
|
432 | | | |
|
433 | o 0: 'A' | |
|
434 | ||
|
435 | $ hg manifest | |
|
436 | A | |
|
437 | B | |
|
438 | C | |
|
439 | D | |
|
440 | F | |
|
174 | 441 | |
|
175 | echo "Expected A, B, C, D, F" | |
|
176 | hg manifest | |
|
177 | exit 0 |
@@ -1,74 +1,115 | |||
|
1 | #!/bin/sh | |
|
2 | ||
|
3 | . $TESTDIR/helpers.sh | |
|
4 | ||
|
5 | echo "[extensions]" >> $HGRCPATH | |
|
6 | echo "graphlog=" >> $HGRCPATH | |
|
7 | echo "rebase=" >> $HGRCPATH | |
|
1 | $ cat >> $HGRCPATH <<EOF | |
|
2 | > [extensions] | |
|
3 | > graphlog= | |
|
4 | > rebase= | |
|
5 | > | |
|
6 | > [alias] | |
|
7 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" | |
|
8 | > EOF | |
|
8 | 9 | |
|
9 | hg init a | |
|
10 | cd a | |
|
11 |
echo |
|
|
12 | hg add common | |
|
13 | hg commit -d '0 0' -m "C1" | |
|
10 | $ hg init a | |
|
11 | $ cd a | |
|
12 | $ echo c1 >common | |
|
13 | $ hg add common | |
|
14 | $ hg ci -m C1 | |
|
15 | ||
|
16 | $ echo c2 >>common | |
|
17 | $ hg ci -m C2 | |
|
14 | 18 | |
|
15 |
|
|
|
16 | hg commit -d '1 0' -m "C2" | |
|
19 | $ echo c3 >>common | |
|
20 | $ hg ci -m C3 | |
|
21 | ||
|
22 | $ hg up -q -C 1 | |
|
23 | ||
|
24 | $ echo l1 >>extra | |
|
25 | $ hg add extra | |
|
26 | $ hg ci -m L1 | |
|
27 | created new head | |
|
17 | 28 | |
|
18 | echo 'c3' >>common | |
|
19 | hg commit -d '2 0' -m "C3" | |
|
29 | $ sed -e 's/c2/l2/' common > common.new | |
|
30 | $ mv common.new common | |
|
31 | $ hg ci -m L2 | |
|
20 | 32 | |
|
21 | hg update -C 1 | |
|
22 | echo 'l1' >>extra | |
|
23 | hg add extra | |
|
24 | hg commit -d '3 0' -m "L1" | |
|
33 | $ echo l3 >> extra2 | |
|
34 | $ hg add extra2 | |
|
35 | $ hg ci -m L3 | |
|
25 | 36 | |
|
26 | sed -e 's/c2/l2/' common > common.new | |
|
27 | mv common.new common | |
|
28 | hg commit -d '4 0' -m "L2" | |
|
37 | $ hg tglog | |
|
38 | @ 5: 'L3' | |
|
39 | | | |
|
40 | o 4: 'L2' | |
|
41 | | | |
|
42 | o 3: 'L1' | |
|
43 | | | |
|
44 | | o 2: 'C3' | |
|
45 | |/ | |
|
46 | o 1: 'C2' | |
|
47 | | | |
|
48 | o 0: 'C1' | |
|
49 | ||
|
50 | Try to call --continue: | |
|
29 | 51 | |
|
30 | echo 'l3' >> extra2 | |
|
31 | hg add extra2 | |
|
32 | hg commit -d '5 0' -m "L3" | |
|
52 | $ hg rebase --continue | |
|
53 | abort: no rebase in progress | |
|
54 | [255] | |
|
33 | 55 | |
|
34 | hg glog --template '{rev}: {desc}\n' | |
|
56 | Conflicting rebase: | |
|
35 | 57 | |
|
36 | echo | |
|
37 | echo '% Try to call --continue' | |
|
38 | hg rebase --continue | |
|
58 | $ hg rebase -s 3 -d 2 | |
|
59 | merging common | |
|
60 | warning: conflicts during merge. | |
|
61 | merging common failed! | |
|
62 | abort: fix unresolved conflicts with hg resolve then run hg rebase --continue | |
|
63 | [255] | |
|
39 | 64 | |
|
40 | echo | |
|
41 | echo '% Conflicting rebase' | |
|
42 | hg rebase -s 3 -d 2 | |
|
65 | Try to continue without solving the conflict: | |
|
43 | 66 | |
|
44 | echo | |
|
45 | echo '% Try to continue without solving the conflict' | |
|
46 | hg rebase --continue | |
|
67 | $ hg rebase --continue | |
|
68 | abort: unresolved merge conflicts (see hg resolve) | |
|
69 | [255] | |
|
47 | 70 | |
|
48 | echo | |
|
49 | echo '% Conclude rebase' | |
|
50 | echo 'resolved merge' >common | |
|
51 | hg resolve -m common | |
|
52 | hg rebase --continue | cleanrebase | |
|
71 | Conclude rebase: | |
|
53 | 72 | |
|
54 | hg glog --template '{rev}: {desc}\n' | |
|
73 | $ echo 'resolved merge' >common | |
|
74 | $ hg resolve -m common | |
|
75 | $ hg rebase --continue | |
|
76 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
55 | 77 | |
|
56 | echo | |
|
57 | echo '% Check correctness' | |
|
58 | echo ' - Rev. 0' | |
|
59 | hg cat -r 0 common | |
|
78 | $ hg tglog | |
|
79 | @ 5: 'L3' | |
|
80 | | | |
|
81 | o 4: 'L2' | |
|
82 | | | |
|
83 | o 3: 'L1' | |
|
84 | | | |
|
85 | o 2: 'C3' | |
|
86 | | | |
|
87 | o 1: 'C2' | |
|
88 | | | |
|
89 | o 0: 'C1' | |
|
90 | ||
|
91 | Check correctness: | |
|
60 | 92 | |
|
61 | echo ' - Rev. 1' | |
|
62 | hg cat -r 1 common | |
|
93 | $ hg cat -r 0 common | |
|
94 | c1 | |
|
63 | 95 | |
|
64 | echo ' - Rev. 2' | |
|
65 | hg cat -r 2 common | |
|
96 | $ hg cat -r 1 common | |
|
97 | c1 | |
|
98 | c2 | |
|
66 | 99 | |
|
67 | echo ' - Rev. 3' | |
|
68 | hg cat -r 3 common | |
|
100 | $ hg cat -r 2 common | |
|
101 | c1 | |
|
102 | c2 | |
|
103 | c3 | |
|
69 | 104 | |
|
70 | echo ' - Rev. 4' | |
|
71 | hg cat -r 4 common | |
|
105 | $ hg cat -r 3 common | |
|
106 | c1 | |
|
107 | c2 | |
|
108 | c3 | |
|
72 | 109 | |
|
73 | echo ' - Rev. 5' | |
|
74 | hg cat -r 5 common | |
|
110 | $ hg cat -r 4 common | |
|
111 | resolved merge | |
|
112 | ||
|
113 | $ hg cat -r 5 common | |
|
114 | resolved merge | |
|
115 |
@@ -1,70 +1,193 | |||
|
1 | #!/bin/sh | |
|
1 | $ cat >> $HGRCPATH <<EOF | |
|
2 | > [extensions] | |
|
3 | > graphlog= | |
|
4 | > rebase= | |
|
5 | > | |
|
6 | > [alias] | |
|
7 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" | |
|
8 | > EOF | |
|
2 | 9 | |
|
3 | . $TESTDIR/helpers.sh | |
|
4 | 10 | |
|
5 | echo "[extensions]" >> $HGRCPATH | |
|
6 | echo "graphlog=" >> $HGRCPATH | |
|
7 | echo "rebase=" >> $HGRCPATH | |
|
11 | $ hg init a | |
|
12 | $ cd a | |
|
13 | ||
|
14 | $ echo A > A | |
|
15 | $ hg ci -Am A | |
|
16 | adding A | |
|
17 | ||
|
18 | $ echo B > B | |
|
19 | $ hg ci -Am B | |
|
20 | adding B | |
|
8 | 21 | |
|
9 | BASE=`pwd` | |
|
22 | $ echo C > C | |
|
23 | $ hg ci -Am C | |
|
24 | adding C | |
|
25 | ||
|
26 | $ echo D > D | |
|
27 | $ hg ci -Am D | |
|
28 | adding D | |
|
29 | ||
|
30 | $ hg up -q -C 0 | |
|
10 | 31 | |
|
11 | addcommit () { | |
|
12 | echo $1 > $1 | |
|
13 | hg add $1 | |
|
14 | hg commit -d "${2} 0" -m $1 | |
|
15 | } | |
|
32 | $ echo E > E | |
|
33 | $ hg ci -Am E | |
|
34 | adding E | |
|
35 | created new head | |
|
36 | ||
|
37 | $ cd .. | |
|
38 | ||
|
39 | ||
|
40 | Rebasing D onto E detaching from C: | |
|
41 | ||
|
42 | $ hg clone -q -u . a a1 | |
|
43 | $ cd a1 | |
|
16 | 44 | |
|
17 | commit () { | |
|
18 | hg commit -d "${2} 0" -m $1 | |
|
19 | } | |
|
45 | $ hg tglog | |
|
46 | @ 4: 'E' | |
|
47 | | | |
|
48 | | o 3: 'D' | |
|
49 | | | | |
|
50 | | o 2: 'C' | |
|
51 | | | | |
|
52 | | o 1: 'B' | |
|
53 | |/ | |
|
54 | o 0: 'A' | |
|
55 | ||
|
56 | $ hg rebase --detach -s 3 -d 4 | |
|
57 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
20 | 58 | |
|
21 | createrepo () { | |
|
22 | cd $BASE | |
|
23 | rm -rf a | |
|
24 | hg init a | |
|
25 | cd a | |
|
26 | addcommit "A" 0 | |
|
27 | addcommit "B" 1 | |
|
28 | addcommit "C" 2 | |
|
29 | addcommit "D" 3 | |
|
59 | $ hg tglog | |
|
60 | @ 4: 'D' | |
|
61 | | | |
|
62 | o 3: 'E' | |
|
63 | | | |
|
64 | | o 2: 'C' | |
|
65 | | | | |
|
66 | | o 1: 'B' | |
|
67 | |/ | |
|
68 | o 0: 'A' | |
|
69 | ||
|
70 | $ hg manifest | |
|
71 | A | |
|
72 | D | |
|
73 | E | |
|
74 | ||
|
75 | $ cd .. | |
|
76 | ||
|
30 | 77 | |
|
31 | hg update -C 0 | |
|
32 | addcommit "E" 4 | |
|
33 | } | |
|
78 | Rebasing C onto E detaching from B: | |
|
79 | ||
|
80 | $ hg clone -q -u . a a2 | |
|
81 | $ cd a2 | |
|
82 | ||
|
83 | $ hg tglog | |
|
84 | @ 4: 'E' | |
|
85 | | | |
|
86 | | o 3: 'D' | |
|
87 | | | | |
|
88 | | o 2: 'C' | |
|
89 | | | | |
|
90 | | o 1: 'B' | |
|
91 | |/ | |
|
92 | o 0: 'A' | |
|
93 | ||
|
94 | $ hg rebase --detach -s 2 -d 4 | |
|
95 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
34 | 96 | |
|
35 | createrepo > /dev/null 2>&1 | |
|
36 | hg glog --template '{rev}: {desc}\n' | |
|
37 | echo '% Rebasing D onto E detaching from C' | |
|
38 | hg rebase --detach -s 3 -d 4 | hidebackup | |
|
39 | hg glog --template '{rev}: {desc}\n' | |
|
40 | echo "Expected A, D, E" | |
|
41 | hg manifest | |
|
97 | $ hg tglog | |
|
98 | @ 4: 'D' | |
|
99 | | | |
|
100 | o 3: 'C' | |
|
101 | | | |
|
102 | o 2: 'E' | |
|
103 | | | |
|
104 | | o 1: 'B' | |
|
105 | |/ | |
|
106 | o 0: 'A' | |
|
107 | ||
|
108 | $ hg manifest | |
|
109 | A | |
|
110 | C | |
|
111 | D | |
|
112 | E | |
|
113 | ||
|
114 | $ cd .. | |
|
42 | 115 | |
|
43 | echo | |
|
44 | createrepo > /dev/null 2>&1 | |
|
45 | hg glog --template '{rev}: {desc}\n' | |
|
46 | echo '% Rebasing C onto E detaching from B' | |
|
47 | hg rebase --detach -s 2 -d 4 | hidebackup | |
|
48 | hg glog --template '{rev}: {desc}\n' | |
|
49 | echo "Expected A, C, D, E" | |
|
50 | hg manifest | |
|
116 | ||
|
117 | Rebasing B onto E using detach (same as not using it): | |
|
118 | ||
|
119 | $ hg clone -q -u . a a3 | |
|
120 | $ cd a3 | |
|
121 | ||
|
122 | $ hg tglog | |
|
123 | @ 4: 'E' | |
|
124 | | | |
|
125 | | o 3: 'D' | |
|
126 | | | | |
|
127 | | o 2: 'C' | |
|
128 | | | | |
|
129 | | o 1: 'B' | |
|
130 | |/ | |
|
131 | o 0: 'A' | |
|
132 | ||
|
133 | $ hg rebase --detach -s 1 -d 4 | |
|
134 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
51 | 135 | |
|
52 | echo | |
|
53 | createrepo > /dev/null 2>&1 | |
|
54 | hg glog --template '{rev}: {desc}\n' | |
|
55 | echo '% Rebasing B onto E using detach (same as not using it)' | |
|
56 | hg rebase --detach -s 1 -d 4 | hidebackup | |
|
57 | hg glog --template '{rev}: {desc}\n' | |
|
58 | echo "Expected A, B, C, D, E" | |
|
59 | hg manifest | |
|
136 | $ hg tglog | |
|
137 | @ 4: 'D' | |
|
138 | | | |
|
139 | o 3: 'C' | |
|
140 | | | |
|
141 | o 2: 'B' | |
|
142 | | | |
|
143 | o 1: 'E' | |
|
144 | | | |
|
145 | o 0: 'A' | |
|
146 | ||
|
147 | $ hg manifest | |
|
148 | A | |
|
149 | B | |
|
150 | C | |
|
151 | D | |
|
152 | E | |
|
153 | ||
|
154 | $ cd .. | |
|
155 | ||
|
156 | ||
|
157 | Rebasing C onto E detaching from B and collapsing: | |
|
158 | ||
|
159 | $ hg clone -q -u . a a4 | |
|
160 | $ cd a4 | |
|
60 | 161 | |
|
61 | echo | |
|
62 | createrepo > /dev/null 2>&1 | |
|
63 | hg glog --template '{rev}: {desc}\n' | |
|
64 | echo '% Rebasing C onto E detaching from B and collapsing' | |
|
65 | hg rebase --detach --collapse -s 2 -d 4 | hidebackup | |
|
66 | hg glog --template '{rev}: {desc}\n' | |
|
67 | echo "Expected A, C, D, E" | |
|
68 | hg manifest | |
|
162 | $ hg tglog | |
|
163 | @ 4: 'E' | |
|
164 | | | |
|
165 | | o 3: 'D' | |
|
166 | | | | |
|
167 | | o 2: 'C' | |
|
168 | | | | |
|
169 | | o 1: 'B' | |
|
170 | |/ | |
|
171 | o 0: 'A' | |
|
172 | ||
|
173 | $ hg rebase --detach --collapse -s 2 -d 4 | |
|
174 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
69 | 175 | |
|
70 | exit 0 | |
|
176 | $ hg tglog | |
|
177 | @ 3: 'Collapsed revision | |
|
178 | | * C | |
|
179 | | * D' | |
|
180 | o 2: 'E' | |
|
181 | | | |
|
182 | | o 1: 'B' | |
|
183 | |/ | |
|
184 | o 0: 'A' | |
|
185 | ||
|
186 | $ hg manifest | |
|
187 | A | |
|
188 | C | |
|
189 | D | |
|
190 | E | |
|
191 | ||
|
192 | $ cd .. | |
|
193 |
@@ -1,83 +1,194 | |||
|
1 | #!/bin/sh | |
|
1 | $ cat >> $HGRCPATH <<EOF | |
|
2 | > [extensions] | |
|
3 | > graphlog= | |
|
4 | > rebase= | |
|
5 | > | |
|
6 | > [alias] | |
|
7 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" | |
|
8 | > EOF | |
|
9 | ||
|
2 | 10 | |
|
3 | . $TESTDIR/helpers.sh | |
|
4 | echo "[extensions]" >> $HGRCPATH | |
|
5 | echo "graphlog=" >> $HGRCPATH | |
|
6 | echo "rebase=" >> $HGRCPATH | |
|
11 | $ hg init a | |
|
12 | $ cd a | |
|
7 | 13 | |
|
8 | BASE=`pwd` | |
|
14 | $ echo A > A | |
|
15 | $ hg ci -Am A | |
|
16 | adding A | |
|
17 | ||
|
18 | $ echo B > B | |
|
19 | $ hg ci -Am B | |
|
20 | adding B | |
|
9 | 21 | |
|
10 | addcommit () { | |
|
11 | echo $1 > $1 | |
|
12 | hg add $1 | |
|
13 | hg commit -d "${2} 0" -m $1 | |
|
14 | } | |
|
22 | $ echo C >> A | |
|
23 | $ hg ci -m C | |
|
24 | ||
|
25 | $ hg up -q -C 0 | |
|
26 | ||
|
27 | $ echo D >> A | |
|
28 | $ hg ci -m D | |
|
29 | created new head | |
|
15 | 30 | |
|
16 | commit () { | |
|
17 | hg commit -d "${2} 0" -m $1 | |
|
18 | } | |
|
31 | $ echo E > E | |
|
32 | $ hg ci -Am E | |
|
33 | adding E | |
|
34 | ||
|
35 | $ cd .. | |
|
36 | ||
|
37 | ||
|
38 | Changes during an interruption - continue: | |
|
39 | ||
|
40 | $ hg clone -q -u . a a1 | |
|
41 | $ cd a1 | |
|
19 | 42 | |
|
20 | createrepo () { | |
|
21 | cd $BASE | |
|
22 | rm -rf a | |
|
23 | hg init a | |
|
24 | cd a | |
|
25 | addcommit "A" 0 | |
|
26 | addcommit "B" 1 | |
|
27 | echo "C" >> A | |
|
28 | commit "C" 2 | |
|
43 | $ hg tglog | |
|
44 | @ 4: 'E' | |
|
45 | | | |
|
46 | o 3: 'D' | |
|
47 | | | |
|
48 | | o 2: 'C' | |
|
49 | | | | |
|
50 | | o 1: 'B' | |
|
51 | |/ | |
|
52 | o 0: 'A' | |
|
53 | ||
|
54 | Rebasing B onto E: | |
|
55 | ||
|
56 | $ hg rebase -s 1 -d 4 | |
|
57 | merging A | |
|
58 | warning: conflicts during merge. | |
|
59 | merging A failed! | |
|
60 | abort: fix unresolved conflicts with hg resolve then run hg rebase --continue | |
|
61 | [255] | |
|
62 | ||
|
63 | Force a commit on C during the interruption: | |
|
64 | ||
|
65 | $ hg up -q -C 2 | |
|
29 | 66 | |
|
30 | hg update -C 0 | |
|
31 | echo "D" >> A | |
|
32 | commit "D" 3 | |
|
33 | addcommit "E" 4 | |
|
34 | } | |
|
67 | $ echo 'Extra' > Extra | |
|
68 | $ hg add Extra | |
|
69 | $ hg ci -m 'Extra' | |
|
35 | 70 | |
|
36 | echo "% Changes during an interruption - continue" | |
|
37 | createrepo > /dev/null 2>&1 | |
|
38 | hg glog --template '{rev}: {desc}\n' | |
|
71 | $ hg tglog | |
|
72 | @ 6: 'Extra' | |
|
73 | | | |
|
74 | | o 5: 'B' | |
|
75 | | | | |
|
76 | | o 4: 'E' | |
|
77 | | | | |
|
78 | | o 3: 'D' | |
|
79 | | | | |
|
80 | o | 2: 'C' | |
|
81 | | | | |
|
82 | o | 1: 'B' | |
|
83 | |/ | |
|
84 | o 0: 'A' | |
|
85 | ||
|
86 | Resume the rebasing: | |
|
87 | ||
|
88 | $ hg rebase --continue | |
|
89 | merging A | |
|
90 | warning: conflicts during merge. | |
|
91 | merging A failed! | |
|
92 | abort: fix unresolved conflicts with hg resolve then run hg rebase --continue | |
|
93 | [255] | |
|
94 | ||
|
95 | Solve the conflict and go on: | |
|
39 | 96 | |
|
40 | echo | |
|
41 | echo "% - Rebasing B onto E" | |
|
42 | hg rebase -s 1 -d 4 | hidebackup | |
|
97 | $ echo 'conflict solved' > A | |
|
98 | $ rm A.orig | |
|
99 | $ hg resolve -m A | |
|
43 | 100 | |
|
44 | echo | |
|
45 | echo "% - Force a commit on C during the interruption" | |
|
46 | hg update -C 2 | |
|
47 | addcommit "Extra" 5 | |
|
48 | hg glog --template '{rev}: {desc}\n' | |
|
101 | $ hg rebase --continue | |
|
102 | warning: new changesets detected on source branch, not stripping | |
|
49 | 103 | |
|
50 | echo | |
|
51 | echo "% - Resume the rebasing" | |
|
52 | hg rebase --continue | |
|
104 | $ hg tglog | |
|
105 | @ 7: 'C' | |
|
106 | | | |
|
107 | | o 6: 'Extra' | |
|
108 | | | | |
|
109 | o | 5: 'B' | |
|
110 | | | | |
|
111 | o | 4: 'E' | |
|
112 | | | | |
|
113 | o | 3: 'D' | |
|
114 | | | | |
|
115 | | o 2: 'C' | |
|
116 | | | | |
|
117 | | o 1: 'B' | |
|
118 | |/ | |
|
119 | o 0: 'A' | |
|
120 | ||
|
121 | $ cd .. | |
|
53 | 122 | |
|
54 | echo | |
|
55 | echo "% - Solve the conflict and go on" | |
|
56 | echo 'conflict solved' > A | |
|
57 | rm A.orig | |
|
58 | hg resolve -m A | |
|
59 | hg rebase --continue | |
|
60 | hg glog --template '{rev}: {desc}\n' | |
|
123 | ||
|
124 | Changes during an interruption - abort: | |
|
125 | ||
|
126 | $ hg clone -q -u . a a2 | |
|
127 | $ cd a2 | |
|
128 | ||
|
129 | $ hg tglog | |
|
130 | @ 4: 'E' | |
|
131 | | | |
|
132 | o 3: 'D' | |
|
133 | | | |
|
134 | | o 2: 'C' | |
|
135 | | | | |
|
136 | | o 1: 'B' | |
|
137 | |/ | |
|
138 | o 0: 'A' | |
|
139 | ||
|
140 | Rebasing B onto E: | |
|
61 | 141 | |
|
62 | echo | |
|
63 | echo | |
|
64 | echo "% Changes during an interruption - abort" | |
|
65 | createrepo > /dev/null 2>&1 | |
|
66 | hg glog --template '{rev}: {desc}\n' | |
|
142 | $ hg rebase -s 1 -d 4 | |
|
143 | merging A | |
|
144 | warning: conflicts during merge. | |
|
145 | merging A failed! | |
|
146 | abort: fix unresolved conflicts with hg resolve then run hg rebase --continue | |
|
147 | [255] | |
|
67 | 148 | |
|
68 | echo | |
|
69 | echo "% Rebasing B onto E" | |
|
70 | hg rebase -s 1 -d 4 | hidebackup | |
|
149 | Force a commit on B' during the interruption: | |
|
150 | ||
|
151 | $ hg up -q -C 5 | |
|
152 | ||
|
153 | $ echo 'Extra' > Extra | |
|
154 | $ hg add Extra | |
|
155 | $ hg ci -m 'Extra' | |
|
71 | 156 | |
|
72 | echo | |
|
73 | echo "% Force a commit on B' during the interruption" | |
|
74 | hg update -C 5 | |
|
75 | addcommit "Extra" 6 | |
|
76 | hg glog --template '{rev}: {desc}\n' | |
|
157 | $ hg tglog | |
|
158 | @ 6: 'Extra' | |
|
159 | | | |
|
160 | o 5: 'B' | |
|
161 | | | |
|
162 | o 4: 'E' | |
|
163 | | | |
|
164 | o 3: 'D' | |
|
165 | | | |
|
166 | | o 2: 'C' | |
|
167 | | | | |
|
168 | | o 1: 'B' | |
|
169 | |/ | |
|
170 | o 0: 'A' | |
|
171 | ||
|
172 | Abort the rebasing: | |
|
77 | 173 | |
|
78 | echo | |
|
79 | echo "% Abort the rebasing" | |
|
80 | hg rebase --abort | |
|
81 | hg glog --template '{rev}: {desc}\n' | |
|
174 | $ hg rebase --abort | |
|
175 | warning: new changesets detected on target branch, can't abort | |
|
176 | [255] | |
|
82 | 177 | |
|
83 | exit 0 | |
|
178 | $ hg tglog | |
|
179 | @ 6: 'Extra' | |
|
180 | | | |
|
181 | o 5: 'B' | |
|
182 | | | |
|
183 | o 4: 'E' | |
|
184 | | | |
|
185 | o 3: 'D' | |
|
186 | | | |
|
187 | | o 2: 'C' | |
|
188 | | | | |
|
189 | | o 1: 'B' | |
|
190 | |/ | |
|
191 | o 0: 'A' | |
|
192 | ||
|
193 | $ cd .. | |
|
194 |
@@ -1,51 +1,123 | |||
|
1 | #!/bin/sh | |
|
1 | $ cat >> $HGRCPATH <<EOF | |
|
2 | > [extensions] | |
|
3 | > graphlog= | |
|
4 | > rebase= | |
|
5 | > | |
|
6 | > [alias] | |
|
7 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" | |
|
8 | > EOF | |
|
2 | 9 | |
|
3 | . $TESTDIR/helpers.sh | |
|
10 | ||
|
11 | $ hg init a | |
|
12 | $ cd a | |
|
4 | 13 | |
|
5 | echo "[extensions]" >> $HGRCPATH | |
|
6 | echo "graphlog=" >> $HGRCPATH | |
|
7 | echo "rebase=" >> $HGRCPATH | |
|
14 | $ echo c1 > c1 | |
|
15 | $ hg ci -Am c1 | |
|
16 | adding c1 | |
|
17 | ||
|
18 | $ echo c2 > c2 | |
|
19 | $ hg ci -Am c2 | |
|
20 | adding c2 | |
|
21 | ||
|
22 | $ echo l1 > l1 | |
|
23 | $ hg ci -Am l1 | |
|
24 | adding l1 | |
|
25 | ||
|
26 | $ hg up -q -C 1 | |
|
8 | 27 | |
|
9 | addcommit () { | |
|
10 | echo $1 > $1 | |
|
11 | hg add $1 | |
|
12 | hg commit -d "${2} 0" -m $1 | |
|
13 | } | |
|
28 | $ echo r1 > r1 | |
|
29 | $ hg ci -Am r1 | |
|
30 | adding r1 | |
|
31 | created new head | |
|
32 | ||
|
33 | $ echo r2 > r2 | |
|
34 | $ hg ci -Am r2 | |
|
35 | adding r2 | |
|
14 | 36 | |
|
15 | hg init a | |
|
16 | cd a | |
|
17 | addcommit "c1" 0 | |
|
18 | addcommit "c2" 1 | |
|
37 | $ hg tglog | |
|
38 | @ 4: 'r2' | |
|
39 | | | |
|
40 | o 3: 'r1' | |
|
41 | | | |
|
42 | | o 2: 'l1' | |
|
43 | |/ | |
|
44 | o 1: 'c2' | |
|
45 | | | |
|
46 | o 0: 'c1' | |
|
47 | ||
|
48 | Rebase with no arguments - single revision in source branch: | |
|
19 | 49 | |
|
20 | addcommit "l1" 2 | |
|
50 | $ hg up -q -C 2 | |
|
21 | 51 | |
|
22 | hg update -C 1 | |
|
23 | addcommit "r1" 3 | |
|
24 | addcommit "r2" 4 | |
|
25 | hg glog --template '{rev}:{desc}\n' | |
|
52 | $ hg rebase | |
|
53 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
26 | 54 | |
|
27 | echo | |
|
28 | echo '% Rebase with no arguments - single revision in source branch' | |
|
29 | hg update -C 2 | |
|
30 | hg rebase | hidebackup | |
|
31 | hg glog --template '{rev}:{desc}\n' | |
|
55 | $ hg tglog | |
|
56 | @ 4: 'l1' | |
|
57 | | | |
|
58 | o 3: 'r2' | |
|
59 | | | |
|
60 | o 2: 'r1' | |
|
61 | | | |
|
62 | o 1: 'c2' | |
|
63 | | | |
|
64 | o 0: 'c1' | |
|
65 | ||
|
66 | $ cd .. | |
|
67 | ||
|
68 | ||
|
69 | $ hg init b | |
|
70 | $ cd b | |
|
32 | 71 | |
|
33 | cd .. | |
|
34 | rm -rf a | |
|
35 | hg init a | |
|
36 | cd a | |
|
37 | addcommit "c1" 0 | |
|
38 | addcommit "c2" 1 | |
|
72 | $ echo c1 > c1 | |
|
73 | $ hg ci -Am c1 | |
|
74 | adding c1 | |
|
75 | ||
|
76 | $ echo c2 > c2 | |
|
77 | $ hg ci -Am c2 | |
|
78 | adding c2 | |
|
79 | ||
|
80 | $ echo l1 > l1 | |
|
81 | $ hg ci -Am l1 | |
|
82 | adding l1 | |
|
83 | ||
|
84 | $ echo l2 > l2 | |
|
85 | $ hg ci -Am l2 | |
|
86 | adding l2 | |
|
87 | ||
|
88 | $ hg up -q -C 1 | |
|
39 | 89 | |
|
40 | addcommit "l1" 2 | |
|
41 | addcommit "l2" 3 | |
|
90 | $ echo r1 > r1 | |
|
91 | $ hg ci -Am r1 | |
|
92 | adding r1 | |
|
93 | created new head | |
|
42 | 94 | |
|
43 | hg update -C 1 | |
|
44 | addcommit "r1" 4 | |
|
45 | hg glog --template '{rev}:{desc}\n' | |
|
95 | $ hg tglog | |
|
96 | @ 4: 'r1' | |
|
97 | | | |
|
98 | | o 3: 'l2' | |
|
99 | | | | |
|
100 | | o 2: 'l1' | |
|
101 | |/ | |
|
102 | o 1: 'c2' | |
|
103 | | | |
|
104 | o 0: 'c1' | |
|
105 | ||
|
106 | Rebase with no arguments - single revision in target branch: | |
|
107 | ||
|
108 | $ hg up -q -C 3 | |
|
46 | 109 | |
|
47 | echo | |
|
48 | echo '% Rebase with no arguments - single revision in target branch' | |
|
49 | hg update -C 3 | |
|
50 | hg rebase 2>&1 | hidebackup | |
|
51 | hg glog --template '{rev}:{desc}\n' | |
|
110 | $ hg rebase | |
|
111 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
112 | ||
|
113 | $ hg tglog | |
|
114 | @ 4: 'l2' | |
|
115 | | | |
|
116 | o 3: 'l1' | |
|
117 | | | |
|
118 | o 2: 'r1' | |
|
119 | | | |
|
120 | o 1: 'c2' | |
|
121 | | | |
|
122 | o 0: 'c1' | |
|
123 |
@@ -1,32 +1,71 | |||
|
1 | #!/bin/sh | |
|
1 | $ cat >> $HGRCPATH <<EOF | |
|
2 | > [extensions] | |
|
3 | > graphlog= | |
|
4 | > rebase= | |
|
5 | > | |
|
6 | > [alias] | |
|
7 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" | |
|
8 | > EOF | |
|
2 | 9 | |
|
3 | echo "[extensions]" >> $HGRCPATH | |
|
4 | echo "graphlog=" >> $HGRCPATH | |
|
5 | echo "rebase=" >> $HGRCPATH | |
|
10 | ||
|
11 | $ hg init a | |
|
12 | $ cd a | |
|
13 | ||
|
14 | $ echo c1 > c1 | |
|
15 | $ hg ci -Am c1 | |
|
16 | adding c1 | |
|
6 | 17 | |
|
7 | addcommit () { | |
|
8 | echo $1 > $1 | |
|
9 | hg add $1 | |
|
10 | hg commit -d "${2} 0" -m $1 | |
|
11 | } | |
|
18 | $ echo c2 > c2 | |
|
19 | $ hg ci -Am c2 | |
|
20 | adding c2 | |
|
21 | ||
|
22 | $ echo l1 > l1 | |
|
23 | $ hg ci -Am l1 | |
|
24 | adding l1 | |
|
25 | ||
|
26 | $ echo l2 > l2 | |
|
27 | $ hg ci -Am l2 | |
|
28 | adding l2 | |
|
29 | ||
|
30 | $ hg up -q -C 1 | |
|
31 | ||
|
32 | $ hg branch 'notdefault' | |
|
33 | marked working directory as branch notdefault | |
|
12 | 34 | |
|
13 | hg init a | |
|
14 | cd a | |
|
15 | addcommit "c1" 0 | |
|
16 | addcommit "c2" 1 | |
|
35 | $ echo r1 > r1 | |
|
36 | $ hg ci -Am r1 | |
|
37 | adding r1 | |
|
17 | 38 | |
|
18 | addcommit "l1" 2 | |
|
19 | addcommit "l2" 3 | |
|
39 | $ hg tglog | |
|
40 | @ 4: 'r1' notdefault | |
|
41 | | | |
|
42 | | o 3: 'l2' | |
|
43 | | | | |
|
44 | | o 2: 'l1' | |
|
45 | |/ | |
|
46 | o 1: 'c2' | |
|
47 | | | |
|
48 | o 0: 'c1' | |
|
49 | ||
|
50 | ||
|
51 | Rebase a branch while preserving the branch name: | |
|
20 | 52 | |
|
21 | hg update -C 1 | |
|
22 | hg branch 'notdefault' | |
|
23 | addcommit "r1" 4 | |
|
24 | hg glog --template '{rev}:{desc}:{branches}\n' | |
|
53 | $ hg up -q -C 3 | |
|
54 | ||
|
55 | $ hg rebase -b 4 -d 3 --keepbranches | |
|
56 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
25 | 57 | |
|
26 | echo | |
|
27 | echo '% Rebase a branch while preserving the branch name' | |
|
28 | hg update -C 3 | |
|
29 | hg rebase -b 4 -d 3 --keepbranches -q | |
|
30 | hg glog --template '{rev}:{desc}:{branches}\n' | |
|
31 | echo '% dirstate branch should be "notdefault"' | |
|
32 | hg branch | |
|
58 | $ hg tglog | |
|
59 | @ 4: 'r1' notdefault | |
|
60 | | | |
|
61 | o 3: 'l2' | |
|
62 | | | |
|
63 | o 2: 'l1' | |
|
64 | | | |
|
65 | o 1: 'c2' | |
|
66 | | | |
|
67 | o 0: 'c1' | |
|
68 | ||
|
69 | $ hg branch | |
|
70 | notdefault | |
|
71 |
@@ -1,76 +1,136 | |||
|
1 | #!/bin/sh | |
|
2 | # This emulates the effects of an hg pull --rebase in which the remote repo | |
|
3 | # already has one local mq patch | |
|
1 | This emulates the effects of an hg pull --rebase in which the remote repo | |
|
2 | already has one local mq patch | |
|
4 | 3 | |
|
5 | . $TESTDIR/helpers.sh | |
|
4 | $ cat >> $HGRCPATH <<EOF | |
|
5 | > [extensions] | |
|
6 | > graphlog= | |
|
7 | > rebase= | |
|
8 | > mq= | |
|
9 | > | |
|
10 | > [alias] | |
|
11 | > tglog = log -G --template "{rev}: '{desc}' tags: {tags}\n" | |
|
12 | > EOF | |
|
13 | ||
|
6 | 14 | |
|
7 | echo "[extensions]" >> $HGRCPATH | |
|
8 | echo "graphlog=" >> $HGRCPATH | |
|
9 | echo "rebase=" >> $HGRCPATH | |
|
10 | echo "mq=" >> $HGRCPATH | |
|
15 | $ hg init a | |
|
16 | $ cd a | |
|
17 | $ hg qinit -c | |
|
18 | ||
|
19 | $ echo c1 > c1 | |
|
20 | $ hg add c1 | |
|
21 | $ hg ci -m C1 | |
|
11 | 22 | |
|
12 | hg init a | |
|
13 | cd a | |
|
14 | hg qinit -c # This must work even with a managed mq queue | |
|
23 | $ echo r1 > r1 | |
|
24 | $ hg add r1 | |
|
25 | $ hg ci -m R1 | |
|
26 | ||
|
27 | $ hg up -q 0 | |
|
28 | ||
|
29 | $ hg qnew p0.patch | |
|
30 | $ echo p0 > p0 | |
|
31 | $ hg add p0 | |
|
32 | $ hg qref -m P0 | |
|
15 | 33 | |
|
16 | echo 'c1' > c1 | |
|
17 | hg add c1 | |
|
18 | hg commit -d '0 0' -m "C1" | |
|
34 | $ hg qnew p1.patch | |
|
35 | $ echo p1 > p1 | |
|
36 | $ hg add p1 | |
|
37 | $ hg qref -m P1 | |
|
38 | ||
|
39 | $ hg export qtip > p1.patch | |
|
19 | 40 | |
|
20 | echo 'r1' > r1 | |
|
21 | hg add r1 | |
|
22 | hg commit -d '1 0' -m "R1" | |
|
41 | $ hg up -q -C 1 | |
|
42 | ||
|
43 | $ hg import p1.patch | |
|
44 | applying p1.patch | |
|
45 | ||
|
46 | $ rm p1.patch | |
|
47 | ||
|
48 | $ hg up -q -C qtip | |
|
23 | 49 | |
|
24 | hg up 0 | |
|
25 | hg qnew p0.patch | |
|
26 | echo 'p0' > p0 | |
|
27 | hg add p0 | |
|
28 | hg qref -m 'P0' | |
|
50 | $ hg rebase | |
|
51 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
29 | 52 | |
|
30 | hg qnew p1.patch | |
|
31 | echo 'p1' > p1 | |
|
32 | hg add p1 | |
|
33 | hg qref -m 'P1' | |
|
34 | hg export qtip > p1.patch | |
|
53 | $ hg tglog | |
|
54 | @ 3: 'P0' tags: p0.patch qbase qtip tip | |
|
55 | | | |
|
56 | o 2: 'P1' tags: qparent | |
|
57 | | | |
|
58 | o 1: 'R1' tags: | |
|
59 | | | |
|
60 | o 0: 'C1' tags: | |
|
61 | ||
|
62 | $ cd .. | |
|
63 | ||
|
64 | ||
|
65 | $ hg init b | |
|
66 | $ cd b | |
|
67 | $ hg qinit -c | |
|
35 | 68 | |
|
36 | echo | |
|
37 | echo '% "Mainstream" import p1.patch' | |
|
38 | hg up -C 1 | |
|
39 | hg import p1.patch | |
|
40 | rm p1.patch | |
|
69 | $ for i in r0 r1 r2 r3 r4 r5 r6; | |
|
70 | > do | |
|
71 | > echo $i > $i | |
|
72 | > hg ci -Am $i | |
|
73 | > done | |
|
74 | adding r0 | |
|
75 | adding r1 | |
|
76 | adding r2 | |
|
77 | adding r3 | |
|
78 | adding r4 | |
|
79 | adding r5 | |
|
80 | adding r6 | |
|
81 | ||
|
82 | $ hg qimport -r 1:tip | |
|
41 | 83 | |
|
42 | echo | |
|
43 | echo '% Rebase' | |
|
44 | hg up -C qtip | |
|
45 | hg rebase | hidebackup | |
|
46 | hg glog --template '{rev} {desc} tags: {tags}\n' | |
|
84 | $ hg up -q 0 | |
|
47 | 85 | |
|
48 | echo | |
|
49 | echo '% Now with --continue' | |
|
50 | cd .. | |
|
51 | hg init b | |
|
52 | cd b | |
|
53 | hg qinit -c # This must work even with a managed mq queue | |
|
86 | $ for i in r1 r3 r7 r8; | |
|
87 | > do | |
|
88 | > echo $i > $i | |
|
89 | > hg ci -Am branch2-$i | |
|
90 | > done | |
|
91 | adding r1 | |
|
92 | created new head | |
|
93 | adding r3 | |
|
94 | adding r7 | |
|
95 | adding r8 | |
|
96 | ||
|
97 | $ echo somethingelse > r4 | |
|
98 | $ hg ci -Am branch2-r4 | |
|
99 | adding r4 | |
|
54 | 100 | |
|
55 | for i in r0 r1 r2 r3 r4 r5 r6; | |
|
56 | do | |
|
57 | echo $i > $i | |
|
58 | hg ci -Am $i | |
|
59 | done | |
|
60 | hg qimport -r 1:tip | |
|
61 | hg up 0 | |
|
62 | for i in r1 r3 r7 r8; | |
|
63 | do | |
|
64 | echo $i > $i | |
|
65 | hg ci -Am branch2-$i | |
|
66 | done | |
|
67 | echo somethingelse > r4 | |
|
68 | hg ci -Am branch2-r4 | |
|
69 | echo r6 > r6 | |
|
70 | hg ci -Am branch2-r6 | |
|
101 | $ echo r6 > r6 | |
|
102 | $ hg ci -Am branch2-r6 | |
|
103 | adding r6 | |
|
104 | ||
|
105 | $ hg up -q qtip | |
|
106 | ||
|
107 | $ HGMERGE=internal:fail hg rebase | |
|
108 | abort: fix unresolved conflicts with hg resolve then run hg rebase --continue | |
|
109 | [255] | |
|
110 | ||
|
111 | $ HGMERGE=internal:local hg resolve --all | |
|
112 | ||
|
113 | $ hg rebase --continue | |
|
114 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
71 | 115 | |
|
72 | hg up qtip | |
|
73 | HGMERGE=internal:fail hg rebase | hidebackup | |
|
74 | HGMERGE=internal:local hg resolve --all | |
|
75 | hg rebase --continue | hidebackup | |
|
76 | hg glog --template '{rev} {desc} tags: {tags}\n' | |
|
116 | $ hg tglog | |
|
117 | @ 9: 'r5' tags: 5.diff qtip tip | |
|
118 | | | |
|
119 | o 8: 'r4' tags: 4.diff | |
|
120 | | | |
|
121 | o 7: 'r2' tags: 2.diff qbase | |
|
122 | | | |
|
123 | o 6: 'branch2-r6' tags: qparent | |
|
124 | | | |
|
125 | o 5: 'branch2-r4' tags: | |
|
126 | | | |
|
127 | o 4: 'branch2-r8' tags: | |
|
128 | | | |
|
129 | o 3: 'branch2-r7' tags: | |
|
130 | | | |
|
131 | o 2: 'branch2-r3' tags: | |
|
132 | | | |
|
133 | o 1: 'branch2-r1' tags: | |
|
134 | | | |
|
135 | o 0: 'r0' tags: | |
|
136 |
@@ -1,133 +1,237 | |||
|
1 | #!/bin/sh | |
|
2 | ||
|
3 | . $TESTDIR/helpers.sh | |
|
1 | $ cat >> $HGRCPATH <<EOF | |
|
2 | > [extensions] | |
|
3 | > graphlog= | |
|
4 | > rebase= | |
|
5 | > mq= | |
|
6 | > | |
|
7 | > [mq] | |
|
8 | > plain=true | |
|
9 | > | |
|
10 | > [alias] | |
|
11 | > tglog = log -G --template "{rev}: '{desc}' tags: {tags}\n" | |
|
12 | > EOF | |
|
4 | 13 | |
|
5 | echo "[extensions]" >> $HGRCPATH | |
|
6 | echo "graphlog=" >> $HGRCPATH | |
|
7 | echo "rebase=" >> $HGRCPATH | |
|
8 | echo "mq=" >> $HGRCPATH | |
|
14 | ||
|
15 | $ hg init a | |
|
16 | $ cd a | |
|
17 | $ hg qinit -c | |
|
9 | 18 | |
|
10 | echo "[mq]" >> $HGRCPATH | |
|
11 | echo "plain=true" >> $HGRCPATH | |
|
19 | $ echo c1 > f | |
|
20 | $ hg add f | |
|
21 | $ hg ci -m C1 | |
|
22 | ||
|
23 | $ echo r1 > f | |
|
24 | $ hg ci -m R1 | |
|
25 | ||
|
26 | $ hg up -q 0 | |
|
12 | 27 | |
|
13 | filterpatch() | |
|
14 | { | |
|
15 | sed -e "s/^\(# Date\).*/\1/" \ | |
|
16 | -e "s/^\(# Node ID\).*/\1/" \ | |
|
17 | -e "s/^\(# Parent\).*/\1/" \ | |
|
18 | -e "s/^\(diff -r \)\([a-f0-9]* \)\(-r \)\([a-f0-9]* \)/\1x \3y /" \ | |
|
19 | -e "s/^\(diff -r \)\([a-f0-9]* \)/\1x /" \ | |
|
20 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" \ | |
|
21 | -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" | |
|
22 | } | |
|
28 | $ hg qnew f.patch | |
|
29 | $ echo mq1 > f | |
|
30 | $ hg qref -m P0 | |
|
31 | ||
|
32 | $ hg qnew f2.patch | |
|
33 | $ echo mq2 > f | |
|
34 | $ hg qref -m P1 | |
|
23 | 35 | |
|
24 | hg init a | |
|
25 | cd a | |
|
26 | hg qinit -c # This must work even with a managed mq queue | |
|
36 | $ hg tglog | |
|
37 | @ 3: 'P1' tags: f2.patch qtip tip | |
|
38 | | | |
|
39 | o 2: 'P0' tags: f.patch qbase | |
|
40 | | | |
|
41 | | o 1: 'R1' tags: | |
|
42 | |/ | |
|
43 | o 0: 'C1' tags: qparent | |
|
44 | ||
|
45 | ||
|
46 | Rebase - try to rebase on an applied mq patch: | |
|
27 | 47 | |
|
28 | echo 'c1' > f | |
|
29 | hg add f | |
|
30 | hg commit -d '0 0' -m "C1" | |
|
48 | $ hg rebase -s 1 -d 3 | |
|
49 | abort: cannot rebase onto an applied mq patch | |
|
50 | [255] | |
|
51 | ||
|
52 | Rebase - same thing, but mq patch is default dest: | |
|
53 | ||
|
54 | $ hg up -q 1 | |
|
55 | $ hg rebase | |
|
56 | abort: cannot rebase onto an applied mq patch | |
|
57 | [255] | |
|
58 | $ hg up -q qtip | |
|
31 | 59 | |
|
32 | echo 'r1' > f | |
|
33 | hg commit -d '2 0' -m "R1" | |
|
60 | Rebase - generate a conflict: | |
|
61 | ||
|
62 | $ hg rebase -s 2 -d 1 | |
|
63 | merging f | |
|
64 | warning: conflicts during merge. | |
|
65 | merging f failed! | |
|
66 | abort: fix unresolved conflicts with hg resolve then run hg rebase --continue | |
|
67 | [255] | |
|
68 | ||
|
69 | Fix the 1st conflict: | |
|
34 | 70 | |
|
35 | hg up 0 | |
|
36 | hg qnew f.patch | |
|
37 | echo 'mq1' > f | |
|
38 | hg qref -m 'P0' | |
|
71 | $ echo mq1r1 > f | |
|
72 | $ hg resolve -m f | |
|
73 | $ hg rebase -c | |
|
74 | merging f | |
|
75 | warning: conflicts during merge. | |
|
76 | merging f failed! | |
|
77 | abort: fix unresolved conflicts with hg resolve then run hg rebase --continue | |
|
78 | [255] | |
|
39 | 79 | |
|
40 | hg qnew f2.patch | |
|
41 | echo 'mq2' > f | |
|
42 | hg qref -m 'P1' | |
|
43 | hg glog --template '{rev} {desc} tags: {tags}\n' | |
|
80 | Fix the 2nd conflict: | |
|
81 | ||
|
82 | $ echo mq1r1mq2 > f | |
|
83 | $ hg resolve -m f | |
|
84 | $ hg rebase -c | |
|
85 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
44 | 86 | |
|
45 | echo | |
|
46 | echo '% Rebase - try to rebase on an applied mq patch' | |
|
47 | hg rebase -s 1 -d 3 | |
|
87 | $ hg tglog | |
|
88 | @ 3: 'P1' tags: f2.patch qtip tip | |
|
89 | | | |
|
90 | o 2: 'P0' tags: f.patch qbase | |
|
91 | | | |
|
92 | o 1: 'R1' tags: qparent | |
|
93 | | | |
|
94 | o 0: 'C1' tags: | |
|
95 | ||
|
96 | $ hg up -q qbase | |
|
48 | 97 | |
|
49 | echo | |
|
50 | echo '% Rebase - same thing, but mq patch is default dest' | |
|
51 | hg update -q 1 | |
|
52 | hg rebase | |
|
53 | hg update -q qtip | |
|
98 | $ cat f | |
|
99 | mq1r1 | |
|
54 | 100 | |
|
55 | echo | |
|
56 | echo '% Rebase - generate a conflict' | |
|
57 | hg rebase -s 2 -d 1 | |
|
101 | $ cat .hg/patches/f.patch | |
|
102 | # HG changeset patch | |
|
103 | # User test | |
|
104 | # Date ?????????? ? (glob) | |
|
105 | # Node ID ???????????????????????????????????????? (glob) | |
|
106 | # Parent bac9ed9960d8992bcad75864a879fa76cadaf1b0 | |
|
107 | P0 | |
|
108 | ||
|
109 | diff -r bac9ed9960d8 -r ???????????? f (glob) | |
|
110 | --- a/f Thu Jan 01 00:00:00 1970 +0000 | |
|
111 | +++ b/f ??? ??? ?? ??:??:?? ???? ????? (glob) | |
|
112 | @@ -1,1 +1,1 @@ | |
|
113 | -r1 | |
|
114 | +mq1r1 | |
|
58 | 115 | |
|
59 | echo | |
|
60 | echo '% Fix the 1st conflict' | |
|
61 | echo 'mq1r1' > f | |
|
62 | hg resolve -m f | |
|
63 | hg rebase -c | hidebackup | |
|
116 | Update to qtip: | |
|
117 | ||
|
118 | $ hg up -q qtip | |
|
64 | 119 | |
|
65 | echo | |
|
66 | echo '% Fix the 2nd conflict' | |
|
67 | echo 'mq1r1mq2' > f | |
|
68 | hg resolve -m f | |
|
69 | hg rebase -c | hidebackup | |
|
120 | $ cat f | |
|
121 | mq1r1mq2 | |
|
70 | 122 | |
|
71 | hg glog --template '{rev} {desc} tags: {tags}\n' | |
|
123 | $ cat .hg/patches/f2.patch | |
|
124 | # HG changeset patch | |
|
125 | # User test | |
|
126 | # Date ?????????? ? (glob) | |
|
127 | # Node ID ???????????????????????????????????????? (glob) | |
|
128 | # Parent ???????????????????????????????????????? (glob) | |
|
129 | P1 | |
|
130 | ||
|
131 | diff -r ???????????? -r ???????????? f (glob) | |
|
132 | --- a/f ??? ??? ?? ??:??:?? ???? ????? (glob) | |
|
133 | +++ b/f ??? ??? ?? ??:??:?? ???? ????? (glob) | |
|
134 | @@ -1,1 +1,1 @@ | |
|
135 | -mq1r1 | |
|
136 | +mq1r1mq2 | |
|
137 | ||
|
138 | Adding one git-style patch and one normal: | |
|
139 | ||
|
140 | $ hg qpop -a | |
|
141 | popping f2.patch | |
|
142 | popping f.patch | |
|
143 | patch queue now empty | |
|
72 | 144 | |
|
73 | echo | |
|
74 | echo '% Update to qbase' | |
|
75 | hg up qbase | |
|
76 | echo '% f correctly reflects the merge result' | |
|
77 | cat f | |
|
78 | echo '% And the patch is correct' | |
|
79 | cat .hg/patches/f.patch | filterpatch | |
|
145 | $ rm -fr .hg/patches | |
|
146 | $ hg qinit -c | |
|
147 | ||
|
148 | $ hg up -q 0 | |
|
149 | ||
|
150 | $ hg qnew --git f_git.patch | |
|
151 | $ echo mq1 > p | |
|
152 | $ hg add p | |
|
153 | $ hg qref --git -m 'P0 (git)' | |
|
80 | 154 | |
|
81 | echo | |
|
82 | echo '% Update to qtip' | |
|
83 | hg up qtip | |
|
84 | echo '% f correctly reflects the merge result' | |
|
85 | cat f | |
|
86 | echo '% And the patch is correct' | |
|
87 | cat .hg/patches/f2.patch | filterpatch | |
|
155 | $ hg qnew f.patch | |
|
156 | $ echo mq2 > p | |
|
157 | $ hg qref -m P1 | |
|
158 | $ hg qci -m 'save patch state' | |
|
88 | 159 | |
|
89 | echo | |
|
90 | echo '% Adding one git-style patch and one normal' | |
|
91 | hg qpop -a | |
|
92 | rm -fr .hg/patches | |
|
93 | hg qinit -c | |
|
160 | $ hg qseries -s | |
|
161 | f_git.patch: P0 (git) | |
|
162 | f.patch: P1 | |
|
163 | ||
|
164 | $ hg -R .hg/patches manifest | |
|
165 | .hgignore | |
|
166 | f.patch | |
|
167 | f_git.patch | |
|
168 | series | |
|
94 | 169 | |
|
95 | hg up 0 | |
|
96 | hg qnew --git f_git.patch | |
|
97 | echo 'mq1' > p | |
|
98 | hg add p | |
|
99 | hg qref --git -m 'P0 (git)' | |
|
170 | $ cat .hg/patches/f_git.patch | |
|
171 | P0 (git) | |
|
172 | ||
|
173 | diff --git a/p b/p | |
|
174 | new file mode 100644 | |
|
175 | --- /dev/null | |
|
176 | +++ b/p | |
|
177 | @@ -0,0 +1,1 @@ | |
|
178 | +mq1 | |
|
100 | 179 | |
|
101 | hg qnew f.patch | |
|
102 | echo 'mq2' > p | |
|
103 | hg qref -m 'P1' | |
|
104 | hg qcommit -m 'save patch state' | |
|
105 | echo '% patch series step 1/2' | |
|
106 | hg qseries -s | |
|
107 | echo '% patch queue manifest step 1/2' | |
|
108 | hg -R .hg/patches manifest | |
|
180 | $ cat .hg/patches/f.patch | |
|
181 | P1 | |
|
182 | ||
|
183 | diff -r ???????????? p (glob) | |
|
184 | --- a/p ??? ??? ?? ??:??:?? ???? ????? (glob) | |
|
185 | +++ b/p ??? ??? ?? ??:??:?? ???? ????? (glob) | |
|
186 | @@ -1,1 +1,1 @@ | |
|
187 | -mq1 | |
|
188 | +mq2 | |
|
189 | ||
|
109 | 190 | |
|
110 | echo '% Git patch' | |
|
111 | cat .hg/patches/f_git.patch | filterpatch | |
|
191 | Rebase the applied mq patches: | |
|
192 | ||
|
193 | $ hg rebase -s 2 -d 1 | |
|
194 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
195 | ||
|
196 | $ hg qci -m 'save patch state' | |
|
197 | ||
|
198 | $ hg qseries -s | |
|
199 | f_git.patch: P0 (git) | |
|
200 | f.patch: P1 | |
|
112 | 201 | |
|
113 | echo | |
|
114 | echo '% Normal patch' | |
|
115 | cat .hg/patches/f.patch | filterpatch | |
|
202 | $ hg -R .hg/patches manifest | |
|
203 | .hgignore | |
|
204 | f.patch | |
|
205 | f_git.patch | |
|
206 | series | |
|
116 | 207 | |
|
117 | echo | |
|
118 | echo '% Rebase the applied mq patches' | |
|
119 | hg rebase -s 2 -d 1 --quiet | |
|
120 | hg qcommit -m 'save patch state' | |
|
121 | echo '% patch series step 2/2' | |
|
122 | hg qseries -s | |
|
123 | echo '% patch queue manifest step 2/2' | |
|
124 | hg -R .hg/patches manifest | |
|
208 | $ cat .hg/patches/f_git.patch | |
|
209 | # HG changeset patch | |
|
210 | # User test | |
|
211 | # Date ?????????? ? (glob) | |
|
212 | # Node ID ???????????????????????????????????????? (glob) | |
|
213 | # Parent bac9ed9960d8992bcad75864a879fa76cadaf1b0 | |
|
214 | P0 (git) | |
|
215 | ||
|
216 | diff --git a/p b/p | |
|
217 | new file mode 100644 | |
|
218 | --- /dev/null | |
|
219 | +++ b/p | |
|
220 | @@ -0,0 +1,1 @@ | |
|
221 | +mq1 | |
|
125 | 222 | |
|
126 | echo '% And the patches are correct' | |
|
127 | echo '% Git patch' | |
|
128 | cat .hg/patches/f_git.patch | filterpatch | |
|
223 | $ cat .hg/patches/f.patch | |
|
224 | # HG changeset patch | |
|
225 | # User test | |
|
226 | # Date ?????????? ? (glob) | |
|
227 | # Node ID ???????????????????????????????????????? (glob) | |
|
228 | # Parent ???????????????????????????????????????? (glob) | |
|
229 | P1 | |
|
230 | ||
|
231 | diff -r ???????????? -r ???????????? p (glob) | |
|
232 | --- a/p ??? ??? ?? ??:??:?? ???? ????? (glob) | |
|
233 | +++ b/p ??? ??? ?? ??:??:?? ???? ????? (glob) | |
|
234 | @@ -1,1 +1,1 @@ | |
|
235 | -mq1 | |
|
236 | +mq2 | |
|
129 | 237 | |
|
130 | echo | |
|
131 | echo '% Normal patch' | |
|
132 | cat .hg/patches/f.patch | filterpatch | |
|
133 |
@@ -1,33 +1,54 | |||
|
1 | #!/bin/sh | |
|
2 | ||
|
3 | . $TESTDIR/helpers.sh | |
|
1 | $ cat >> $HGRCPATH <<EOF | |
|
2 | > [extensions] | |
|
3 | > graphlog= | |
|
4 | > rebase= | |
|
5 | > | |
|
6 | > [alias] | |
|
7 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" | |
|
8 | > EOF | |
|
4 | 9 | |
|
5 | echo "[extensions]" >> $HGRCPATH | |
|
6 | echo "graphlog=" >> $HGRCPATH | |
|
7 | echo "rebase=" >> $HGRCPATH | |
|
10 | $ hg init repo | |
|
11 | $ cd repo | |
|
8 | 12 | |
|
9 | rm -rf repo | |
|
10 | hg init repo | |
|
11 | cd repo | |
|
13 | $ echo A > a | |
|
14 | $ echo >> a | |
|
15 | $ hg ci -Am A | |
|
16 | adding a | |
|
12 | 17 | |
|
13 |
|
|
|
14 | echo >> a | |
|
15 | hg commit -AmA -u test -d '0 0' | |
|
18 | $ echo B > a | |
|
19 | $ echo >> a | |
|
20 | $ hg ci -m B | |
|
21 | ||
|
22 | $ echo C > a | |
|
23 | $ echo >> a | |
|
24 | $ hg ci -m C | |
|
25 | ||
|
26 | $ hg up -q -C 0 | |
|
16 | 27 | |
|
17 |
|
|
|
18 | echo >> a | |
|
19 | hg commit -mB -u test -d '1 0' | |
|
20 | ||
|
21 | echo C > a | |
|
22 | echo >> a | |
|
23 | hg commit -mC -u test -d '2 0' | |
|
28 | $ echo D >> a | |
|
29 | $ hg ci -Am AD | |
|
30 | created new head | |
|
24 | 31 | |
|
25 | hg up -C 0 | |
|
26 | echo D >> a | |
|
27 | hg commit -AmAD -u test -d '3 0' | |
|
32 | $ hg tglog | |
|
33 | @ 3: 'AD' | |
|
34 | | | |
|
35 | | o 2: 'C' | |
|
36 | | | | |
|
37 | | o 1: 'B' | |
|
38 | |/ | |
|
39 | o 0: 'A' | |
|
40 | ||
|
41 | $ hg rebase -s 1 -d 3 | |
|
42 | merging a | |
|
43 | merging a | |
|
44 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
28 | 45 | |
|
29 | hg glog --template '{rev}:{desc} {node|short}\n' | |
|
30 | hg rebase -q -s 1 -d 3 | hidebackup | |
|
31 | hg glog --template '{rev}:{desc} {node|short}\n' | |
|
32 | ||
|
33 | exit 0 | |
|
46 | $ hg tglog | |
|
47 | @ 3: 'C' | |
|
48 | | | |
|
49 | o 2: 'B' | |
|
50 | | | |
|
51 | o 1: 'AD' | |
|
52 | | | |
|
53 | o 0: 'A' | |
|
54 |
@@ -1,110 +1,332 | |||
|
1 | #!/bin/sh | |
|
1 | $ cat >> $HGRCPATH <<EOF | |
|
2 | > [extensions] | |
|
3 | > graphlog= | |
|
4 | > rebase= | |
|
5 | > | |
|
6 | > [alias] | |
|
7 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" | |
|
8 | > EOF | |
|
9 | ||
|
10 | ||
|
11 | $ hg init a | |
|
12 | $ cd a | |
|
13 | ||
|
14 | $ echo c1 > c1 | |
|
15 | $ hg ci -Am c1 | |
|
16 | adding c1 | |
|
2 | 17 | |
|
3 | . $TESTDIR/helpers.sh | |
|
18 | $ echo c2 > c2 | |
|
19 | $ hg ci -Am c2 | |
|
20 | adding c2 | |
|
21 | ||
|
22 | $ echo c3 > c3 | |
|
23 | $ hg ci -Am c3 | |
|
24 | adding c3 | |
|
4 | 25 | |
|
5 | echo "[extensions]" >> $HGRCPATH | |
|
6 | echo "rebase=" >> $HGRCPATH | |
|
26 | $ hg up -q -C 1 | |
|
27 | ||
|
28 | $ echo l1 > l1 | |
|
29 | $ hg ci -Am l1 | |
|
30 | adding l1 | |
|
31 | created new head | |
|
32 | ||
|
33 | $ echo l2 > l2 | |
|
34 | $ hg ci -Am l2 | |
|
35 | adding l2 | |
|
7 | 36 | |
|
8 | addcommit () { | |
|
9 | echo $1 > $1 | |
|
10 | hg add $1 | |
|
11 | hg commit -d "${2} 0" -m $1 | |
|
12 | } | |
|
37 | $ echo l3 > l3 | |
|
38 | $ hg ci -Am l3 | |
|
39 | adding l3 | |
|
40 | ||
|
41 | $ hg up -q -C 2 | |
|
42 | ||
|
43 | $ echo r1 > r1 | |
|
44 | $ hg ci -Am r1 | |
|
45 | adding r1 | |
|
46 | ||
|
47 | $ echo r2 > r2 | |
|
48 | $ hg ci -Am r2 | |
|
49 | adding r2 | |
|
13 | 50 | |
|
14 | commit () { | |
|
15 | hg commit -d "${2} 0" -m $1 | |
|
16 | } | |
|
51 | $ hg tglog | |
|
52 | @ 7: 'r2' | |
|
53 | | | |
|
54 | o 6: 'r1' | |
|
55 | | | |
|
56 | | o 5: 'l3' | |
|
57 | | | | |
|
58 | | o 4: 'l2' | |
|
59 | | | | |
|
60 | | o 3: 'l1' | |
|
61 | | | | |
|
62 | o | 2: 'c3' | |
|
63 | |/ | |
|
64 | o 1: 'c2' | |
|
65 | | | |
|
66 | o 0: 'c1' | |
|
67 | ||
|
68 | $ cd .. | |
|
17 | 69 | |
|
18 | createrepo () { | |
|
19 | hg init a | |
|
20 | cd a | |
|
21 | addcommit "c1" 0 | |
|
22 | addcommit "c2" 1 | |
|
23 | addcommit "c3" 2 | |
|
70 | ||
|
71 | These fail: | |
|
72 | ||
|
73 | $ hg clone -q -u . a a1 | |
|
74 | $ cd a1 | |
|
75 | ||
|
76 | $ hg rebase --continue --abort | |
|
77 | abort: cannot use both abort and continue | |
|
78 | [255] | |
|
24 | 79 | |
|
25 | hg update -C 1 | |
|
26 | addcommit "l1" 3 | |
|
27 | addcommit "l2" 4 | |
|
28 | addcommit "l3" 5 | |
|
80 | $ hg rebase --continue --collapse | |
|
81 | abort: cannot use collapse with continue or abort | |
|
82 | [255] | |
|
83 | ||
|
84 | $ hg rebase --continue --dest 4 | |
|
85 | abort: abort and continue do not allow specifying revisions | |
|
86 | [255] | |
|
87 | ||
|
88 | $ hg rebase --base 5 --source 4 | |
|
89 | abort: cannot specify both a revision and a base | |
|
90 | [255] | |
|
91 | ||
|
92 | $ hg rebase | |
|
93 | nothing to rebase | |
|
94 | [1] | |
|
29 | 95 | |
|
30 |
|
|
|
31 | addcommit "r1" 6 | |
|
32 | addcommit "r2" 7 | |
|
33 | } | |
|
96 | $ hg up -q 6 | |
|
97 | ||
|
98 | $ hg rebase | |
|
99 | nothing to rebase | |
|
100 | [1] | |
|
101 | ||
|
102 | ||
|
103 | These work: | |
|
104 | ||
|
105 | Rebase with no arguments (from 3 onto 7): | |
|
106 | ||
|
107 | $ hg up -q -C 5 | |
|
108 | ||
|
109 | $ hg rebase | |
|
110 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
34 | 111 | |
|
35 | createrepo > /dev/null 2>&1 | |
|
36 | echo "% These fail" | |
|
37 | echo | |
|
38 | echo "% Use continue and abort" | |
|
39 | hg rebase --continue --abort | |
|
112 | $ hg tglog | |
|
113 | @ 7: 'l3' | |
|
114 | | | |
|
115 | o 6: 'l2' | |
|
116 | | | |
|
117 | o 5: 'l1' | |
|
118 | | | |
|
119 | o 4: 'r2' | |
|
120 | | | |
|
121 | o 3: 'r1' | |
|
122 | | | |
|
123 | o 2: 'c3' | |
|
124 | | | |
|
125 | o 1: 'c2' | |
|
126 | | | |
|
127 | o 0: 'c1' | |
|
128 | ||
|
129 | Try to rollback after a rebase (fail): | |
|
130 | ||
|
131 | $ hg rollback | |
|
132 | no rollback information available | |
|
133 | [1] | |
|
134 | ||
|
135 | $ cd .. | |
|
136 | ||
|
40 | 137 | |
|
41 | echo | |
|
42 | echo "% Use continue and collapse" | |
|
43 | hg rebase --continue --collapse | |
|
138 | Rebase with base == '.' => same as no arguments (from 3 onto 7): | |
|
139 | ||
|
140 | $ hg clone -q -u 5 a a2 | |
|
141 | $ cd a2 | |
|
142 | ||
|
143 | $ hg rebase --base . | |
|
144 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
44 | 145 | |
|
45 | echo | |
|
46 | echo "% Use continue/abort and dest/source" | |
|
47 | hg rebase --continue --dest 4 | |
|
146 | $ hg tglog | |
|
147 | @ 7: 'l3' | |
|
148 | | | |
|
149 | o 6: 'l2' | |
|
150 | | | |
|
151 | o 5: 'l1' | |
|
152 | | | |
|
153 | o 4: 'r2' | |
|
154 | | | |
|
155 | o 3: 'r1' | |
|
156 | | | |
|
157 | o 2: 'c3' | |
|
158 | | | |
|
159 | o 1: 'c2' | |
|
160 | | | |
|
161 | o 0: 'c1' | |
|
162 | ||
|
163 | $ cd .. | |
|
48 | 164 | |
|
49 | echo | |
|
50 | echo "% Use source and base" | |
|
51 | hg rebase --base 5 --source 4 | |
|
52 | 165 | |
|
53 | echo | |
|
54 | echo "% Rebase with no arguments - from current" | |
|
55 | hg rebase | |
|
166 | Rebase with dest == `hg branch` => same as no arguments (from 3 onto 7): | |
|
167 | ||
|
168 | $ hg clone -q -u 5 a a3 | |
|
169 | $ cd a3 | |
|
170 | ||
|
171 | $ hg rebase --dest `hg branch` | |
|
172 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
56 | 173 | |
|
57 | echo | |
|
58 | echo "% Rebase with no arguments - from the current branch" | |
|
59 | hg update 6 | |
|
60 | hg rebase | |
|
174 | $ hg tglog | |
|
175 | @ 7: 'l3' | |
|
176 | | | |
|
177 | o 6: 'l2' | |
|
178 | | | |
|
179 | o 5: 'l1' | |
|
180 | | | |
|
181 | o 4: 'r2' | |
|
182 | | | |
|
183 | o 3: 'r1' | |
|
184 | | | |
|
185 | o 2: 'c3' | |
|
186 | | | |
|
187 | o 1: 'c2' | |
|
188 | | | |
|
189 | o 0: 'c1' | |
|
190 | ||
|
191 | $ cd .. | |
|
192 | ||
|
193 | ||
|
194 | Specify only source (from 4 onto 7): | |
|
195 | ||
|
196 | $ hg clone -q -u . a a4 | |
|
197 | $ cd a4 | |
|
198 | ||
|
199 | $ hg rebase --source 4 | |
|
200 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
61 | 201 | |
|
62 | echo "% ----------" | |
|
63 | echo "% These work" | |
|
64 | echo | |
|
65 | echo "% Rebase with no arguments (from 3 onto 7)" | |
|
66 | hg update -C 5 | |
|
67 | hg rebase 2>&1 | hidebackup | |
|
202 | $ hg tglog | |
|
203 | @ 7: 'l3' | |
|
204 | | | |
|
205 | o 6: 'l2' | |
|
206 | |\ | |
|
207 | | o 5: 'r2' | |
|
208 | | | | |
|
209 | | o 4: 'r1' | |
|
210 | | | | |
|
211 | o | 3: 'l1' | |
|
212 | | | | |
|
213 | | o 2: 'c3' | |
|
214 | |/ | |
|
215 | o 1: 'c2' | |
|
216 | | | |
|
217 | o 0: 'c1' | |
|
218 | ||
|
219 | $ cd .. | |
|
220 | ||
|
221 | ||
|
222 | Specify only dest (from 3 onto 6): | |
|
68 | 223 | |
|
69 | echo "% Try to rollback after a rebase (fail)" | |
|
70 | hg rollback | |
|
224 | $ hg clone -q -u 5 a a5 | |
|
225 | $ cd a5 | |
|
226 | ||
|
227 | $ hg rebase --dest 6 | |
|
228 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
71 | 229 | |
|
72 | createrepo > /dev/null 2>&1 | |
|
73 | echo | |
|
74 | echo "% Rebase with base == '.' => same as no arguments (from 3 onto 7)" | |
|
75 | hg update -C 5 | |
|
76 | hg rebase --base . | hidebackup | |
|
230 | $ hg tglog | |
|
231 | @ 7: 'l3' | |
|
232 | | | |
|
233 | o 6: 'l2' | |
|
234 | | | |
|
235 | o 5: 'l1' | |
|
236 | | | |
|
237 | | o 4: 'r2' | |
|
238 | |/ | |
|
239 | o 3: 'r1' | |
|
240 | | | |
|
241 | o 2: 'c3' | |
|
242 | | | |
|
243 | o 1: 'c2' | |
|
244 | | | |
|
245 | o 0: 'c1' | |
|
246 | ||
|
247 | $ cd .. | |
|
248 | ||
|
77 | 249 | |
|
78 | createrepo > /dev/null 2>&1 | |
|
79 | echo | |
|
80 | echo "% Rebase with dest == `hg branch` => same as no arguments (from 3 onto 7)" | |
|
81 | hg update -C 5 | |
|
82 | hg rebase --dest `hg branch` | hidebackup | |
|
250 | Specify only base (from 3 onto 7): | |
|
251 | ||
|
252 | $ hg clone -q -u . a a6 | |
|
253 | $ cd a6 | |
|
254 | ||
|
255 | $ hg rebase --base 5 | |
|
256 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
83 | 257 | |
|
84 | createrepo > /dev/null 2>&1 | |
|
85 | echo | |
|
86 | echo "% Specify only source (from 4 onto 7)" | |
|
87 | hg rebase --source 4 | hidebackup | |
|
258 | $ hg tglog | |
|
259 | @ 7: 'l3' | |
|
260 | | | |
|
261 | o 6: 'l2' | |
|
262 | | | |
|
263 | o 5: 'l1' | |
|
264 | | | |
|
265 | o 4: 'r2' | |
|
266 | | | |
|
267 | o 3: 'r1' | |
|
268 | | | |
|
269 | o 2: 'c3' | |
|
270 | | | |
|
271 | o 1: 'c2' | |
|
272 | | | |
|
273 | o 0: 'c1' | |
|
274 | ||
|
275 | $ cd .. | |
|
88 | 276 | |
|
89 | createrepo > /dev/null 2>&1 | |
|
90 | echo | |
|
91 | echo "% Specify only dest (from 3 onto 6)" | |
|
92 | hg update -C 5 | |
|
93 | hg rebase --dest 6 | hidebackup | |
|
277 | ||
|
278 | Specify source and dest (from 4 onto 6): | |
|
279 | ||
|
280 | $ hg clone -q -u . a a7 | |
|
281 | $ cd a7 | |
|
282 | ||
|
283 | $ hg rebase --source 4 --dest 6 | |
|
284 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
94 | 285 | |
|
95 | createrepo > /dev/null 2>&1 | |
|
96 | echo | |
|
97 | echo "% Specify only base (from 3 onto 7)" | |
|
98 | hg rebase --base 5 | hidebackup | |
|
286 | $ hg tglog | |
|
287 | @ 7: 'l3' | |
|
288 | | | |
|
289 | o 6: 'l2' | |
|
290 | |\ | |
|
291 | | | o 5: 'r2' | |
|
292 | | |/ | |
|
293 | | o 4: 'r1' | |
|
294 | | | | |
|
295 | o | 3: 'l1' | |
|
296 | | | | |
|
297 | | o 2: 'c3' | |
|
298 | |/ | |
|
299 | o 1: 'c2' | |
|
300 | | | |
|
301 | o 0: 'c1' | |
|
302 | ||
|
303 | $ cd .. | |
|
304 | ||
|
305 | ||
|
306 | Specify base and dest (from 3 onto 6): | |
|
99 | 307 | |
|
100 | createrepo > /dev/null 2>&1 | |
|
101 | echo | |
|
102 | echo "% Specify source and dest (from 4 onto 6)" | |
|
103 |
hg rebase --s |
|
|
308 | $ hg clone -q -u . a a8 | |
|
309 | $ cd a8 | |
|
310 | ||
|
311 | $ hg rebase --base 4 --dest 6 | |
|
312 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
104 | 313 | |
|
105 | createrepo > /dev/null 2>&1 | |
|
106 | echo | |
|
107 | echo "% Specify base and dest (from 3 onto 6)" | |
|
108 | hg rebase --base 4 --dest 6 | hidebackup | |
|
314 | $ hg tglog | |
|
315 | @ 7: 'l3' | |
|
316 | | | |
|
317 | o 6: 'l2' | |
|
318 | | | |
|
319 | o 5: 'l1' | |
|
320 | | | |
|
321 | | o 4: 'r2' | |
|
322 | |/ | |
|
323 | o 3: 'r1' | |
|
324 | | | |
|
325 | o 2: 'c3' | |
|
326 | | | |
|
327 | o 1: 'c2' | |
|
328 | | | |
|
329 | o 0: 'c1' | |
|
330 | ||
|
331 | $ cd .. | |
|
109 | 332 | |
|
110 | exit 0 |
@@ -1,63 +1,113 | |||
|
1 | #!/bin/sh | |
|
1 | $ cat >> $HGRCPATH <<EOF | |
|
2 | > [extensions] | |
|
3 | > graphlog= | |
|
4 | > rebase= | |
|
5 | > | |
|
6 | > [alias] | |
|
7 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" | |
|
8 | > EOF | |
|
2 | 9 | |
|
3 | . $TESTDIR/helpers.sh | |
|
4 | 10 | |
|
5 | echo "[extensions]" >> $HGRCPATH | |
|
6 | echo "graphlog=" >> $HGRCPATH | |
|
7 | echo "rebase=" >> $HGRCPATH | |
|
11 | $ hg init a | |
|
12 | $ cd a | |
|
8 | 13 | |
|
9 | addcommit () { | |
|
10 | echo $1 > $1 | |
|
11 | hg add $1 | |
|
12 | hg commit -d "${2} 0" -m $1 | |
|
13 | } | |
|
14 | $ echo C1 > C1 | |
|
15 | $ hg ci -Am C1 | |
|
16 | adding C1 | |
|
17 | ||
|
18 | $ echo C2 > C2 | |
|
19 | $ hg ci -Am C2 | |
|
20 | adding C2 | |
|
21 | ||
|
22 | $ cd .. | |
|
14 | 23 | |
|
15 | commit () { | |
|
16 | hg commit -d "${2} 0" -m $1 | |
|
17 | } | |
|
24 | $ hg clone a b | |
|
25 | updating to branch default | |
|
26 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
27 | ||
|
28 | $ hg clone a c | |
|
29 | updating to branch default | |
|
30 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
31 | ||
|
32 | $ cd b | |
|
18 | 33 | |
|
19 | rm -rf a | |
|
20 | hg init a | |
|
21 | cd a | |
|
22 | addcommit "C1" 0 | |
|
23 | addcommit "C2" 1 | |
|
34 | $ echo L1 > L1 | |
|
35 | $ hg ci -Am L1 | |
|
36 | adding L1 | |
|
37 | ||
|
38 | ||
|
39 | $ cd ../a | |
|
24 | 40 | |
|
25 | cd .. | |
|
26 | hg clone a b | |
|
27 | # This is needed to test pull --rebase | |
|
28 | hg clone a c | |
|
41 | $ echo R1 > R1 | |
|
42 | $ hg ci -Am R1 | |
|
43 | adding R1 | |
|
29 | 44 | |
|
30 | cd b | |
|
31 | addcommit "L1" 2 | |
|
45 | ||
|
46 | $ cd ../b | |
|
47 | ||
|
48 | Now b has one revision to be pulled from a: | |
|
32 | 49 | |
|
33 | cd ../a | |
|
34 | addcommit "R1" 3 | |
|
50 | $ hg pull --rebase | |
|
51 | pulling from */a (glob) | |
|
52 | searching for changes | |
|
53 | adding changesets | |
|
54 | adding manifests | |
|
55 | adding file changes | |
|
56 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
|
57 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
35 | 58 | |
|
36 | cd ../b | |
|
37 | echo | |
|
38 | echo "% Now b has one revision to be pulled from a" | |
|
39 | hg pull --rebase | hidebackup | sed -e 's/\(pulling from \).*/\1/' | |
|
59 | $ hg tglog | |
|
60 | @ 3: 'L1' | |
|
61 | | | |
|
62 | o 2: 'R1' | |
|
63 | | | |
|
64 | o 1: 'C2' | |
|
65 | | | |
|
66 | o 0: 'C1' | |
|
67 | ||
|
68 | Re-run: | |
|
40 | 69 | |
|
41 | hg glog --template '{rev}:{desc}\n' | |
|
70 | $ hg pull --rebase | |
|
71 | pulling from */a (glob) | |
|
72 | searching for changes | |
|
73 | no changes found | |
|
42 | 74 | |
|
43 | echo | |
|
44 | echo "% Re-run pull --rebase" | |
|
45 | hg pull --rebase | sed 's/\(pulling from \).*/\1/' | |
|
75 | ||
|
76 | Invoke pull --rebase and nothing to rebase: | |
|
77 | ||
|
78 | $ cd ../c | |
|
46 | 79 | |
|
47 | echo | |
|
48 | echo "% Invoke pull --rebase and nothing to rebase" | |
|
49 | cd ../c | |
|
50 | hg pull --rebase 2>&1 | sed 's/\(pulling from \).*/\1/' | |
|
51 | hg glog --template '{rev}\n' -l 1 | |
|
80 | $ hg pull --rebase | |
|
81 | pulling from */a (glob) | |
|
82 | searching for changes | |
|
83 | adding changesets | |
|
84 | adding manifests | |
|
85 | adding file changes | |
|
86 | added 1 changesets with 1 changes to 1 files | |
|
87 | nothing to rebase | |
|
88 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
89 | ||
|
90 | $ hg tglog -l 1 | |
|
91 | @ 2: 'R1' | |
|
92 | | | |
|
93 | ||
|
94 | pull --rebase --update should ignore --update: | |
|
52 | 95 | |
|
53 | echo | |
|
54 | echo "% pull --rebase --update should ignore --update" | |
|
55 | hg pull --rebase --update 2>&1 | sed 's/\(pulling from \).*/\1/' | |
|
96 | $ hg pull --rebase --update | |
|
97 | pulling from */a (glob) | |
|
98 | searching for changes | |
|
99 | no changes found | |
|
100 | ||
|
101 | pull --rebase doesn't update if nothing has been pulled: | |
|
102 | ||
|
103 | $ hg up -q 1 | |
|
56 | 104 | |
|
57 | echo | |
|
58 | echo "% pull --rebase doesn't update if nothing has been pulled" | |
|
59 | hg up 1 | |
|
60 | hg pull --rebase 2>&1 | sed 's/\(pulling from \).*/\1/' | |
|
61 | hg glog --template '{rev}\n' -l 1 | |
|
105 | $ hg pull --rebase | |
|
106 | pulling from */a (glob) | |
|
107 | searching for changes | |
|
108 | no changes found | |
|
62 | 109 | |
|
63 | exit 0 | |
|
110 | $ hg tglog -l 1 | |
|
111 | o 2: 'R1' | |
|
112 | | | |
|
113 |
@@ -1,55 +1,121 | |||
|
1 | #!/bin/sh | |
|
1 | $ cat >> $HGRCPATH <<EOF | |
|
2 | > [extensions] | |
|
3 | > graphlog= | |
|
4 | > rebase= | |
|
5 | > | |
|
6 | > [alias] | |
|
7 | > tlog = log --template "{rev}: '{desc}' {branches}\n" | |
|
8 | > tglog = tlog --graph | |
|
9 | > EOF | |
|
2 | 10 | |
|
3 | . $TESTDIR/helpers.sh | |
|
11 | ||
|
12 | $ hg init a | |
|
13 | $ cd a | |
|
4 | 14 | |
|
5 | echo "[extensions]" >> $HGRCPATH | |
|
6 | echo "rebase=" >> $HGRCPATH | |
|
7 | echo "[diff]" >> $HGRCPATH | |
|
8 | echo "git=1" >> $HGRCPATH | |
|
15 | $ echo a > a | |
|
16 | $ hg ci -Am A | |
|
17 | adding a | |
|
9 | 18 | |
|
10 | BASE=`pwd` | |
|
19 | $ echo b > b | |
|
20 | $ hg ci -Am B | |
|
21 | adding b | |
|
22 | ||
|
23 | $ hg up -q -C 0 | |
|
24 | ||
|
25 | $ hg mv a a-renamed | |
|
26 | ||
|
27 | $ hg ci -m 'rename A' | |
|
28 | created new head | |
|
11 | 29 | |
|
12 | hg init repo1 | |
|
13 | cd repo1 | |
|
14 | echo "a">a | |
|
15 | hg commit -Am "A" --date '0 0' | |
|
16 | echo "b"> b | |
|
17 | hg commit -Am "B" --date '1 0' | |
|
18 | hg up -C 0 | |
|
19 | hg mv a a-renamed | |
|
20 | hg commit -m 'rename A' --date '2 0' | |
|
30 | $ hg tglog | |
|
31 | @ 2: 'rename A' | |
|
32 | | | |
|
33 | | o 1: 'B' | |
|
34 | |/ | |
|
35 | o 0: 'A' | |
|
36 | ||
|
37 | ||
|
38 | Rename is tracked: | |
|
21 | 39 | |
|
22 | echo | |
|
23 | echo '% Rename is tracked' | |
|
24 | hg log -p -r tip --template '{rev}:{desc}\n' | |
|
40 | $ hg tlog -p --git -r tip | |
|
41 | 2: 'rename A' | |
|
42 | diff --git a/a b/a-renamed | |
|
43 | rename from a | |
|
44 | rename to a-renamed | |
|
45 | ||
|
46 | Rebase the revision containing the rename: | |
|
25 | 47 | |
|
26 | echo '% Rebase the revision containing the rename' | |
|
27 | hg rebase -s 2 -d 1 --quiet | cleanrebase | |
|
48 | $ hg rebase -s 2 -d 1 | |
|
49 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
50 | ||
|
51 | $ hg tglog | |
|
52 | @ 2: 'rename A' | |
|
53 | | | |
|
54 | o 1: 'B' | |
|
55 | | | |
|
56 | o 0: 'A' | |
|
57 | ||
|
58 | ||
|
59 | Rename is not lost: | |
|
28 | 60 | |
|
29 | echo | |
|
30 | echo '% Rename is not lost' | |
|
31 | hg log -p -r tip --template '{rev}:{desc}\n' | |
|
61 | $ hg tlog -p --git -r tip | |
|
62 | 2: 'rename A' | |
|
63 | diff --git a/a b/a-renamed | |
|
64 | rename from a | |
|
65 | rename to a-renamed | |
|
66 | ||
|
67 | $ cd .. | |
|
68 | ||
|
69 | ||
|
70 | $ hg init b | |
|
71 | $ cd b | |
|
72 | ||
|
73 | $ echo a > a | |
|
74 | $ hg ci -Am A | |
|
75 | adding a | |
|
76 | ||
|
77 | $ echo b > b | |
|
78 | $ hg ci -Am B | |
|
79 | adding b | |
|
80 | ||
|
81 | $ hg up -q -C 0 | |
|
82 | ||
|
83 | $ hg cp a a-copied | |
|
84 | $ hg ci -m 'copy A' | |
|
85 | created new head | |
|
32 | 86 | |
|
33 | cd $BASE | |
|
34 | rm -rf repo1 | |
|
35 | hg init repo1 | |
|
36 | cd repo1 | |
|
37 | echo "a">a | |
|
38 | hg commit -Am "A" --date '0 0' | |
|
39 | echo "b"> b | |
|
40 | hg commit -Am "B" --date '1 0' | |
|
41 | hg up -C 0 | |
|
42 | hg cp a a-copied | |
|
43 | hg commit -m 'copy A' --date '2 0' | |
|
87 | $ hg tglog | |
|
88 | @ 2: 'copy A' | |
|
89 | | | |
|
90 | | o 1: 'B' | |
|
91 | |/ | |
|
92 | o 0: 'A' | |
|
93 | ||
|
94 | Copy is tracked: | |
|
95 | ||
|
96 | $ hg tlog -p --git -r tip | |
|
97 | 2: 'copy A' | |
|
98 | diff --git a/a b/a-copied | |
|
99 | copy from a | |
|
100 | copy to a-copied | |
|
101 | ||
|
102 | Rebase the revision containing the copy: | |
|
44 | 103 | |
|
45 | echo | |
|
46 | echo '% Copy is tracked' | |
|
47 | hg log -p -r tip --template '{rev}:{desc}\n' | |
|
104 | $ hg rebase -s 2 -d 1 | |
|
105 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
48 | 106 | |
|
49 | echo '% Rebase the revision containing the copy' | |
|
50 | hg rebase -s 2 -d 1 --quiet | cleanrebase | |
|
107 | $ hg tglog | |
|
108 | @ 2: 'copy A' | |
|
109 | | | |
|
110 | o 1: 'B' | |
|
111 | | | |
|
112 | o 0: 'A' | |
|
113 | ||
|
114 | Copy is not lost: | |
|
51 | 115 | |
|
52 | echo | |
|
53 | echo '% Copy is not lost' | |
|
54 | hg log -p -r tip --template '{rev}:{desc}\n' | |
|
55 | ||
|
116 | $ hg tlog -p --git -r tip | |
|
117 | 2: 'copy A' | |
|
118 | diff --git a/a b/a-copied | |
|
119 | copy from a | |
|
120 | copy to a-copied | |
|
121 |
@@ -1,93 +1,249 | |||
|
1 | #!/bin/sh | |
|
1 | $ cat >> $HGRCPATH <<EOF | |
|
2 | > [extensions] | |
|
3 | > graphlog= | |
|
4 | > rebase= | |
|
5 | > | |
|
6 | > [alias] | |
|
7 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" | |
|
8 | > EOF | |
|
2 | 9 | |
|
3 | . $TESTDIR/helpers.sh | |
|
10 | ||
|
11 | $ hg init a | |
|
12 | $ cd a | |
|
4 | 13 | |
|
5 | echo "[extensions]" >> $HGRCPATH | |
|
6 | echo "graphlog=" >> $HGRCPATH | |
|
7 | echo "rebase=" >> $HGRCPATH | |
|
14 | $ echo A > A | |
|
15 | $ hg ci -Am A | |
|
16 | adding A | |
|
8 | 17 | |
|
9 | BASE=`pwd` | |
|
18 | $ echo B > B | |
|
19 | $ hg ci -Am B | |
|
20 | adding B | |
|
21 | ||
|
22 | $ hg up -q -C 0 | |
|
23 | ||
|
24 | $ echo C > C | |
|
25 | $ hg ci -Am C | |
|
26 | adding C | |
|
27 | created new head | |
|
10 | 28 | |
|
11 | addcommit () { | |
|
12 | echo $1 > $1 | |
|
13 | hg add $1 | |
|
14 | hg commit -d "${2} 0" -m $1 | |
|
15 | } | |
|
29 | $ hg up -q -C 0 | |
|
30 | ||
|
31 | $ echo D > D | |
|
32 | $ hg ci -Am D | |
|
33 | adding D | |
|
34 | created new head | |
|
35 | ||
|
36 | $ hg merge -r 2 | |
|
37 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
38 | (branch merge, don't forget to commit) | |
|
39 | ||
|
40 | $ hg ci -m E | |
|
16 | 41 | |
|
17 | commit () { | |
|
18 | hg commit -d "${2} 0" -m $1 | |
|
19 | } | |
|
42 | $ hg up -q -C 3 | |
|
43 | ||
|
44 | $ echo F > F | |
|
45 | $ hg ci -Am F | |
|
46 | adding F | |
|
47 | created new head | |
|
48 | ||
|
49 | $ cd .. | |
|
50 | ||
|
51 | ||
|
52 | Rebasing | |
|
53 | B onto F - simple rebase: | |
|
54 | ||
|
55 | $ hg clone -q -u . a a1 | |
|
56 | $ cd a1 | |
|
20 | 57 | |
|
21 | createrepo () { | |
|
22 | cd $BASE | |
|
23 | rm -rf a | |
|
24 | hg init a | |
|
25 | cd a | |
|
26 | addcommit "A" 0 | |
|
27 | addcommit "B" 1 | |
|
58 | $ hg tglog | |
|
59 | @ 5: 'F' | |
|
60 | | | |
|
61 | | o 4: 'E' | |
|
62 | |/| | |
|
63 | o | 3: 'D' | |
|
64 | | | | |
|
65 | | o 2: 'C' | |
|
66 | |/ | |
|
67 | | o 1: 'B' | |
|
68 | |/ | |
|
69 | o 0: 'A' | |
|
70 | ||
|
71 | $ hg rebase -s 1 -d 5 | |
|
72 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
28 | 73 | |
|
29 | hg update -C 0 | |
|
30 | addcommit "C" 2 | |
|
74 | $ hg tglog | |
|
75 | @ 5: 'B' | |
|
76 | | | |
|
77 | o 4: 'F' | |
|
78 | | | |
|
79 | | o 3: 'E' | |
|
80 | |/| | |
|
81 | o | 2: 'D' | |
|
82 | | | | |
|
83 | | o 1: 'C' | |
|
84 | |/ | |
|
85 | o 0: 'A' | |
|
86 | ||
|
87 | $ cd .. | |
|
88 | ||
|
31 | 89 | |
|
32 | hg update -C 0 | |
|
33 | addcommit "D" 3 | |
|
90 | B onto D - intermediate point: | |
|
34 | 91 | |
|
35 | hg merge -r 2 | |
|
36 | commit "E" 4 | |
|
92 | $ hg clone -q -u . a a2 | |
|
93 | $ cd a2 | |
|
94 | ||
|
95 | $ hg rebase -s 1 -d 3 | |
|
96 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
37 | 97 | |
|
38 | hg update -C 3 | |
|
39 | addcommit "F" 5 | |
|
40 | } | |
|
98 | $ hg tglog | |
|
99 | @ 5: 'B' | |
|
100 | | | |
|
101 | | o 4: 'F' | |
|
102 | |/ | |
|
103 | | o 3: 'E' | |
|
104 | |/| | |
|
105 | o | 2: 'D' | |
|
106 | | | | |
|
107 | | o 1: 'C' | |
|
108 | |/ | |
|
109 | o 0: 'A' | |
|
110 | ||
|
111 | $ cd .. | |
|
41 | 112 | |
|
42 | createrepo > /dev/null 2>&1 | |
|
43 | hg glog --template '{rev}: {desc}\n' | |
|
113 | ||
|
114 | C onto F - skip of E: | |
|
115 | ||
|
116 | $ hg clone -q -u . a a3 | |
|
117 | $ cd a3 | |
|
118 | ||
|
119 | $ hg rebase -s 2 -d 5 | |
|
120 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
44 | 121 | |
|
45 | echo '% Rebasing' | |
|
46 | echo '% B onto F - simple rebase' | |
|
47 | hg rebase -s 1 -d 5 | hidebackup | |
|
48 | hg glog --template '{rev}: {desc}\n' | |
|
122 | $ hg tglog | |
|
123 | @ 4: 'C' | |
|
124 | | | |
|
125 | o 3: 'F' | |
|
126 | | | |
|
127 | o 2: 'D' | |
|
128 | | | |
|
129 | | o 1: 'B' | |
|
130 | |/ | |
|
131 | o 0: 'A' | |
|
132 | ||
|
133 | $ cd .. | |
|
49 | 134 | |
|
50 | createrepo > /dev/null 2>&1 | |
|
51 | echo '% B onto D - intermediate point' | |
|
52 | hg rebase -s 1 -d 3 | hidebackup | |
|
53 | hg glog --template '{rev}: {desc}\n' | |
|
135 | ||
|
136 | D onto C - rebase of a branching point (skip E): | |
|
137 | ||
|
138 | $ hg clone -q -u . a a4 | |
|
139 | $ cd a4 | |
|
140 | ||
|
141 | $ hg rebase -s 3 -d 2 | |
|
142 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
54 | 143 | |
|
55 | createrepo > /dev/null 2>&1 | |
|
56 | echo '% C onto F - skip of E' | |
|
57 | hg rebase -s 2 -d 5 | hidebackup | |
|
58 | hg glog --template '{rev}: {desc}\n' | |
|
144 | $ hg tglog | |
|
145 | @ 4: 'F' | |
|
146 | | | |
|
147 | o 3: 'D' | |
|
148 | | | |
|
149 | o 2: 'C' | |
|
150 | | | |
|
151 | | o 1: 'B' | |
|
152 | |/ | |
|
153 | o 0: 'A' | |
|
154 | ||
|
155 | $ cd .. | |
|
156 | ||
|
157 | ||
|
158 | E onto F - merged revision having a parent in ancestors of target: | |
|
159 | ||
|
160 | $ hg clone -q -u . a a5 | |
|
161 | $ cd a5 | |
|
59 | 162 | |
|
60 | createrepo > /dev/null 2>&1 | |
|
61 | echo '% D onto C - rebase of a branching point (skip E)' | |
|
62 | hg rebase -s 3 -d 2 | hidebackup | |
|
63 | hg glog --template '{rev}: {desc}\n' | |
|
163 | $ hg rebase -s 4 -d 5 | |
|
164 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
64 | 165 | |
|
65 | createrepo > /dev/null 2>&1 | |
|
66 | echo '% E onto F - merged revision having a parent in ancestors of target' | |
|
67 | hg rebase -s 4 -d 5 | hidebackup | |
|
68 | hg glog --template '{rev}: {desc}\n' | |
|
166 | $ hg tglog | |
|
167 | @ 5: 'E' | |
|
168 | |\ | |
|
169 | | o 4: 'F' | |
|
170 | | | | |
|
171 | | o 3: 'D' | |
|
172 | | | | |
|
173 | o | 2: 'C' | |
|
174 | |/ | |
|
175 | | o 1: 'B' | |
|
176 | |/ | |
|
177 | o 0: 'A' | |
|
178 | ||
|
179 | $ cd .. | |
|
180 | ||
|
181 | ||
|
182 | D onto B - E maintains C as parent: | |
|
69 | 183 | |
|
70 | createrepo > /dev/null 2>&1 | |
|
71 | echo '% D onto B - E maintains C as parent' | |
|
72 | hg rebase -s 3 -d 1 | hidebackup | |
|
73 | hg glog --template '{rev}: {desc}\n' | |
|
184 | $ hg clone -q -u . a a6 | |
|
185 | $ cd a6 | |
|
186 | ||
|
187 | $ hg rebase -s 3 -d 1 | |
|
188 | saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) | |
|
189 | ||
|
190 | $ hg tglog | |
|
191 | @ 5: 'F' | |
|
192 | | | |
|
193 | | o 4: 'E' | |
|
194 | |/| | |
|
195 | o | 3: 'D' | |
|
196 | | | | |
|
197 | | o 2: 'C' | |
|
198 | | | | |
|
199 | o | 1: 'B' | |
|
200 | |/ | |
|
201 | o 0: 'A' | |
|
202 | ||
|
203 | $ cd .. | |
|
204 | ||
|
205 | ||
|
206 | These will fail (using --source): | |
|
207 | ||
|
208 | E onto D - rebase onto an ancestor: | |
|
209 | ||
|
210 | $ hg clone -q -u . a a7 | |
|
211 | $ cd a7 | |
|
212 | ||
|
213 | $ hg rebase -s 4 -d 3 | |
|
214 | abort: source is descendant of destination | |
|
215 | [255] | |
|
74 | 216 | |
|
75 | echo '% These will fail (using --source)' | |
|
76 | createrepo > /dev/null 2>&1 | |
|
77 | echo '% E onto D - rebase onto an ancestor' | |
|
78 | hg rebase -s 4 -d 3 | |
|
79 | echo '% D onto E - rebase onto a descendant' | |
|
80 | hg rebase -s 3 -d 4 | |
|
81 |
|
|
|
82 | hg rebase -s 4 -d 1 | |
|
217 | D onto E - rebase onto a descendant: | |
|
218 | ||
|
219 | $ hg rebase -s 3 -d 4 | |
|
220 | abort: source is ancestor of destination | |
|
221 | [255] | |
|
222 | ||
|
223 | E onto B - merge revision with both parents not in ancestors of target: | |
|
224 | ||
|
225 | $ hg rebase -s 4 -d 1 | |
|
226 | abort: cannot use revision 4 as base, result would have 3 parents | |
|
227 | [255] | |
|
228 | ||
|
229 | ||
|
230 | These will abort gracefully (using --base): | |
|
231 | ||
|
232 | E onto E - rebase onto same changeset: | |
|
83 | 233 | |
|
84 | echo | |
|
85 | echo '% These will abort gracefully (using --base)' | |
|
86 | echo '% E onto E - rebase onto same changeset' | |
|
87 | hg rebase -b 4 -d 4 | |
|
88 |
|
|
|
89 | hg rebase -b 4 -d 3 | |
|
90 | echo '% D onto E - rebase onto a descendant' | |
|
91 | hg rebase -b 3 -d 4 | |
|
234 | $ hg rebase -b 4 -d 4 | |
|
235 | nothing to rebase | |
|
236 | [1] | |
|
237 | ||
|
238 | E onto D - rebase onto an ancestor: | |
|
92 | 239 | |
|
93 | exit 0 | |
|
240 | $ hg rebase -b 4 -d 3 | |
|
241 | nothing to rebase | |
|
242 | [1] | |
|
243 | ||
|
244 | D onto E - rebase onto a descendant: | |
|
245 | ||
|
246 | $ hg rebase -b 3 -d 4 | |
|
247 | nothing to rebase | |
|
248 | [1] | |
|
249 |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now