Show More
|
1 | NO CONTENT: modified file, binary diff hidden |
@@ -2,21 +2,41 b'' | |||
|
2 | 2 | hg init rebase |
|
3 | 3 | cd rebase |
|
4 | 4 | |
|
5 | # @ 7: 'H' | |
|
6 | # | | |
|
7 | # | o 6: 'G' | |
|
8 | # |/| | |
|
9 | # o | 5: 'F' | |
|
10 | # | | | |
|
11 | # | o 4: 'E' | |
|
12 | # |/ | |
|
13 | # | o 3: 'D' | |
|
14 | # | | | |
|
15 | # | o 2: 'C' | |
|
16 | # | | | |
|
17 | # | o 1: 'B' | |
|
18 | # |/ | |
|
19 | # o 0: 'A' | |
|
20 | ||
|
5 | 21 | echo A > A |
|
6 | 22 | hg ci -Am A |
|
7 | 23 | echo B > B |
|
8 | 24 | hg ci -Am B |
|
9 | hg up -q -C 0 | |
|
10 | 25 | echo C > C |
|
11 | 26 | hg ci -Am C |
|
12 | hg up -q -C 0 | |
|
13 | 27 | echo D > D |
|
14 | 28 | hg ci -Am D |
|
15 | hg merge -r 2 | |
|
16 | hg ci -m E | |
|
17 | hg up -q -C 3 | |
|
29 | hg up -q -C 0 | |
|
30 | echo E > E | |
|
31 | hg ci -Am E | |
|
32 | hg up -q -C 0 | |
|
18 | 33 | echo F > F |
|
19 | 34 | hg ci -Am F |
|
35 | hg merge -r 4 | |
|
36 | hg ci -m G | |
|
37 | hg up -q -C 5 | |
|
38 | echo H > H | |
|
39 | hg ci -Am H | |
|
20 | 40 | |
|
21 | 41 | hg bundle -a ../rebase.hg |
|
22 | 42 |
@@ -11,45 +11,14 b' Create repo a:' | |||
|
11 | 11 | |
|
12 | 12 | $ hg init a |
|
13 | 13 | $ cd a |
|
14 | ||
|
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 | |
|
29 | ||
|
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 | |
|
14 | $ hg unbundle $TESTDIR/bundles/rebase.hg | |
|
15 | adding changesets | |
|
16 | adding manifests | |
|
17 | adding file changes | |
|
18 | added 8 changesets with 7 changes to 7 files (+2 heads) | |
|
19 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
|
20 | $ hg up tip | |
|
21 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
53 | 22 | |
|
54 | 23 | $ hg tglog |
|
55 | 24 | @ 7: 'H' |
@@ -13,7 +13,7 b'' | |||
|
13 | 13 | adding changesets |
|
14 | 14 | adding manifests |
|
15 | 15 | adding file changes |
|
16 |
added |
|
|
16 | added 8 changesets with 7 changes to 7 files (+2 heads) | |
|
17 | 17 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
18 | 18 | $ hg up tip |
|
19 | 19 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
@@ -36,34 +36,42 b' Rebasing descendant onto ancestor across' | |||
|
36 | 36 | $ hg ci -m 'extra named branch' |
|
37 | 37 | |
|
38 | 38 | $ hg tglog |
|
39 |
@ |
|
|
39 | @ 8: 'extra named branch' dev | |
|
40 | 40 | | |
|
41 |
o |
|
|
41 | o 7: 'H' | |
|
42 | 42 | | |
|
43 |
| o |
|
|
43 | | o 6: 'G' | |
|
44 | 44 | |/| |
|
45 |
o | |
|
|
45 | o | 5: 'F' | |
|
46 | | | | |
|
47 | | o 4: 'E' | |
|
48 | |/ | |
|
49 | | o 3: 'D' | |
|
46 | 50 | | | |
|
47 | 51 | | o 2: 'C' |
|
48 |
| |
|
|
52 | | | | |
|
49 | 53 | | o 1: 'B' |
|
50 | 54 | |/ |
|
51 | 55 | o 0: 'A' |
|
52 | 56 | |
|
53 |
$ hg rebase -s |
|
|
57 | $ hg rebase -s 8 -d 7 | |
|
54 | 58 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob) |
|
55 | 59 | |
|
56 | 60 | $ hg tglog |
|
57 |
@ |
|
|
61 | @ 8: 'extra named branch' | |
|
58 | 62 | | |
|
59 |
o |
|
|
63 | o 7: 'H' | |
|
60 | 64 | | |
|
61 |
| o |
|
|
65 | | o 6: 'G' | |
|
62 | 66 | |/| |
|
63 |
o | |
|
|
67 | o | 5: 'F' | |
|
68 | | | | |
|
69 | | o 4: 'E' | |
|
70 | |/ | |
|
71 | | o 3: 'D' | |
|
64 | 72 | | | |
|
65 | 73 | | o 2: 'C' |
|
66 |
| |
|
|
74 | | | | |
|
67 | 75 | | o 1: 'B' |
|
68 | 76 | |/ |
|
69 | 77 | o 0: 'A' |
@@ -76,28 +84,31 b' Rebasing descendant onto ancestor across' | |||
|
76 | 84 | |
|
77 | 85 | $ cd a2 |
|
78 | 86 | |
|
79 |
$ echo |
|
|
87 | $ echo I > I | |
|
80 | 88 | |
|
81 |
$ hg |
|
|
82 | ||
|
83 | $ hg ci -m 'G' | |
|
89 | $ hg ci -AmI | |
|
90 | adding I | |
|
84 | 91 | |
|
85 | 92 | $ hg tglog |
|
86 |
@ |
|
|
93 | @ 8: 'I' | |
|
87 | 94 | | |
|
88 |
o |
|
|
95 | o 7: 'H' | |
|
89 | 96 | | |
|
90 |
| o |
|
|
97 | | o 6: 'G' | |
|
91 | 98 | |/| |
|
92 |
o | |
|
|
99 | o | 5: 'F' | |
|
100 | | | | |
|
101 | | o 4: 'E' | |
|
102 | |/ | |
|
103 | | o 3: 'D' | |
|
93 | 104 | | | |
|
94 | 105 | | o 2: 'C' |
|
95 |
| |
|
|
106 | | | | |
|
96 | 107 | | o 1: 'B' |
|
97 | 108 | |/ |
|
98 | 109 | o 0: 'A' |
|
99 | 110 | |
|
100 |
$ hg rebase -s |
|
|
111 | $ hg rebase -s 8 -d 7 | |
|
101 | 112 | abort: source is descendant of destination |
|
102 | 113 | [255] |
|
103 | 114 | |
@@ -119,21 +130,25 b' Rebasing ancestor onto descendant across' | |||
|
119 | 130 | $ hg ci -m 'extra named branch' |
|
120 | 131 | |
|
121 | 132 | $ hg tglog |
|
122 |
@ |
|
|
133 | @ 8: 'extra named branch' dev | |
|
123 | 134 | | |
|
124 |
o |
|
|
135 | o 7: 'H' | |
|
125 | 136 | | |
|
126 |
| o |
|
|
137 | | o 6: 'G' | |
|
127 | 138 | |/| |
|
128 |
o | |
|
|
139 | o | 5: 'F' | |
|
140 | | | | |
|
141 | | o 4: 'E' | |
|
142 | |/ | |
|
143 | | o 3: 'D' | |
|
129 | 144 | | | |
|
130 | 145 | | o 2: 'C' |
|
131 |
| |
|
|
146 | | | | |
|
132 | 147 | | o 1: 'B' |
|
133 | 148 | |/ |
|
134 | 149 | o 0: 'A' |
|
135 | 150 | |
|
136 |
$ hg rebase -s |
|
|
151 | $ hg rebase -s 7 -d 8 | |
|
137 | 152 | abort: source is ancestor of destination |
|
138 | 153 | [255] |
|
139 | 154 |
@@ -14,7 +14,7 b'' | |||
|
14 | 14 | adding changesets |
|
15 | 15 | adding manifests |
|
16 | 16 | adding file changes |
|
17 |
added |
|
|
17 | added 8 changesets with 7 changes to 7 files (+2 heads) | |
|
18 | 18 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
19 | 19 | $ hg up tip |
|
20 | 20 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
@@ -22,82 +22,99 b'' | |||
|
22 | 22 | |
|
23 | 23 | |
|
24 | 24 | Rebasing |
|
25 |
|
|
|
25 | D onto H - simple rebase: | |
|
26 | 26 | |
|
27 | 27 | $ hg clone -q -u . a a1 |
|
28 | 28 | $ cd a1 |
|
29 | 29 | |
|
30 | 30 | $ hg tglog |
|
31 |
@ |
|
|
31 | @ 7: 'H' | |
|
32 | 32 | | |
|
33 | | o 6: 'G' | |
|
34 | |/| | |
|
35 | o | 5: 'F' | |
|
36 | | | | |
|
33 | 37 | | o 4: 'E' |
|
34 |
|/ |
|
|
35 |
o |
|
|
38 | |/ | |
|
39 | | o 3: 'D' | |
|
36 | 40 | | | |
|
37 | 41 | | o 2: 'C' |
|
38 |
| |
|
|
42 | | | | |
|
39 | 43 | | o 1: 'B' |
|
40 | 44 | |/ |
|
41 | 45 | o 0: 'A' |
|
42 | 46 | |
|
43 | $ hg rebase -s 1 -d 5 | |
|
47 | ||
|
48 | $ hg rebase -s 3 -d 7 | |
|
44 | 49 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob) |
|
45 | 50 | |
|
46 | 51 | $ hg tglog |
|
47 |
@ |
|
|
48 | | | |
|
49 |
|
|
|
50 | | | |
|
51 | | o 3: 'E' | |
|
52 | |/| | |
|
53 | o | 2: 'D' | |
|
52 | @ 7: 'D' | |
|
53 | |\ | |
|
54 | | o 6: 'H' | |
|
54 | 55 | | | |
|
55 |
| o |
|
|
56 | | | o 5: 'G' | |
|
57 | | |/| | |
|
58 | | o | 4: 'F' | |
|
59 | | | | | |
|
60 | | | o 3: 'E' | |
|
61 | | |/ | |
|
62 | o | 2: 'C' | |
|
63 | | | | |
|
64 | o | 1: 'B' | |
|
56 | 65 | |/ |
|
57 | 66 | o 0: 'A' |
|
58 | 67 | |
|
59 | 68 | $ cd .. |
|
60 | 69 | |
|
61 | 70 | |
|
62 |
|
|
|
71 | D onto F - intermediate point: | |
|
63 | 72 | |
|
64 | 73 | $ hg clone -q -u . a a2 |
|
65 | 74 | $ cd a2 |
|
66 | 75 | |
|
67 |
$ hg rebase -s |
|
|
76 | $ hg rebase -s 3 -d 5 | |
|
68 | 77 | saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob) |
|
69 | 78 | |
|
70 | 79 | $ hg tglog |
|
71 |
@ |
|
|
72 | | | |
|
73 |
|
|
|
74 | |/ | |
|
75 |
| o |
|
|
76 | |/| | |
|
77 |
o | |
|
|
80 | @ 7: 'D' | |
|
81 | |\ | |
|
82 | | | o 6: 'H' | |
|
83 | | |/ | |
|
84 | | | o 5: 'G' | |
|
85 | | |/| | |
|
86 | | o | 4: 'F' | |
|
87 | | | | | |
|
88 | | | o 3: 'E' | |
|
89 | | |/ | |
|
90 | o | 2: 'C' | |
|
78 | 91 | | | |
|
79 |
| |
|
|
92 | o | 1: 'B' | |
|
80 | 93 | |/ |
|
81 | 94 | o 0: 'A' |
|
82 | 95 | |
|
83 | 96 | $ cd .. |
|
84 | 97 | |
|
85 | 98 | |
|
86 |
|
|
|
99 | E onto H - skip of G: | |
|
87 | 100 | |
|
88 | 101 | $ hg clone -q -u . a a3 |
|
89 | 102 | $ cd a3 |
|
90 | 103 | |
|
91 |
$ hg rebase -s |
|
|
104 | $ hg rebase -s 4 -d 7 | |
|
92 | 105 | saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob) |
|
93 | 106 | |
|
94 | 107 | $ hg tglog |
|
95 |
@ |
|
|
108 | @ 6: 'E' | |
|
109 | | | |
|
110 | o 5: 'H' | |
|
96 | 111 | | |
|
97 |
o |
|
|
112 | o 4: 'F' | |
|
98 | 113 | | |
|
99 |
o |
|
|
100 | | | |
|
114 | | o 3: 'D' | |
|
115 | | | | |
|
116 | | o 2: 'C' | |
|
117 | | | | |
|
101 | 118 | | o 1: 'B' |
|
102 | 119 | |/ |
|
103 | 120 | o 0: 'A' |
@@ -105,21 +122,25 b' C onto F - skip of E:' | |||
|
105 | 122 | $ cd .. |
|
106 | 123 | |
|
107 | 124 | |
|
108 |
|
|
|
125 | F onto E - rebase of a branching point (skip G): | |
|
109 | 126 | |
|
110 | 127 | $ hg clone -q -u . a a4 |
|
111 | 128 | $ cd a4 |
|
112 | 129 | |
|
113 |
$ hg rebase -s |
|
|
130 | $ hg rebase -s 5 -d 4 | |
|
114 | 131 | saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob) |
|
115 | 132 | |
|
116 | 133 | $ hg tglog |
|
117 |
@ |
|
|
134 | @ 6: 'H' | |
|
135 | | | |
|
136 | o 5: 'F' | |
|
118 | 137 | | |
|
119 |
o |
|
|
138 | o 4: 'E' | |
|
120 | 139 | | |
|
121 |
o |
|
|
122 | | | |
|
140 | | o 3: 'D' | |
|
141 | | | | |
|
142 | | o 2: 'C' | |
|
143 | | | | |
|
123 | 144 | | o 1: 'B' |
|
124 | 145 | |/ |
|
125 | 146 | o 0: 'A' |
@@ -127,23 +148,27 b' D onto C - rebase of a branching point (' | |||
|
127 | 148 | $ cd .. |
|
128 | 149 | |
|
129 | 150 | |
|
130 |
|
|
|
151 | G onto H - merged revision having a parent in ancestors of target: | |
|
131 | 152 | |
|
132 | 153 | $ hg clone -q -u . a a5 |
|
133 | 154 | $ cd a5 |
|
134 | 155 | |
|
135 |
$ hg rebase -s |
|
|
156 | $ hg rebase -s 6 -d 7 | |
|
136 | 157 | saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob) |
|
137 | 158 | |
|
138 | 159 | $ hg tglog |
|
139 |
@ |
|
|
160 | @ 7: 'G' | |
|
140 | 161 | |\ |
|
141 |
| o |
|
|
162 | | o 6: 'H' | |
|
142 | 163 | | | |
|
164 | | o 5: 'F' | |
|
165 | | | | |
|
166 | o | 4: 'E' | |
|
167 | |/ | |
|
143 | 168 | | o 3: 'D' |
|
144 | 169 | | | |
|
145 |
o |
|
|
146 |
| |
|
|
170 | | o 2: 'C' | |
|
171 | | | | |
|
147 | 172 | | o 1: 'B' |
|
148 | 173 | |/ |
|
149 | 174 | o 0: 'A' |
@@ -151,22 +176,26 b' E onto F - merged revision having a pare' | |||
|
151 | 176 | $ cd .. |
|
152 | 177 | |
|
153 | 178 | |
|
154 |
|
|
|
179 | F onto B - G maintains E as parent: | |
|
155 | 180 | |
|
156 | 181 | $ hg clone -q -u . a a6 |
|
157 | 182 | $ cd a6 |
|
158 | 183 | |
|
159 |
$ hg rebase -s |
|
|
184 | $ hg rebase -s 5 -d 1 | |
|
160 | 185 | saved backup bundle to $TESTTMP/a6/.hg/strip-backup/*-backup.hg (glob) |
|
161 | 186 | |
|
162 | 187 | $ hg tglog |
|
163 |
@ |
|
|
188 | @ 7: 'H' | |
|
164 | 189 | | |
|
165 |
| o |
|
|
190 | | o 6: 'G' | |
|
166 | 191 | |/| |
|
167 |
o | |
|
|
192 | o | 5: 'F' | |
|
193 | | | | |
|
194 | | o 4: 'E' | |
|
168 | 195 | | | |
|
169 |
| o |
|
|
196 | | | o 3: 'D' | |
|
197 | | | | | |
|
198 | +---o 2: 'C' | |
|
170 | 199 | | | |
|
171 | 200 | o | 1: 'B' |
|
172 | 201 | |/ |
@@ -177,45 +206,45 b' D onto B - E maintains C as parent:' | |||
|
177 | 206 | |
|
178 | 207 | These will fail (using --source): |
|
179 | 208 | |
|
180 |
|
|
|
209 | G onto F - rebase onto an ancestor: | |
|
181 | 210 | |
|
182 | 211 | $ hg clone -q -u . a a7 |
|
183 | 212 | $ cd a7 |
|
184 | 213 | |
|
185 |
$ hg rebase -s |
|
|
214 | $ hg rebase -s 6 -d 5 | |
|
186 | 215 | abort: source is descendant of destination |
|
187 | 216 | [255] |
|
188 | 217 | |
|
189 |
|
|
|
218 | F onto G - rebase onto a descendant: | |
|
190 | 219 | |
|
191 |
$ hg rebase -s |
|
|
220 | $ hg rebase -s 5 -d 6 | |
|
192 | 221 | abort: source is ancestor of destination |
|
193 | 222 | [255] |
|
194 | 223 | |
|
195 |
|
|
|
224 | G onto B - merge revision with both parents not in ancestors of target: | |
|
196 | 225 | |
|
197 |
$ hg rebase -s |
|
|
198 |
abort: cannot use revision |
|
|
226 | $ hg rebase -s 6 -d 1 | |
|
227 | abort: cannot use revision 6 as base, result would have 3 parents | |
|
199 | 228 | [255] |
|
200 | 229 | |
|
201 | 230 | |
|
202 | 231 | These will abort gracefully (using --base): |
|
203 | 232 | |
|
204 |
|
|
|
233 | G onto G - rebase onto same changeset: | |
|
205 | 234 | |
|
206 |
$ hg rebase -b |
|
|
235 | $ hg rebase -b 6 -d 6 | |
|
207 | 236 | nothing to rebase |
|
208 | 237 | [1] |
|
209 | 238 | |
|
210 |
|
|
|
239 | G onto F - rebase onto an ancestor: | |
|
211 | 240 | |
|
212 |
$ hg rebase -b |
|
|
241 | $ hg rebase -b 6 -d 5 | |
|
213 | 242 | nothing to rebase |
|
214 | 243 | [1] |
|
215 | 244 | |
|
216 |
|
|
|
245 | F onto G - rebase onto a descendant: | |
|
217 | 246 | |
|
218 |
$ hg rebase -b |
|
|
247 | $ hg rebase -b 5 -d 6 | |
|
219 | 248 | nothing to rebase |
|
220 | 249 | [1] |
|
221 | 250 |
General Comments 0
You need to be logged in to leave comments.
Login now