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