Show More
@@ -1,410 +1,529 b'' | |||||
1 | $ cat >> $HGRCPATH <<EOF |
|
1 | $ cat >> $HGRCPATH <<EOF | |
2 | > [extensions] |
|
2 | > [extensions] | |
3 | > rebase= |
|
3 | > rebase= | |
4 | > |
|
4 | > | |
5 | > [phases] |
|
5 | > [phases] | |
6 | > publish=False |
|
6 | > publish=False | |
7 | > |
|
7 | > | |
8 | > [alias] |
|
8 | > [alias] | |
9 | > tglog = log -G --template "{rev}: {node|short} '{desc}' {branches}\n" |
|
9 | > tglog = log -G --template "{rev}: {node|short} '{desc}' {branches}\n" | |
10 | > EOF |
|
10 | > EOF | |
11 |
|
11 | |||
12 | $ hg init a |
|
12 | $ hg init a | |
13 | $ cd a |
|
13 | $ cd a | |
14 | $ hg unbundle "$TESTDIR/bundles/rebase.hg" |
|
14 | $ hg unbundle "$TESTDIR/bundles/rebase.hg" | |
15 | adding changesets |
|
15 | adding changesets | |
16 | adding manifests |
|
16 | adding manifests | |
17 | adding file changes |
|
17 | adding file changes | |
18 | added 8 changesets with 7 changes to 7 files (+2 heads) |
|
18 | added 8 changesets with 7 changes to 7 files (+2 heads) | |
19 | new changesets cd010b8cd998:02de42196ebe (8 drafts) |
|
19 | new changesets cd010b8cd998:02de42196ebe (8 drafts) | |
20 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
20 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
21 | $ hg up tip |
|
21 | $ hg up tip | |
22 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
22 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
23 | $ cd .. |
|
23 | $ cd .. | |
24 |
|
24 | |||
25 | $ hg clone -q -u . a a1 |
|
25 | $ hg clone -q -u . a a1 | |
26 |
|
26 | |||
27 | $ cd a1 |
|
27 | $ cd a1 | |
28 |
|
28 | |||
29 | $ hg update 3 |
|
29 | $ hg update 3 | |
30 | 3 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
30 | 3 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
31 | $ hg branch dev-one |
|
31 | $ hg branch dev-one | |
32 | marked working directory as branch dev-one |
|
32 | marked working directory as branch dev-one | |
33 | (branches are permanent and global, did you want a bookmark?) |
|
33 | (branches are permanent and global, did you want a bookmark?) | |
34 | $ hg ci -m 'dev-one named branch' |
|
34 | $ hg ci -m 'dev-one named branch' | |
35 |
|
35 | |||
36 | $ hg update 7 |
|
36 | $ hg update 7 | |
37 | 2 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
37 | 2 files updated, 0 files merged, 3 files removed, 0 files unresolved | |
38 | $ hg branch dev-two |
|
38 | $ hg branch dev-two | |
39 | marked working directory as branch dev-two |
|
39 | marked working directory as branch dev-two | |
40 |
|
40 | |||
41 | $ echo x > x |
|
41 | $ echo x > x | |
42 |
|
42 | |||
43 | $ hg add x |
|
43 | $ hg add x | |
44 |
|
44 | |||
45 | $ hg ci -m 'dev-two named branch' |
|
45 | $ hg ci -m 'dev-two named branch' | |
46 |
|
46 | |||
47 | $ hg tglog |
|
47 | $ hg tglog | |
48 | @ 9: cb039b7cae8e 'dev-two named branch' dev-two |
|
48 | @ 9: cb039b7cae8e 'dev-two named branch' dev-two | |
49 | | |
|
49 | | | |
50 | | o 8: 643fc9128048 'dev-one named branch' dev-one |
|
50 | | o 8: 643fc9128048 'dev-one named branch' dev-one | |
51 | | | |
|
51 | | | | |
52 | o | 7: 02de42196ebe 'H' |
|
52 | o | 7: 02de42196ebe 'H' | |
53 | | | |
|
53 | | | | |
54 | +---o 6: eea13746799a 'G' |
|
54 | +---o 6: eea13746799a 'G' | |
55 | | | | |
|
55 | | | | | |
56 | o | | 5: 24b6387c8c8c 'F' |
|
56 | o | | 5: 24b6387c8c8c 'F' | |
57 | | | | |
|
57 | | | | | |
58 | +---o 4: 9520eea781bc 'E' |
|
58 | +---o 4: 9520eea781bc 'E' | |
59 | | | |
|
59 | | | | |
60 | | o 3: 32af7686d403 'D' |
|
60 | | o 3: 32af7686d403 'D' | |
61 | | | |
|
61 | | | | |
62 | | o 2: 5fddd98957c8 'C' |
|
62 | | o 2: 5fddd98957c8 'C' | |
63 | | | |
|
63 | | | | |
64 | | o 1: 42ccdea3bb16 'B' |
|
64 | | o 1: 42ccdea3bb16 'B' | |
65 | |/ |
|
65 | |/ | |
66 | o 0: cd010b8cd998 'A' |
|
66 | o 0: cd010b8cd998 'A' | |
67 |
|
67 | |||
68 |
|
68 | |||
69 | Branch name containing a dash (issue3181) |
|
69 | Branch name containing a dash (issue3181) | |
70 |
|
70 | |||
71 | $ hg rebase -b dev-two -d dev-one --keepbranches |
|
71 | $ hg rebase -b dev-two -d dev-one --keepbranches | |
72 | rebasing 5:24b6387c8c8c "F" |
|
72 | rebasing 5:24b6387c8c8c "F" | |
73 | rebasing 6:eea13746799a "G" |
|
73 | rebasing 6:eea13746799a "G" | |
74 | rebasing 7:02de42196ebe "H" |
|
74 | rebasing 7:02de42196ebe "H" | |
75 | rebasing 9:cb039b7cae8e "dev-two named branch" (tip) |
|
75 | rebasing 9:cb039b7cae8e "dev-two named branch" (tip) | |
76 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/24b6387c8c8c-24cb8001-rebase.hg |
|
76 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/24b6387c8c8c-24cb8001-rebase.hg | |
77 |
|
77 | |||
78 | $ hg tglog |
|
78 | $ hg tglog | |
79 | @ 9: 9e70cd31750f 'dev-two named branch' dev-two |
|
79 | @ 9: 9e70cd31750f 'dev-two named branch' dev-two | |
80 | | |
|
80 | | | |
81 | o 8: 31d0e4ba75e6 'H' |
|
81 | o 8: 31d0e4ba75e6 'H' | |
82 | | |
|
82 | | | |
83 | | o 7: 4b988a958030 'G' |
|
83 | | o 7: 4b988a958030 'G' | |
84 | |/| |
|
84 | |/| | |
85 | o | 6: 24de4aff8e28 'F' |
|
85 | o | 6: 24de4aff8e28 'F' | |
86 | | | |
|
86 | | | | |
87 | o | 5: 643fc9128048 'dev-one named branch' dev-one |
|
87 | o | 5: 643fc9128048 'dev-one named branch' dev-one | |
88 | | | |
|
88 | | | | |
89 | | o 4: 9520eea781bc 'E' |
|
89 | | o 4: 9520eea781bc 'E' | |
90 | | | |
|
90 | | | | |
91 | o | 3: 32af7686d403 'D' |
|
91 | o | 3: 32af7686d403 'D' | |
92 | | | |
|
92 | | | | |
93 | o | 2: 5fddd98957c8 'C' |
|
93 | o | 2: 5fddd98957c8 'C' | |
94 | | | |
|
94 | | | | |
95 | o | 1: 42ccdea3bb16 'B' |
|
95 | o | 1: 42ccdea3bb16 'B' | |
96 | |/ |
|
96 | |/ | |
97 | o 0: cd010b8cd998 'A' |
|
97 | o 0: cd010b8cd998 'A' | |
98 |
|
98 | |||
99 | $ hg rebase -s dev-one -d 0 --keepbranches |
|
99 | $ hg rebase -s dev-one -d 0 --keepbranches | |
100 | rebasing 5:643fc9128048 "dev-one named branch" |
|
100 | rebasing 5:643fc9128048 "dev-one named branch" | |
101 | rebasing 6:24de4aff8e28 "F" |
|
101 | rebasing 6:24de4aff8e28 "F" | |
102 | rebasing 7:4b988a958030 "G" |
|
102 | rebasing 7:4b988a958030 "G" | |
103 | rebasing 8:31d0e4ba75e6 "H" |
|
103 | rebasing 8:31d0e4ba75e6 "H" | |
104 | rebasing 9:9e70cd31750f "dev-two named branch" (tip) |
|
104 | rebasing 9:9e70cd31750f "dev-two named branch" (tip) | |
105 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/643fc9128048-c4ee9ef5-rebase.hg |
|
105 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/643fc9128048-c4ee9ef5-rebase.hg | |
106 |
|
106 | |||
107 | $ hg tglog |
|
107 | $ hg tglog | |
108 | @ 9: 59c2e59309fe 'dev-two named branch' dev-two |
|
108 | @ 9: 59c2e59309fe 'dev-two named branch' dev-two | |
109 | | |
|
109 | | | |
110 | o 8: 904590360559 'H' |
|
110 | o 8: 904590360559 'H' | |
111 | | |
|
111 | | | |
112 | | o 7: 1a1e6f72ec38 'G' |
|
112 | | o 7: 1a1e6f72ec38 'G' | |
113 | |/| |
|
113 | |/| | |
114 | o | 6: 42aa3cf0fa7a 'F' |
|
114 | o | 6: 42aa3cf0fa7a 'F' | |
115 | | | |
|
115 | | | | |
116 | o | 5: bc8139ee757c 'dev-one named branch' dev-one |
|
116 | o | 5: bc8139ee757c 'dev-one named branch' dev-one | |
117 | | | |
|
117 | | | | |
118 | | o 4: 9520eea781bc 'E' |
|
118 | | o 4: 9520eea781bc 'E' | |
119 | |/ |
|
119 | |/ | |
120 | | o 3: 32af7686d403 'D' |
|
120 | | o 3: 32af7686d403 'D' | |
121 | | | |
|
121 | | | | |
122 | | o 2: 5fddd98957c8 'C' |
|
122 | | o 2: 5fddd98957c8 'C' | |
123 | | | |
|
123 | | | | |
124 | | o 1: 42ccdea3bb16 'B' |
|
124 | | o 1: 42ccdea3bb16 'B' | |
125 | |/ |
|
125 | |/ | |
126 | o 0: cd010b8cd998 'A' |
|
126 | o 0: cd010b8cd998 'A' | |
127 |
|
127 | |||
128 | $ hg update 3 |
|
128 | $ hg update 3 | |
129 | 3 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
129 | 3 files updated, 0 files merged, 3 files removed, 0 files unresolved | |
130 | $ hg branch -f dev-one |
|
130 | $ hg branch -f dev-one | |
131 | marked working directory as branch dev-one |
|
131 | marked working directory as branch dev-one | |
132 | $ hg ci -m 'dev-one named branch' |
|
132 | $ hg ci -m 'dev-one named branch' | |
133 | created new head |
|
133 | created new head | |
134 |
|
134 | |||
135 | $ hg tglog |
|
135 | $ hg tglog | |
136 | @ 10: 643fc9128048 'dev-one named branch' dev-one |
|
136 | @ 10: 643fc9128048 'dev-one named branch' dev-one | |
137 | | |
|
137 | | | |
138 | | o 9: 59c2e59309fe 'dev-two named branch' dev-two |
|
138 | | o 9: 59c2e59309fe 'dev-two named branch' dev-two | |
139 | | | |
|
139 | | | | |
140 | | o 8: 904590360559 'H' |
|
140 | | o 8: 904590360559 'H' | |
141 | | | |
|
141 | | | | |
142 | | | o 7: 1a1e6f72ec38 'G' |
|
142 | | | o 7: 1a1e6f72ec38 'G' | |
143 | | |/| |
|
143 | | |/| | |
144 | | o | 6: 42aa3cf0fa7a 'F' |
|
144 | | o | 6: 42aa3cf0fa7a 'F' | |
145 | | | | |
|
145 | | | | | |
146 | | o | 5: bc8139ee757c 'dev-one named branch' dev-one |
|
146 | | o | 5: bc8139ee757c 'dev-one named branch' dev-one | |
147 | | | | |
|
147 | | | | | |
148 | | | o 4: 9520eea781bc 'E' |
|
148 | | | o 4: 9520eea781bc 'E' | |
149 | | |/ |
|
149 | | |/ | |
150 | o | 3: 32af7686d403 'D' |
|
150 | o | 3: 32af7686d403 'D' | |
151 | | | |
|
151 | | | | |
152 | o | 2: 5fddd98957c8 'C' |
|
152 | o | 2: 5fddd98957c8 'C' | |
153 | | | |
|
153 | | | | |
154 | o | 1: 42ccdea3bb16 'B' |
|
154 | o | 1: 42ccdea3bb16 'B' | |
155 | |/ |
|
155 | |/ | |
156 | o 0: cd010b8cd998 'A' |
|
156 | o 0: cd010b8cd998 'A' | |
157 |
|
157 | |||
158 | $ hg rebase -b 'max(branch("dev-two"))' -d dev-one --keepbranches |
|
158 | $ hg rebase -b 'max(branch("dev-two"))' -d dev-one --keepbranches | |
159 | rebasing 5:bc8139ee757c "dev-one named branch" |
|
159 | rebasing 5:bc8139ee757c "dev-one named branch" | |
160 | note: not rebasing 5:bc8139ee757c "dev-one named branch", its destination already has all its changes |
|
160 | note: not rebasing 5:bc8139ee757c "dev-one named branch", its destination already has all its changes | |
161 | rebasing 6:42aa3cf0fa7a "F" |
|
161 | rebasing 6:42aa3cf0fa7a "F" | |
162 | rebasing 7:1a1e6f72ec38 "G" |
|
162 | rebasing 7:1a1e6f72ec38 "G" | |
163 | rebasing 8:904590360559 "H" |
|
163 | rebasing 8:904590360559 "H" | |
164 | rebasing 9:59c2e59309fe "dev-two named branch" |
|
164 | rebasing 9:59c2e59309fe "dev-two named branch" | |
165 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/bc8139ee757c-f11c1080-rebase.hg |
|
165 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/bc8139ee757c-f11c1080-rebase.hg | |
166 |
|
166 | |||
167 | $ hg tglog |
|
167 | $ hg tglog | |
168 | o 9: 71325f8bc082 'dev-two named branch' dev-two |
|
168 | o 9: 71325f8bc082 'dev-two named branch' dev-two | |
169 | | |
|
169 | | | |
170 | o 8: 12b2bc666e20 'H' |
|
170 | o 8: 12b2bc666e20 'H' | |
171 | | |
|
171 | | | |
172 | | o 7: 549f007a9f5f 'G' |
|
172 | | o 7: 549f007a9f5f 'G' | |
173 | |/| |
|
173 | |/| | |
174 | o | 6: 679f28760620 'F' |
|
174 | o | 6: 679f28760620 'F' | |
175 | | | |
|
175 | | | | |
176 | @ | 5: 643fc9128048 'dev-one named branch' dev-one |
|
176 | @ | 5: 643fc9128048 'dev-one named branch' dev-one | |
177 | | | |
|
177 | | | | |
178 | | o 4: 9520eea781bc 'E' |
|
178 | | o 4: 9520eea781bc 'E' | |
179 | | | |
|
179 | | | | |
180 | o | 3: 32af7686d403 'D' |
|
180 | o | 3: 32af7686d403 'D' | |
181 | | | |
|
181 | | | | |
182 | o | 2: 5fddd98957c8 'C' |
|
182 | o | 2: 5fddd98957c8 'C' | |
183 | | | |
|
183 | | | | |
184 | o | 1: 42ccdea3bb16 'B' |
|
184 | o | 1: 42ccdea3bb16 'B' | |
185 | |/ |
|
185 | |/ | |
186 | o 0: cd010b8cd998 'A' |
|
186 | o 0: cd010b8cd998 'A' | |
187 |
|
187 | |||
188 | $ hg rebase -s 'max(branch("dev-one"))' -d 0 --keepbranches |
|
188 | $ hg rebase -s 'max(branch("dev-one"))' -d 0 --keepbranches | |
189 | rebasing 5:643fc9128048 "dev-one named branch" |
|
189 | rebasing 5:643fc9128048 "dev-one named branch" | |
190 | rebasing 6:679f28760620 "F" |
|
190 | rebasing 6:679f28760620 "F" | |
191 | rebasing 7:549f007a9f5f "G" |
|
191 | rebasing 7:549f007a9f5f "G" | |
192 | rebasing 8:12b2bc666e20 "H" |
|
192 | rebasing 8:12b2bc666e20 "H" | |
193 | rebasing 9:71325f8bc082 "dev-two named branch" (tip) |
|
193 | rebasing 9:71325f8bc082 "dev-two named branch" (tip) | |
194 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/643fc9128048-6cdd1a52-rebase.hg |
|
194 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/643fc9128048-6cdd1a52-rebase.hg | |
195 |
|
195 | |||
196 | $ hg tglog |
|
196 | $ hg tglog | |
197 | o 9: 3944801ae4ea 'dev-two named branch' dev-two |
|
197 | o 9: 3944801ae4ea 'dev-two named branch' dev-two | |
198 | | |
|
198 | | | |
199 | o 8: 8e279d293175 'H' |
|
199 | o 8: 8e279d293175 'H' | |
200 | | |
|
200 | | | |
201 | | o 7: aeefee77ab01 'G' |
|
201 | | o 7: aeefee77ab01 'G' | |
202 | |/| |
|
202 | |/| | |
203 | o | 6: e908b85f3729 'F' |
|
203 | o | 6: e908b85f3729 'F' | |
204 | | | |
|
204 | | | | |
205 | @ | 5: bc8139ee757c 'dev-one named branch' dev-one |
|
205 | @ | 5: bc8139ee757c 'dev-one named branch' dev-one | |
206 | | | |
|
206 | | | | |
207 | | o 4: 9520eea781bc 'E' |
|
207 | | o 4: 9520eea781bc 'E' | |
208 | |/ |
|
208 | |/ | |
209 | | o 3: 32af7686d403 'D' |
|
209 | | o 3: 32af7686d403 'D' | |
210 | | | |
|
210 | | | | |
211 | | o 2: 5fddd98957c8 'C' |
|
211 | | o 2: 5fddd98957c8 'C' | |
212 | | | |
|
212 | | | | |
213 | | o 1: 42ccdea3bb16 'B' |
|
213 | | o 1: 42ccdea3bb16 'B' | |
214 | |/ |
|
214 | |/ | |
215 | o 0: cd010b8cd998 'A' |
|
215 | o 0: cd010b8cd998 'A' | |
216 |
|
216 | |||
217 | $ hg up -r 0 > /dev/null |
|
217 | $ hg up -r 0 > /dev/null | |
218 |
|
218 | |||
219 | Rebasing descendant onto ancestor across different named branches |
|
219 | Rebasing descendant onto ancestor across different named branches | |
220 |
|
220 | |||
221 | $ hg rebase -s 1 -d 9 --keepbranches |
|
221 | $ hg rebase -s 1 -d 9 --keepbranches | |
222 | rebasing 1:42ccdea3bb16 "B" |
|
222 | rebasing 1:42ccdea3bb16 "B" | |
223 | rebasing 2:5fddd98957c8 "C" |
|
223 | rebasing 2:5fddd98957c8 "C" | |
224 | rebasing 3:32af7686d403 "D" |
|
224 | rebasing 3:32af7686d403 "D" | |
225 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg |
|
225 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg | |
226 |
|
226 | |||
227 | $ hg tglog |
|
227 | $ hg tglog | |
228 | o 9: e9f862ce8bad 'D' |
|
228 | o 9: e9f862ce8bad 'D' | |
229 | | |
|
229 | | | |
230 | o 8: a0d543090fa4 'C' |
|
230 | o 8: a0d543090fa4 'C' | |
231 | | |
|
231 | | | |
232 | o 7: 3bdb949809d9 'B' |
|
232 | o 7: 3bdb949809d9 'B' | |
233 | | |
|
233 | | | |
234 | o 6: 3944801ae4ea 'dev-two named branch' dev-two |
|
234 | o 6: 3944801ae4ea 'dev-two named branch' dev-two | |
235 | | |
|
235 | | | |
236 | o 5: 8e279d293175 'H' |
|
236 | o 5: 8e279d293175 'H' | |
237 | | |
|
237 | | | |
238 | | o 4: aeefee77ab01 'G' |
|
238 | | o 4: aeefee77ab01 'G' | |
239 | |/| |
|
239 | |/| | |
240 | o | 3: e908b85f3729 'F' |
|
240 | o | 3: e908b85f3729 'F' | |
241 | | | |
|
241 | | | | |
242 | o | 2: bc8139ee757c 'dev-one named branch' dev-one |
|
242 | o | 2: bc8139ee757c 'dev-one named branch' dev-one | |
243 | | | |
|
243 | | | | |
244 | | o 1: 9520eea781bc 'E' |
|
244 | | o 1: 9520eea781bc 'E' | |
245 | |/ |
|
245 | |/ | |
246 | @ 0: cd010b8cd998 'A' |
|
246 | @ 0: cd010b8cd998 'A' | |
247 |
|
247 | |||
248 | $ hg rebase -s 5 -d 6 |
|
248 | $ hg rebase -s 5 -d 6 | |
249 | abort: source and destination form a cycle |
|
249 | abort: source and destination form a cycle | |
250 | [255] |
|
250 | [255] | |
251 |
|
251 | |||
252 | $ hg rebase -s 6 -d 5 |
|
252 | $ hg rebase -s 6 -d 5 | |
253 | rebasing 6:3944801ae4ea "dev-two named branch" |
|
253 | rebasing 6:3944801ae4ea "dev-two named branch" | |
254 | rebasing 7:3bdb949809d9 "B" |
|
254 | rebasing 7:3bdb949809d9 "B" | |
255 | rebasing 8:a0d543090fa4 "C" |
|
255 | rebasing 8:a0d543090fa4 "C" | |
256 | rebasing 9:e9f862ce8bad "D" (tip) |
|
256 | rebasing 9:e9f862ce8bad "D" (tip) | |
257 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/3944801ae4ea-fb46ed74-rebase.hg |
|
257 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/3944801ae4ea-fb46ed74-rebase.hg | |
258 |
|
258 | |||
259 | $ hg tglog |
|
259 | $ hg tglog | |
260 | o 9: e522577ccdbd 'D' |
|
260 | o 9: e522577ccdbd 'D' | |
261 | | |
|
261 | | | |
262 | o 8: 810110211f50 'C' |
|
262 | o 8: 810110211f50 'C' | |
263 | | |
|
263 | | | |
264 | o 7: 160b0930ccc6 'B' |
|
264 | o 7: 160b0930ccc6 'B' | |
265 | | |
|
265 | | | |
266 | o 6: c57724c84928 'dev-two named branch' |
|
266 | o 6: c57724c84928 'dev-two named branch' | |
267 | | |
|
267 | | | |
268 | o 5: 8e279d293175 'H' |
|
268 | o 5: 8e279d293175 'H' | |
269 | | |
|
269 | | | |
270 | | o 4: aeefee77ab01 'G' |
|
270 | | o 4: aeefee77ab01 'G' | |
271 | |/| |
|
271 | |/| | |
272 | o | 3: e908b85f3729 'F' |
|
272 | o | 3: e908b85f3729 'F' | |
273 | | | |
|
273 | | | | |
274 | o | 2: bc8139ee757c 'dev-one named branch' dev-one |
|
274 | o | 2: bc8139ee757c 'dev-one named branch' dev-one | |
275 | | | |
|
275 | | | | |
276 | | o 1: 9520eea781bc 'E' |
|
276 | | o 1: 9520eea781bc 'E' | |
277 | |/ |
|
277 | |/ | |
278 | @ 0: cd010b8cd998 'A' |
|
278 | @ 0: cd010b8cd998 'A' | |
279 |
|
279 | |||
280 |
|
280 | |||
281 | Reopen branch by rebase |
|
281 | Reopen branch by rebase | |
282 |
|
282 | |||
283 | $ hg up -qr3 |
|
283 | $ hg up -qr3 | |
284 | $ hg branch -q b |
|
284 | $ hg branch -q b | |
285 | $ hg ci -m 'create b' |
|
285 | $ hg ci -m 'create b' | |
286 | $ hg ci -m 'close b' --close |
|
286 | $ hg ci -m 'close b' --close | |
287 | $ hg rebase -b 8 -d b |
|
287 | $ hg rebase -b 8 -d b | |
288 | reopening closed branch head 2b586e70108d |
|
288 | reopening closed branch head 2b586e70108d | |
289 | rebasing 5:8e279d293175 "H" |
|
289 | rebasing 5:8e279d293175 "H" | |
290 | rebasing 6:c57724c84928 "dev-two named branch" |
|
290 | rebasing 6:c57724c84928 "dev-two named branch" | |
291 | rebasing 7:160b0930ccc6 "B" |
|
291 | rebasing 7:160b0930ccc6 "B" | |
292 | rebasing 8:810110211f50 "C" |
|
292 | rebasing 8:810110211f50 "C" | |
293 | rebasing 9:e522577ccdbd "D" |
|
293 | rebasing 9:e522577ccdbd "D" | |
294 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/8e279d293175-b023e27c-rebase.hg |
|
294 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/8e279d293175-b023e27c-rebase.hg | |
295 |
|
295 | |||
|
296 | $ hg log -G -Tcompact | |||
|
297 | o 11[tip] be1dea60f2a6 2011-04-30 15:24 +0200 nicdumz | |||
|
298 | | D | |||
|
299 | | | |||
|
300 | o 10 ac34ce92632a 2011-04-30 15:24 +0200 nicdumz | |||
|
301 | | C | |||
|
302 | | | |||
|
303 | o 9 7bd665b6ce12 2011-04-30 15:24 +0200 nicdumz | |||
|
304 | | B | |||
|
305 | | | |||
|
306 | o 8 58e7c36e77f7 1970-01-01 00:00 +0000 test | |||
|
307 | | dev-two named branch | |||
|
308 | | | |||
|
309 | o 7 8e5a320651f3 2011-04-30 15:24 +0200 nicdumz | |||
|
310 | | H | |||
|
311 | | | |||
|
312 | @ 6 2b586e70108d 1970-01-01 00:00 +0000 test | |||
|
313 | | close b | |||
|
314 | | | |||
|
315 | o 5:3 3f9d5df8a707 1970-01-01 00:00 +0000 test | |||
|
316 | | create b | |||
|
317 | | | |||
|
318 | | o 4:3,1 aeefee77ab01 2011-04-30 15:24 +0200 nicdumz | |||
|
319 | |/| G | |||
|
320 | | | | |||
|
321 | o | 3 e908b85f3729 2011-04-30 15:24 +0200 nicdumz | |||
|
322 | | | F | |||
|
323 | | | | |||
|
324 | o | 2:0 bc8139ee757c 1970-01-01 00:00 +0000 test | |||
|
325 | | | dev-one named branch | |||
|
326 | | | | |||
|
327 | | o 1 9520eea781bc 2011-04-30 15:24 +0200 nicdumz | |||
|
328 | |/ E | |||
|
329 | | | |||
|
330 | o 0 cd010b8cd998 2011-04-30 15:24 +0200 nicdumz | |||
|
331 | A | |||
|
332 | ||||
|
333 | $ echo A-mod > A | |||
|
334 | $ hg diff | |||
|
335 | diff -r 2b586e70108d A | |||
|
336 | --- a/A Thu Jan 01 00:00:00 1970 +0000 | |||
|
337 | +++ b/A Thu Jan 01 00:00:00 1970 +0000 | |||
|
338 | @@ -1,1 +1,1 @@ | |||
|
339 | -A | |||
|
340 | +A-mod | |||
|
341 | ||||
|
342 | BUG: This shouldn't affect wdir | |||
|
343 | ||||
|
344 | $ hg rebase -s tip -d 4 --dry-run | |||
|
345 | starting dry-run rebase; repository will not be changed | |||
|
346 | rebasing 11:be1dea60f2a6 "D" (tip) | |||
|
347 | dry-run rebase completed successfully; run without -n/--dry-run to perform this rebase | |||
|
348 | $ hg diff | |||
|
349 | ||||
|
350 | BUG: This shouldn't affect wdir | |||
|
351 | ||||
|
352 | $ echo A-mod > A | |||
|
353 | $ echo n | hg rebase -s tip -d 4 --confirm --config ui.interactive=True | |||
|
354 | starting in-memory rebase | |||
|
355 | rebasing 11:be1dea60f2a6 "D" (tip) | |||
|
356 | rebase completed successfully | |||
|
357 | apply changes (yn)? n | |||
|
358 | $ hg diff | |||
|
359 | ||||
|
360 | $ echo A-mod > A | |||
|
361 | $ hg rebase -s tip -d 4 --confirm | |||
|
362 | starting in-memory rebase | |||
|
363 | rebasing 11:be1dea60f2a6 "D" (tip) | |||
|
364 | rebase completed successfully | |||
|
365 | apply changes (yn)? y | |||
|
366 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/be1dea60f2a6-ca6d2dac-rebase.hg | |||
|
367 | $ hg diff | |||
|
368 | diff -r 2b586e70108d A | |||
|
369 | --- a/A Thu Jan 01 00:00:00 1970 +0000 | |||
|
370 | +++ b/A Thu Jan 01 00:00:00 1970 +0000 | |||
|
371 | @@ -1,1 +1,1 @@ | |||
|
372 | -A | |||
|
373 | +A-mod | |||
|
374 | ||||
|
375 | Attempting to rebase the parent of a dirty working directory will abort, without | |||
|
376 | mangling the working directory... | |||
|
377 | ||||
|
378 | $ hg rebase -s 5 -d 4 --dry-run | |||
|
379 | starting dry-run rebase; repository will not be changed | |||
|
380 | abort: uncommitted changes | |||
|
381 | [255] | |||
|
382 | $ hg diff | |||
|
383 | diff -r 2b586e70108d A | |||
|
384 | --- a/A Thu Jan 01 00:00:00 1970 +0000 | |||
|
385 | +++ b/A Thu Jan 01 00:00:00 1970 +0000 | |||
|
386 | @@ -1,1 +1,1 @@ | |||
|
387 | -A | |||
|
388 | +A-mod | |||
|
389 | ||||
|
390 | ... ditto for --confirm | |||
|
391 | ||||
|
392 | $ echo n | hg rebase -s 5 -d 4 --confirm --config ui.interactive=True | |||
|
393 | starting in-memory rebase | |||
|
394 | abort: uncommitted changes | |||
|
395 | [255] | |||
|
396 | $ hg diff | |||
|
397 | diff -r 2b586e70108d A | |||
|
398 | --- a/A Thu Jan 01 00:00:00 1970 +0000 | |||
|
399 | +++ b/A Thu Jan 01 00:00:00 1970 +0000 | |||
|
400 | @@ -1,1 +1,1 @@ | |||
|
401 | -A | |||
|
402 | +A-mod | |||
|
403 | $ hg rebase -s 5 -d 4 --confirm | |||
|
404 | starting in-memory rebase | |||
|
405 | abort: uncommitted changes | |||
|
406 | [255] | |||
|
407 | $ hg diff | |||
|
408 | diff -r 2b586e70108d A | |||
|
409 | --- a/A Thu Jan 01 00:00:00 1970 +0000 | |||
|
410 | +++ b/A Thu Jan 01 00:00:00 1970 +0000 | |||
|
411 | @@ -1,1 +1,1 @@ | |||
|
412 | -A | |||
|
413 | +A-mod | |||
|
414 | ||||
296 | $ cd .. |
|
415 | $ cd .. | |
297 |
|
416 | |||
298 | Rebase to other head on branch |
|
417 | Rebase to other head on branch | |
299 |
|
418 | |||
300 | Set up a case: |
|
419 | Set up a case: | |
301 |
|
420 | |||
302 | $ hg init case1 |
|
421 | $ hg init case1 | |
303 | $ cd case1 |
|
422 | $ cd case1 | |
304 | $ touch f |
|
423 | $ touch f | |
305 | $ hg ci -qAm0 |
|
424 | $ hg ci -qAm0 | |
306 | $ hg branch -q b |
|
425 | $ hg branch -q b | |
307 | $ echo >> f |
|
426 | $ echo >> f | |
308 | $ hg ci -qAm 'b1' |
|
427 | $ hg ci -qAm 'b1' | |
309 | $ hg up -qr -2 |
|
428 | $ hg up -qr -2 | |
310 | $ hg branch -qf b |
|
429 | $ hg branch -qf b | |
311 | $ hg ci -qm 'b2' |
|
430 | $ hg ci -qm 'b2' | |
312 | $ hg up -qr -3 |
|
431 | $ hg up -qr -3 | |
313 | $ hg branch -q c |
|
432 | $ hg branch -q c | |
314 | $ hg ci -m 'c1' |
|
433 | $ hg ci -m 'c1' | |
315 |
|
434 | |||
316 | $ hg tglog |
|
435 | $ hg tglog | |
317 | @ 3: c062e3ecd6c6 'c1' c |
|
436 | @ 3: c062e3ecd6c6 'c1' c | |
318 | | |
|
437 | | | |
319 | | o 2: 792845bb77ee 'b2' b |
|
438 | | o 2: 792845bb77ee 'b2' b | |
320 | |/ |
|
439 | |/ | |
321 | | o 1: 40039acb7ca5 'b1' b |
|
440 | | o 1: 40039acb7ca5 'b1' b | |
322 | |/ |
|
441 | |/ | |
323 | o 0: d681519c3ea7 '0' |
|
442 | o 0: d681519c3ea7 '0' | |
324 |
|
443 | |||
325 | $ hg clone -q . ../case2 |
|
444 | $ hg clone -q . ../case2 | |
326 |
|
445 | |||
327 | rebase 'b2' to another lower branch head |
|
446 | rebase 'b2' to another lower branch head | |
328 |
|
447 | |||
329 | $ hg up -qr 2 |
|
448 | $ hg up -qr 2 | |
330 | $ hg rebase |
|
449 | $ hg rebase | |
331 | rebasing 2:792845bb77ee "b2" |
|
450 | rebasing 2:792845bb77ee "b2" | |
332 | note: not rebasing 2:792845bb77ee "b2", its destination already has all its changes |
|
451 | note: not rebasing 2:792845bb77ee "b2", its destination already has all its changes | |
333 | saved backup bundle to $TESTTMP/case1/.hg/strip-backup/792845bb77ee-627120ee-rebase.hg |
|
452 | saved backup bundle to $TESTTMP/case1/.hg/strip-backup/792845bb77ee-627120ee-rebase.hg | |
334 | $ hg tglog |
|
453 | $ hg tglog | |
335 | o 2: c062e3ecd6c6 'c1' c |
|
454 | o 2: c062e3ecd6c6 'c1' c | |
336 | | |
|
455 | | | |
337 | | @ 1: 40039acb7ca5 'b1' b |
|
456 | | @ 1: 40039acb7ca5 'b1' b | |
338 | |/ |
|
457 | |/ | |
339 | o 0: d681519c3ea7 '0' |
|
458 | o 0: d681519c3ea7 '0' | |
340 |
|
459 | |||
341 |
|
460 | |||
342 | rebase 'b1' on top of the tip of the branch ('b2') - ignoring the tip branch ('c1') |
|
461 | rebase 'b1' on top of the tip of the branch ('b2') - ignoring the tip branch ('c1') | |
343 |
|
462 | |||
344 | $ cd ../case2 |
|
463 | $ cd ../case2 | |
345 | $ hg up -qr 1 |
|
464 | $ hg up -qr 1 | |
346 | $ hg rebase |
|
465 | $ hg rebase | |
347 | rebasing 1:40039acb7ca5 "b1" |
|
466 | rebasing 1:40039acb7ca5 "b1" | |
348 | saved backup bundle to $TESTTMP/case2/.hg/strip-backup/40039acb7ca5-342b72d1-rebase.hg |
|
467 | saved backup bundle to $TESTTMP/case2/.hg/strip-backup/40039acb7ca5-342b72d1-rebase.hg | |
349 | $ hg tglog |
|
468 | $ hg tglog | |
350 | @ 3: 76abc1c6f8c7 'b1' b |
|
469 | @ 3: 76abc1c6f8c7 'b1' b | |
351 | | |
|
470 | | | |
352 | | o 2: c062e3ecd6c6 'c1' c |
|
471 | | o 2: c062e3ecd6c6 'c1' c | |
353 | | | |
|
472 | | | | |
354 | o | 1: 792845bb77ee 'b2' b |
|
473 | o | 1: 792845bb77ee 'b2' b | |
355 | |/ |
|
474 | |/ | |
356 | o 0: d681519c3ea7 '0' |
|
475 | o 0: d681519c3ea7 '0' | |
357 |
|
476 | |||
358 |
|
477 | |||
359 | rebase 'c1' to the branch head 'c2' that is closed |
|
478 | rebase 'c1' to the branch head 'c2' that is closed | |
360 |
|
479 | |||
361 | $ hg branch -qf c |
|
480 | $ hg branch -qf c | |
362 | $ hg ci -qm 'c2 closed' --close |
|
481 | $ hg ci -qm 'c2 closed' --close | |
363 | $ hg up -qr 2 |
|
482 | $ hg up -qr 2 | |
364 | $ hg tglog |
|
483 | $ hg tglog | |
365 | _ 4: 8427af5d86f2 'c2 closed' c |
|
484 | _ 4: 8427af5d86f2 'c2 closed' c | |
366 | | |
|
485 | | | |
367 | o 3: 76abc1c6f8c7 'b1' b |
|
486 | o 3: 76abc1c6f8c7 'b1' b | |
368 | | |
|
487 | | | |
369 | | @ 2: c062e3ecd6c6 'c1' c |
|
488 | | @ 2: c062e3ecd6c6 'c1' c | |
370 | | | |
|
489 | | | | |
371 | o | 1: 792845bb77ee 'b2' b |
|
490 | o | 1: 792845bb77ee 'b2' b | |
372 | |/ |
|
491 | |/ | |
373 | o 0: d681519c3ea7 '0' |
|
492 | o 0: d681519c3ea7 '0' | |
374 |
|
493 | |||
375 | $ hg rebase |
|
494 | $ hg rebase | |
376 | abort: branch 'c' has one head - please rebase to an explicit rev |
|
495 | abort: branch 'c' has one head - please rebase to an explicit rev | |
377 | (run 'hg heads' to see all heads, specify destination with -d) |
|
496 | (run 'hg heads' to see all heads, specify destination with -d) | |
378 | [255] |
|
497 | [255] | |
379 | $ hg tglog |
|
498 | $ hg tglog | |
380 | _ 4: 8427af5d86f2 'c2 closed' c |
|
499 | _ 4: 8427af5d86f2 'c2 closed' c | |
381 | | |
|
500 | | | |
382 | o 3: 76abc1c6f8c7 'b1' b |
|
501 | o 3: 76abc1c6f8c7 'b1' b | |
383 | | |
|
502 | | | |
384 | | @ 2: c062e3ecd6c6 'c1' c |
|
503 | | @ 2: c062e3ecd6c6 'c1' c | |
385 | | | |
|
504 | | | | |
386 | o | 1: 792845bb77ee 'b2' b |
|
505 | o | 1: 792845bb77ee 'b2' b | |
387 | |/ |
|
506 | |/ | |
388 | o 0: d681519c3ea7 '0' |
|
507 | o 0: d681519c3ea7 '0' | |
389 |
|
508 | |||
390 |
|
509 | |||
391 | $ hg up -cr 1 |
|
510 | $ hg up -cr 1 | |
392 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
511 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
393 | $ hg branch x |
|
512 | $ hg branch x | |
394 | marked working directory as branch x |
|
513 | marked working directory as branch x | |
395 | $ hg rebase -r 3:: -d . |
|
514 | $ hg rebase -r 3:: -d . | |
396 | rebasing 3:76abc1c6f8c7 "b1" |
|
515 | rebasing 3:76abc1c6f8c7 "b1" | |
397 | rebasing 4:8427af5d86f2 "c2 closed" (tip) |
|
516 | rebasing 4:8427af5d86f2 "c2 closed" (tip) | |
398 | note: not rebasing 4:8427af5d86f2 "c2 closed" (tip), its destination already has all its changes |
|
517 | note: not rebasing 4:8427af5d86f2 "c2 closed" (tip), its destination already has all its changes | |
399 | saved backup bundle to $TESTTMP/case2/.hg/strip-backup/76abc1c6f8c7-cd698d13-rebase.hg |
|
518 | saved backup bundle to $TESTTMP/case2/.hg/strip-backup/76abc1c6f8c7-cd698d13-rebase.hg | |
400 | $ hg tglog |
|
519 | $ hg tglog | |
401 | o 3: 117b0ed08075 'b1' x |
|
520 | o 3: 117b0ed08075 'b1' x | |
402 | | |
|
521 | | | |
403 | | o 2: c062e3ecd6c6 'c1' c |
|
522 | | o 2: c062e3ecd6c6 'c1' c | |
404 | | | |
|
523 | | | | |
405 | @ | 1: 792845bb77ee 'b2' b |
|
524 | @ | 1: 792845bb77ee 'b2' b | |
406 | |/ |
|
525 | |/ | |
407 | o 0: d681519c3ea7 '0' |
|
526 | o 0: d681519c3ea7 '0' | |
408 |
|
527 | |||
409 |
|
528 | |||
410 | $ cd .. |
|
529 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now