##// END OF EJS Templates
rebase: add test to show --stop moves bookmarks...
Sushil khanchi -
r39131:33f5cffe default
parent child Browse files
Show More
@@ -1,2024 +1,2100 b''
1 ==========================
1 ==========================
2 Test rebase with obsolete
2 Test rebase with obsolete
3 ==========================
3 ==========================
4
4
5 Enable obsolete
5 Enable obsolete
6
6
7 $ cat >> $HGRCPATH << EOF
7 $ cat >> $HGRCPATH << EOF
8 > [ui]
8 > [ui]
9 > logtemplate= {rev}:{node|short} {desc|firstline}{if(obsolete,' ({obsfate})')}
9 > logtemplate= {rev}:{node|short} {desc|firstline}{if(obsolete,' ({obsfate})')}
10 > [experimental]
10 > [experimental]
11 > evolution.createmarkers=True
11 > evolution.createmarkers=True
12 > evolution.allowunstable=True
12 > evolution.allowunstable=True
13 > [phases]
13 > [phases]
14 > publish=False
14 > publish=False
15 > [extensions]
15 > [extensions]
16 > rebase=
16 > rebase=
17 > drawdag=$TESTDIR/drawdag.py
17 > drawdag=$TESTDIR/drawdag.py
18 > strip=
18 > strip=
19 > EOF
19 > EOF
20
20
21 Setup rebase canonical repo
21 Setup rebase canonical repo
22
22
23 $ hg init base
23 $ hg init base
24 $ cd base
24 $ cd base
25 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
25 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
26 adding changesets
26 adding changesets
27 adding manifests
27 adding manifests
28 adding file changes
28 adding file changes
29 added 8 changesets with 7 changes to 7 files (+2 heads)
29 added 8 changesets with 7 changes to 7 files (+2 heads)
30 new changesets cd010b8cd998:02de42196ebe
30 new changesets cd010b8cd998:02de42196ebe
31 (run 'hg heads' to see heads, 'hg merge' to merge)
31 (run 'hg heads' to see heads, 'hg merge' to merge)
32 $ hg up tip
32 $ hg up tip
33 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
33 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
34 $ hg log -G
34 $ hg log -G
35 @ 7:02de42196ebe H
35 @ 7:02de42196ebe H
36 |
36 |
37 | o 6:eea13746799a G
37 | o 6:eea13746799a G
38 |/|
38 |/|
39 o | 5:24b6387c8c8c F
39 o | 5:24b6387c8c8c F
40 | |
40 | |
41 | o 4:9520eea781bc E
41 | o 4:9520eea781bc E
42 |/
42 |/
43 | o 3:32af7686d403 D
43 | o 3:32af7686d403 D
44 | |
44 | |
45 | o 2:5fddd98957c8 C
45 | o 2:5fddd98957c8 C
46 | |
46 | |
47 | o 1:42ccdea3bb16 B
47 | o 1:42ccdea3bb16 B
48 |/
48 |/
49 o 0:cd010b8cd998 A
49 o 0:cd010b8cd998 A
50
50
51 $ cd ..
51 $ cd ..
52
52
53 simple rebase
53 simple rebase
54 ---------------------------------
54 ---------------------------------
55
55
56 $ hg clone base simple
56 $ hg clone base simple
57 updating to branch default
57 updating to branch default
58 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
59 $ cd simple
59 $ cd simple
60 $ hg up 32af7686d403
60 $ hg up 32af7686d403
61 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
61 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
62 $ hg rebase -d eea13746799a
62 $ hg rebase -d eea13746799a
63 rebasing 1:42ccdea3bb16 "B"
63 rebasing 1:42ccdea3bb16 "B"
64 rebasing 2:5fddd98957c8 "C"
64 rebasing 2:5fddd98957c8 "C"
65 rebasing 3:32af7686d403 "D"
65 rebasing 3:32af7686d403 "D"
66 $ hg log -G
66 $ hg log -G
67 @ 10:8eeb3c33ad33 D
67 @ 10:8eeb3c33ad33 D
68 |
68 |
69 o 9:2327fea05063 C
69 o 9:2327fea05063 C
70 |
70 |
71 o 8:e4e5be0395b2 B
71 o 8:e4e5be0395b2 B
72 |
72 |
73 | o 7:02de42196ebe H
73 | o 7:02de42196ebe H
74 | |
74 | |
75 o | 6:eea13746799a G
75 o | 6:eea13746799a G
76 |\|
76 |\|
77 | o 5:24b6387c8c8c F
77 | o 5:24b6387c8c8c F
78 | |
78 | |
79 o | 4:9520eea781bc E
79 o | 4:9520eea781bc E
80 |/
80 |/
81 o 0:cd010b8cd998 A
81 o 0:cd010b8cd998 A
82
82
83 $ hg log --hidden -G
83 $ hg log --hidden -G
84 @ 10:8eeb3c33ad33 D
84 @ 10:8eeb3c33ad33 D
85 |
85 |
86 o 9:2327fea05063 C
86 o 9:2327fea05063 C
87 |
87 |
88 o 8:e4e5be0395b2 B
88 o 8:e4e5be0395b2 B
89 |
89 |
90 | o 7:02de42196ebe H
90 | o 7:02de42196ebe H
91 | |
91 | |
92 o | 6:eea13746799a G
92 o | 6:eea13746799a G
93 |\|
93 |\|
94 | o 5:24b6387c8c8c F
94 | o 5:24b6387c8c8c F
95 | |
95 | |
96 o | 4:9520eea781bc E
96 o | 4:9520eea781bc E
97 |/
97 |/
98 | x 3:32af7686d403 D (rewritten using rebase as 10:8eeb3c33ad33)
98 | x 3:32af7686d403 D (rewritten using rebase as 10:8eeb3c33ad33)
99 | |
99 | |
100 | x 2:5fddd98957c8 C (rewritten using rebase as 9:2327fea05063)
100 | x 2:5fddd98957c8 C (rewritten using rebase as 9:2327fea05063)
101 | |
101 | |
102 | x 1:42ccdea3bb16 B (rewritten using rebase as 8:e4e5be0395b2)
102 | x 1:42ccdea3bb16 B (rewritten using rebase as 8:e4e5be0395b2)
103 |/
103 |/
104 o 0:cd010b8cd998 A
104 o 0:cd010b8cd998 A
105
105
106 $ hg debugobsolete
106 $ hg debugobsolete
107 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 e4e5be0395b2cbd471ed22a26b1b6a1a0658a794 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
107 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 e4e5be0395b2cbd471ed22a26b1b6a1a0658a794 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
108 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 2327fea05063f39961b14cb69435a9898dc9a245 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
108 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 2327fea05063f39961b14cb69435a9898dc9a245 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
109 32af7686d403cf45b5d95f2d70cebea587ac806a 8eeb3c33ad33d452c89e5dcf611c347f978fb42b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
109 32af7686d403cf45b5d95f2d70cebea587ac806a 8eeb3c33ad33d452c89e5dcf611c347f978fb42b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
110
110
111
111
112 $ cd ..
112 $ cd ..
113
113
114 empty changeset
114 empty changeset
115 ---------------------------------
115 ---------------------------------
116
116
117 $ hg clone base empty
117 $ hg clone base empty
118 updating to branch default
118 updating to branch default
119 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
119 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
120 $ cd empty
120 $ cd empty
121 $ hg up eea13746799a
121 $ hg up eea13746799a
122 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
122 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
123
123
124 We make a copy of both the first changeset in the rebased and some other in the
124 We make a copy of both the first changeset in the rebased and some other in the
125 set.
125 set.
126
126
127 $ hg graft 42ccdea3bb16 32af7686d403
127 $ hg graft 42ccdea3bb16 32af7686d403
128 grafting 1:42ccdea3bb16 "B"
128 grafting 1:42ccdea3bb16 "B"
129 grafting 3:32af7686d403 "D"
129 grafting 3:32af7686d403 "D"
130 $ hg rebase -s 42ccdea3bb16 -d .
130 $ hg rebase -s 42ccdea3bb16 -d .
131 rebasing 1:42ccdea3bb16 "B"
131 rebasing 1:42ccdea3bb16 "B"
132 note: rebase of 1:42ccdea3bb16 created no changes to commit
132 note: rebase of 1:42ccdea3bb16 created no changes to commit
133 rebasing 2:5fddd98957c8 "C"
133 rebasing 2:5fddd98957c8 "C"
134 rebasing 3:32af7686d403 "D"
134 rebasing 3:32af7686d403 "D"
135 note: rebase of 3:32af7686d403 created no changes to commit
135 note: rebase of 3:32af7686d403 created no changes to commit
136 $ hg log -G
136 $ hg log -G
137 o 10:5ae4c968c6ac C
137 o 10:5ae4c968c6ac C
138 |
138 |
139 @ 9:08483444fef9 D
139 @ 9:08483444fef9 D
140 |
140 |
141 o 8:8877864f1edb B
141 o 8:8877864f1edb B
142 |
142 |
143 | o 7:02de42196ebe H
143 | o 7:02de42196ebe H
144 | |
144 | |
145 o | 6:eea13746799a G
145 o | 6:eea13746799a G
146 |\|
146 |\|
147 | o 5:24b6387c8c8c F
147 | o 5:24b6387c8c8c F
148 | |
148 | |
149 o | 4:9520eea781bc E
149 o | 4:9520eea781bc E
150 |/
150 |/
151 o 0:cd010b8cd998 A
151 o 0:cd010b8cd998 A
152
152
153 $ hg log --hidden -G
153 $ hg log --hidden -G
154 o 10:5ae4c968c6ac C
154 o 10:5ae4c968c6ac C
155 |
155 |
156 @ 9:08483444fef9 D
156 @ 9:08483444fef9 D
157 |
157 |
158 o 8:8877864f1edb B
158 o 8:8877864f1edb B
159 |
159 |
160 | o 7:02de42196ebe H
160 | o 7:02de42196ebe H
161 | |
161 | |
162 o | 6:eea13746799a G
162 o | 6:eea13746799a G
163 |\|
163 |\|
164 | o 5:24b6387c8c8c F
164 | o 5:24b6387c8c8c F
165 | |
165 | |
166 o | 4:9520eea781bc E
166 o | 4:9520eea781bc E
167 |/
167 |/
168 | x 3:32af7686d403 D (pruned using rebase)
168 | x 3:32af7686d403 D (pruned using rebase)
169 | |
169 | |
170 | x 2:5fddd98957c8 C (rewritten using rebase as 10:5ae4c968c6ac)
170 | x 2:5fddd98957c8 C (rewritten using rebase as 10:5ae4c968c6ac)
171 | |
171 | |
172 | x 1:42ccdea3bb16 B (pruned using rebase)
172 | x 1:42ccdea3bb16 B (pruned using rebase)
173 |/
173 |/
174 o 0:cd010b8cd998 A
174 o 0:cd010b8cd998 A
175
175
176 $ hg debugobsolete
176 $ hg debugobsolete
177 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'rebase', 'user': 'test'}
177 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'rebase', 'user': 'test'}
178 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
178 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
179 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'rebase', 'user': 'test'}
179 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'rebase', 'user': 'test'}
180
180
181
181
182 More complex case where part of the rebase set were already rebased
182 More complex case where part of the rebase set were already rebased
183
183
184 $ hg rebase --rev 'desc(D)' --dest 'desc(H)'
184 $ hg rebase --rev 'desc(D)' --dest 'desc(H)'
185 rebasing 9:08483444fef9 "D"
185 rebasing 9:08483444fef9 "D"
186 1 new orphan changesets
186 1 new orphan changesets
187 $ hg debugobsolete
187 $ hg debugobsolete
188 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'rebase', 'user': 'test'}
188 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'rebase', 'user': 'test'}
189 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
189 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
190 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'rebase', 'user': 'test'}
190 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'rebase', 'user': 'test'}
191 08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
191 08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
192 $ hg log -G
192 $ hg log -G
193 @ 11:4596109a6a43 D
193 @ 11:4596109a6a43 D
194 |
194 |
195 | * 10:5ae4c968c6ac C
195 | * 10:5ae4c968c6ac C
196 | |
196 | |
197 | x 9:08483444fef9 D (rewritten using rebase as 11:4596109a6a43)
197 | x 9:08483444fef9 D (rewritten using rebase as 11:4596109a6a43)
198 | |
198 | |
199 | o 8:8877864f1edb B
199 | o 8:8877864f1edb B
200 | |
200 | |
201 o | 7:02de42196ebe H
201 o | 7:02de42196ebe H
202 | |
202 | |
203 | o 6:eea13746799a G
203 | o 6:eea13746799a G
204 |/|
204 |/|
205 o | 5:24b6387c8c8c F
205 o | 5:24b6387c8c8c F
206 | |
206 | |
207 | o 4:9520eea781bc E
207 | o 4:9520eea781bc E
208 |/
208 |/
209 o 0:cd010b8cd998 A
209 o 0:cd010b8cd998 A
210
210
211 $ hg rebase --source 'desc(B)' --dest 'tip' --config experimental.rebaseskipobsolete=True
211 $ hg rebase --source 'desc(B)' --dest 'tip' --config experimental.rebaseskipobsolete=True
212 rebasing 8:8877864f1edb "B"
212 rebasing 8:8877864f1edb "B"
213 note: not rebasing 9:08483444fef9 "D", already in destination as 11:4596109a6a43 "D" (tip)
213 note: not rebasing 9:08483444fef9 "D", already in destination as 11:4596109a6a43 "D" (tip)
214 rebasing 10:5ae4c968c6ac "C"
214 rebasing 10:5ae4c968c6ac "C"
215 $ hg debugobsolete
215 $ hg debugobsolete
216 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'rebase', 'user': 'test'}
216 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'rebase', 'user': 'test'}
217 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
217 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
218 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'rebase', 'user': 'test'}
218 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'rebase', 'user': 'test'}
219 08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
219 08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
220 8877864f1edb05d0e07dc4ba77b67a80a7b86672 462a34d07e599b87ea08676a449373fe4e2e1347 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
220 8877864f1edb05d0e07dc4ba77b67a80a7b86672 462a34d07e599b87ea08676a449373fe4e2e1347 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
221 5ae4c968c6aca831df823664e706c9d4aa34473d 98f6af4ee9539e14da4465128f894c274900b6e5 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
221 5ae4c968c6aca831df823664e706c9d4aa34473d 98f6af4ee9539e14da4465128f894c274900b6e5 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
222 $ hg log --rev 'contentdivergent()'
222 $ hg log --rev 'contentdivergent()'
223 $ hg log -G
223 $ hg log -G
224 o 13:98f6af4ee953 C
224 o 13:98f6af4ee953 C
225 |
225 |
226 o 12:462a34d07e59 B
226 o 12:462a34d07e59 B
227 |
227 |
228 @ 11:4596109a6a43 D
228 @ 11:4596109a6a43 D
229 |
229 |
230 o 7:02de42196ebe H
230 o 7:02de42196ebe H
231 |
231 |
232 | o 6:eea13746799a G
232 | o 6:eea13746799a G
233 |/|
233 |/|
234 o | 5:24b6387c8c8c F
234 o | 5:24b6387c8c8c F
235 | |
235 | |
236 | o 4:9520eea781bc E
236 | o 4:9520eea781bc E
237 |/
237 |/
238 o 0:cd010b8cd998 A
238 o 0:cd010b8cd998 A
239
239
240 $ hg log --style default --debug -r 4596109a6a4328c398bde3a4a3b6737cfade3003
240 $ hg log --style default --debug -r 4596109a6a4328c398bde3a4a3b6737cfade3003
241 changeset: 11:4596109a6a4328c398bde3a4a3b6737cfade3003
241 changeset: 11:4596109a6a4328c398bde3a4a3b6737cfade3003
242 phase: draft
242 phase: draft
243 parent: 7:02de42196ebee42ef284b6780a87cdc96e8eaab6
243 parent: 7:02de42196ebee42ef284b6780a87cdc96e8eaab6
244 parent: -1:0000000000000000000000000000000000000000
244 parent: -1:0000000000000000000000000000000000000000
245 manifest: 11:a91006e3a02f1edf631f7018e6e5684cf27dd905
245 manifest: 11:a91006e3a02f1edf631f7018e6e5684cf27dd905
246 user: Nicolas Dumazet <nicdumz.commits@gmail.com>
246 user: Nicolas Dumazet <nicdumz.commits@gmail.com>
247 date: Sat Apr 30 15:24:48 2011 +0200
247 date: Sat Apr 30 15:24:48 2011 +0200
248 files+: D
248 files+: D
249 extra: branch=default
249 extra: branch=default
250 extra: rebase_source=08483444fef91d6224f6655ee586a65d263ad34c
250 extra: rebase_source=08483444fef91d6224f6655ee586a65d263ad34c
251 extra: source=32af7686d403cf45b5d95f2d70cebea587ac806a
251 extra: source=32af7686d403cf45b5d95f2d70cebea587ac806a
252 description:
252 description:
253 D
253 D
254
254
255
255
256 $ hg up -qr 'desc(G)'
256 $ hg up -qr 'desc(G)'
257 $ hg graft 4596109a6a4328c398bde3a4a3b6737cfade3003
257 $ hg graft 4596109a6a4328c398bde3a4a3b6737cfade3003
258 grafting 11:4596109a6a43 "D"
258 grafting 11:4596109a6a43 "D"
259 $ hg up -qr 'desc(E)'
259 $ hg up -qr 'desc(E)'
260 $ hg rebase -s tip -d .
260 $ hg rebase -s tip -d .
261 rebasing 14:9e36056a46e3 "D" (tip)
261 rebasing 14:9e36056a46e3 "D" (tip)
262 $ hg log --style default --debug -r tip
262 $ hg log --style default --debug -r tip
263 changeset: 15:627d4614809036ba22b9e7cb31638ddc06ab99ab
263 changeset: 15:627d4614809036ba22b9e7cb31638ddc06ab99ab
264 tag: tip
264 tag: tip
265 phase: draft
265 phase: draft
266 parent: 4:9520eea781bcca16c1e15acc0ba14335a0e8e5ba
266 parent: 4:9520eea781bcca16c1e15acc0ba14335a0e8e5ba
267 parent: -1:0000000000000000000000000000000000000000
267 parent: -1:0000000000000000000000000000000000000000
268 manifest: 15:648e8ede73ae3e497d093d3a4c8fcc2daa864f42
268 manifest: 15:648e8ede73ae3e497d093d3a4c8fcc2daa864f42
269 user: Nicolas Dumazet <nicdumz.commits@gmail.com>
269 user: Nicolas Dumazet <nicdumz.commits@gmail.com>
270 date: Sat Apr 30 15:24:48 2011 +0200
270 date: Sat Apr 30 15:24:48 2011 +0200
271 files+: D
271 files+: D
272 extra: branch=default
272 extra: branch=default
273 extra: intermediate-source=4596109a6a4328c398bde3a4a3b6737cfade3003
273 extra: intermediate-source=4596109a6a4328c398bde3a4a3b6737cfade3003
274 extra: rebase_source=9e36056a46e37c9776168c7375734eebc70e294f
274 extra: rebase_source=9e36056a46e37c9776168c7375734eebc70e294f
275 extra: source=32af7686d403cf45b5d95f2d70cebea587ac806a
275 extra: source=32af7686d403cf45b5d95f2d70cebea587ac806a
276 description:
276 description:
277 D
277 D
278
278
279
279
280 Start rebase from a commit that is obsolete but not hidden only because it's
280 Start rebase from a commit that is obsolete but not hidden only because it's
281 a working copy parent. We should be moved back to the starting commit as usual
281 a working copy parent. We should be moved back to the starting commit as usual
282 even though it is hidden (until we're moved there).
282 even though it is hidden (until we're moved there).
283
283
284 $ hg --hidden up -qr 'first(hidden())'
284 $ hg --hidden up -qr 'first(hidden())'
285 updated to hidden changeset 42ccdea3bb16
285 updated to hidden changeset 42ccdea3bb16
286 (hidden revision '42ccdea3bb16' is pruned)
286 (hidden revision '42ccdea3bb16' is pruned)
287 $ hg rebase --rev 13 --dest 15
287 $ hg rebase --rev 13 --dest 15
288 rebasing 13:98f6af4ee953 "C"
288 rebasing 13:98f6af4ee953 "C"
289 $ hg log -G
289 $ hg log -G
290 o 16:294a2b93eb4d C
290 o 16:294a2b93eb4d C
291 |
291 |
292 o 15:627d46148090 D
292 o 15:627d46148090 D
293 |
293 |
294 | o 12:462a34d07e59 B
294 | o 12:462a34d07e59 B
295 | |
295 | |
296 | o 11:4596109a6a43 D
296 | o 11:4596109a6a43 D
297 | |
297 | |
298 | o 7:02de42196ebe H
298 | o 7:02de42196ebe H
299 | |
299 | |
300 +---o 6:eea13746799a G
300 +---o 6:eea13746799a G
301 | |/
301 | |/
302 | o 5:24b6387c8c8c F
302 | o 5:24b6387c8c8c F
303 | |
303 | |
304 o | 4:9520eea781bc E
304 o | 4:9520eea781bc E
305 |/
305 |/
306 | @ 1:42ccdea3bb16 B (pruned using rebase)
306 | @ 1:42ccdea3bb16 B (pruned using rebase)
307 |/
307 |/
308 o 0:cd010b8cd998 A
308 o 0:cd010b8cd998 A
309
309
310
310
311 $ cd ..
311 $ cd ..
312
312
313 collapse rebase
313 collapse rebase
314 ---------------------------------
314 ---------------------------------
315
315
316 $ hg clone base collapse
316 $ hg clone base collapse
317 updating to branch default
317 updating to branch default
318 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
318 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
319 $ cd collapse
319 $ cd collapse
320 $ hg rebase -s 42ccdea3bb16 -d eea13746799a --collapse
320 $ hg rebase -s 42ccdea3bb16 -d eea13746799a --collapse
321 rebasing 1:42ccdea3bb16 "B"
321 rebasing 1:42ccdea3bb16 "B"
322 rebasing 2:5fddd98957c8 "C"
322 rebasing 2:5fddd98957c8 "C"
323 rebasing 3:32af7686d403 "D"
323 rebasing 3:32af7686d403 "D"
324 $ hg log -G
324 $ hg log -G
325 o 8:4dc2197e807b Collapsed revision
325 o 8:4dc2197e807b Collapsed revision
326 |
326 |
327 | @ 7:02de42196ebe H
327 | @ 7:02de42196ebe H
328 | |
328 | |
329 o | 6:eea13746799a G
329 o | 6:eea13746799a G
330 |\|
330 |\|
331 | o 5:24b6387c8c8c F
331 | o 5:24b6387c8c8c F
332 | |
332 | |
333 o | 4:9520eea781bc E
333 o | 4:9520eea781bc E
334 |/
334 |/
335 o 0:cd010b8cd998 A
335 o 0:cd010b8cd998 A
336
336
337 $ hg log --hidden -G
337 $ hg log --hidden -G
338 o 8:4dc2197e807b Collapsed revision
338 o 8:4dc2197e807b Collapsed revision
339 |
339 |
340 | @ 7:02de42196ebe H
340 | @ 7:02de42196ebe H
341 | |
341 | |
342 o | 6:eea13746799a G
342 o | 6:eea13746799a G
343 |\|
343 |\|
344 | o 5:24b6387c8c8c F
344 | o 5:24b6387c8c8c F
345 | |
345 | |
346 o | 4:9520eea781bc E
346 o | 4:9520eea781bc E
347 |/
347 |/
348 | x 3:32af7686d403 D (rewritten using rebase as 8:4dc2197e807b)
348 | x 3:32af7686d403 D (rewritten using rebase as 8:4dc2197e807b)
349 | |
349 | |
350 | x 2:5fddd98957c8 C (rewritten using rebase as 8:4dc2197e807b)
350 | x 2:5fddd98957c8 C (rewritten using rebase as 8:4dc2197e807b)
351 | |
351 | |
352 | x 1:42ccdea3bb16 B (rewritten using rebase as 8:4dc2197e807b)
352 | x 1:42ccdea3bb16 B (rewritten using rebase as 8:4dc2197e807b)
353 |/
353 |/
354 o 0:cd010b8cd998 A
354 o 0:cd010b8cd998 A
355
355
356 $ hg id --debug -r tip
356 $ hg id --debug -r tip
357 4dc2197e807bae9817f09905b50ab288be2dbbcf tip
357 4dc2197e807bae9817f09905b50ab288be2dbbcf tip
358 $ hg debugobsolete
358 $ hg debugobsolete
359 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'rebase', 'user': 'test'}
359 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'rebase', 'user': 'test'}
360 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'rebase', 'user': 'test'}
360 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'rebase', 'user': 'test'}
361 32af7686d403cf45b5d95f2d70cebea587ac806a 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'rebase', 'user': 'test'}
361 32af7686d403cf45b5d95f2d70cebea587ac806a 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'rebase', 'user': 'test'}
362
362
363 $ cd ..
363 $ cd ..
364
364
365 Rebase set has hidden descendants
365 Rebase set has hidden descendants
366 ---------------------------------
366 ---------------------------------
367
367
368 We rebase a changeset which has hidden descendants. Hidden changesets must not
368 We rebase a changeset which has hidden descendants. Hidden changesets must not
369 be rebased.
369 be rebased.
370
370
371 $ hg clone base hidden
371 $ hg clone base hidden
372 updating to branch default
372 updating to branch default
373 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
373 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
374 $ cd hidden
374 $ cd hidden
375 $ hg log -G
375 $ hg log -G
376 @ 7:02de42196ebe H
376 @ 7:02de42196ebe H
377 |
377 |
378 | o 6:eea13746799a G
378 | o 6:eea13746799a G
379 |/|
379 |/|
380 o | 5:24b6387c8c8c F
380 o | 5:24b6387c8c8c F
381 | |
381 | |
382 | o 4:9520eea781bc E
382 | o 4:9520eea781bc E
383 |/
383 |/
384 | o 3:32af7686d403 D
384 | o 3:32af7686d403 D
385 | |
385 | |
386 | o 2:5fddd98957c8 C
386 | o 2:5fddd98957c8 C
387 | |
387 | |
388 | o 1:42ccdea3bb16 B
388 | o 1:42ccdea3bb16 B
389 |/
389 |/
390 o 0:cd010b8cd998 A
390 o 0:cd010b8cd998 A
391
391
392 $ hg rebase -s 5fddd98957c8 -d eea13746799a
392 $ hg rebase -s 5fddd98957c8 -d eea13746799a
393 rebasing 2:5fddd98957c8 "C"
393 rebasing 2:5fddd98957c8 "C"
394 rebasing 3:32af7686d403 "D"
394 rebasing 3:32af7686d403 "D"
395 $ hg log -G
395 $ hg log -G
396 o 9:cf44d2f5a9f4 D
396 o 9:cf44d2f5a9f4 D
397 |
397 |
398 o 8:e273c5e7d2d2 C
398 o 8:e273c5e7d2d2 C
399 |
399 |
400 | @ 7:02de42196ebe H
400 | @ 7:02de42196ebe H
401 | |
401 | |
402 o | 6:eea13746799a G
402 o | 6:eea13746799a G
403 |\|
403 |\|
404 | o 5:24b6387c8c8c F
404 | o 5:24b6387c8c8c F
405 | |
405 | |
406 o | 4:9520eea781bc E
406 o | 4:9520eea781bc E
407 |/
407 |/
408 | o 1:42ccdea3bb16 B
408 | o 1:42ccdea3bb16 B
409 |/
409 |/
410 o 0:cd010b8cd998 A
410 o 0:cd010b8cd998 A
411
411
412 $ hg rebase -s 42ccdea3bb16 -d 02de42196ebe
412 $ hg rebase -s 42ccdea3bb16 -d 02de42196ebe
413 rebasing 1:42ccdea3bb16 "B"
413 rebasing 1:42ccdea3bb16 "B"
414 $ hg log -G
414 $ hg log -G
415 o 10:7c6027df6a99 B
415 o 10:7c6027df6a99 B
416 |
416 |
417 | o 9:cf44d2f5a9f4 D
417 | o 9:cf44d2f5a9f4 D
418 | |
418 | |
419 | o 8:e273c5e7d2d2 C
419 | o 8:e273c5e7d2d2 C
420 | |
420 | |
421 @ | 7:02de42196ebe H
421 @ | 7:02de42196ebe H
422 | |
422 | |
423 | o 6:eea13746799a G
423 | o 6:eea13746799a G
424 |/|
424 |/|
425 o | 5:24b6387c8c8c F
425 o | 5:24b6387c8c8c F
426 | |
426 | |
427 | o 4:9520eea781bc E
427 | o 4:9520eea781bc E
428 |/
428 |/
429 o 0:cd010b8cd998 A
429 o 0:cd010b8cd998 A
430
430
431 $ hg log --hidden -G
431 $ hg log --hidden -G
432 o 10:7c6027df6a99 B
432 o 10:7c6027df6a99 B
433 |
433 |
434 | o 9:cf44d2f5a9f4 D
434 | o 9:cf44d2f5a9f4 D
435 | |
435 | |
436 | o 8:e273c5e7d2d2 C
436 | o 8:e273c5e7d2d2 C
437 | |
437 | |
438 @ | 7:02de42196ebe H
438 @ | 7:02de42196ebe H
439 | |
439 | |
440 | o 6:eea13746799a G
440 | o 6:eea13746799a G
441 |/|
441 |/|
442 o | 5:24b6387c8c8c F
442 o | 5:24b6387c8c8c F
443 | |
443 | |
444 | o 4:9520eea781bc E
444 | o 4:9520eea781bc E
445 |/
445 |/
446 | x 3:32af7686d403 D (rewritten using rebase as 9:cf44d2f5a9f4)
446 | x 3:32af7686d403 D (rewritten using rebase as 9:cf44d2f5a9f4)
447 | |
447 | |
448 | x 2:5fddd98957c8 C (rewritten using rebase as 8:e273c5e7d2d2)
448 | x 2:5fddd98957c8 C (rewritten using rebase as 8:e273c5e7d2d2)
449 | |
449 | |
450 | x 1:42ccdea3bb16 B (rewritten using rebase as 10:7c6027df6a99)
450 | x 1:42ccdea3bb16 B (rewritten using rebase as 10:7c6027df6a99)
451 |/
451 |/
452 o 0:cd010b8cd998 A
452 o 0:cd010b8cd998 A
453
453
454 $ hg debugobsolete
454 $ hg debugobsolete
455 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b e273c5e7d2d29df783dce9f9eaa3ac4adc69c15d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
455 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b e273c5e7d2d29df783dce9f9eaa3ac4adc69c15d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
456 32af7686d403cf45b5d95f2d70cebea587ac806a cf44d2f5a9f4297a62be94cbdd3dff7c7dc54258 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
456 32af7686d403cf45b5d95f2d70cebea587ac806a cf44d2f5a9f4297a62be94cbdd3dff7c7dc54258 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
457 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 7c6027df6a99d93f461868e5433f63bde20b6dfb 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
457 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 7c6027df6a99d93f461868e5433f63bde20b6dfb 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
458
458
459 Test that rewriting leaving instability behind is allowed
459 Test that rewriting leaving instability behind is allowed
460 ---------------------------------------------------------------------
460 ---------------------------------------------------------------------
461
461
462 $ hg log -r 'children(8)'
462 $ hg log -r 'children(8)'
463 9:cf44d2f5a9f4 D (no-eol)
463 9:cf44d2f5a9f4 D (no-eol)
464 $ hg rebase -r 8
464 $ hg rebase -r 8
465 rebasing 8:e273c5e7d2d2 "C"
465 rebasing 8:e273c5e7d2d2 "C"
466 1 new orphan changesets
466 1 new orphan changesets
467 $ hg log -G
467 $ hg log -G
468 o 11:0d8f238b634c C
468 o 11:0d8f238b634c C
469 |
469 |
470 o 10:7c6027df6a99 B
470 o 10:7c6027df6a99 B
471 |
471 |
472 | * 9:cf44d2f5a9f4 D
472 | * 9:cf44d2f5a9f4 D
473 | |
473 | |
474 | x 8:e273c5e7d2d2 C (rewritten using rebase as 11:0d8f238b634c)
474 | x 8:e273c5e7d2d2 C (rewritten using rebase as 11:0d8f238b634c)
475 | |
475 | |
476 @ | 7:02de42196ebe H
476 @ | 7:02de42196ebe H
477 | |
477 | |
478 | o 6:eea13746799a G
478 | o 6:eea13746799a G
479 |/|
479 |/|
480 o | 5:24b6387c8c8c F
480 o | 5:24b6387c8c8c F
481 | |
481 | |
482 | o 4:9520eea781bc E
482 | o 4:9520eea781bc E
483 |/
483 |/
484 o 0:cd010b8cd998 A
484 o 0:cd010b8cd998 A
485
485
486 $ cd ..
486 $ cd ..
487 $ cp -R hidden stabilize
487 $ cp -R hidden stabilize
488 $ cd stabilize
488 $ cd stabilize
489 $ hg rebase --auto-orphans '0::' -d 10
489 $ hg rebase --auto-orphans '0::' -d 10
490 abort: --auto-orphans is incompatible with --dest
490 abort: --auto-orphans is incompatible with --dest
491 [255]
491 [255]
492 $ hg rebase --auto-orphans '0::'
492 $ hg rebase --auto-orphans '0::'
493 rebasing 9:cf44d2f5a9f4 "D"
493 rebasing 9:cf44d2f5a9f4 "D"
494 $ hg log -G
494 $ hg log -G
495 o 12:7e3935feaa68 D
495 o 12:7e3935feaa68 D
496 |
496 |
497 o 11:0d8f238b634c C
497 o 11:0d8f238b634c C
498 |
498 |
499 o 10:7c6027df6a99 B
499 o 10:7c6027df6a99 B
500 |
500 |
501 @ 7:02de42196ebe H
501 @ 7:02de42196ebe H
502 |
502 |
503 | o 6:eea13746799a G
503 | o 6:eea13746799a G
504 |/|
504 |/|
505 o | 5:24b6387c8c8c F
505 o | 5:24b6387c8c8c F
506 | |
506 | |
507 | o 4:9520eea781bc E
507 | o 4:9520eea781bc E
508 |/
508 |/
509 o 0:cd010b8cd998 A
509 o 0:cd010b8cd998 A
510
510
511
511
512 $ cd ../hidden
512 $ cd ../hidden
513 $ rm -r ../stabilize
513 $ rm -r ../stabilize
514
514
515 Test multiple root handling
515 Test multiple root handling
516 ------------------------------------
516 ------------------------------------
517
517
518 $ hg rebase --dest 4 --rev '7+11+9'
518 $ hg rebase --dest 4 --rev '7+11+9'
519 rebasing 9:cf44d2f5a9f4 "D"
519 rebasing 9:cf44d2f5a9f4 "D"
520 rebasing 7:02de42196ebe "H"
520 rebasing 7:02de42196ebe "H"
521 rebasing 11:0d8f238b634c "C" (tip)
521 rebasing 11:0d8f238b634c "C" (tip)
522 $ hg log -G
522 $ hg log -G
523 o 14:1e8370e38cca C
523 o 14:1e8370e38cca C
524 |
524 |
525 @ 13:bfe264faf697 H
525 @ 13:bfe264faf697 H
526 |
526 |
527 | o 12:102b4c1d889b D
527 | o 12:102b4c1d889b D
528 |/
528 |/
529 | * 10:7c6027df6a99 B
529 | * 10:7c6027df6a99 B
530 | |
530 | |
531 | x 7:02de42196ebe H (rewritten using rebase as 13:bfe264faf697)
531 | x 7:02de42196ebe H (rewritten using rebase as 13:bfe264faf697)
532 | |
532 | |
533 +---o 6:eea13746799a G
533 +---o 6:eea13746799a G
534 | |/
534 | |/
535 | o 5:24b6387c8c8c F
535 | o 5:24b6387c8c8c F
536 | |
536 | |
537 o | 4:9520eea781bc E
537 o | 4:9520eea781bc E
538 |/
538 |/
539 o 0:cd010b8cd998 A
539 o 0:cd010b8cd998 A
540
540
541 $ cd ..
541 $ cd ..
542
542
543 Detach both parents
543 Detach both parents
544
544
545 $ hg init double-detach
545 $ hg init double-detach
546 $ cd double-detach
546 $ cd double-detach
547
547
548 $ hg debugdrawdag <<EOF
548 $ hg debugdrawdag <<EOF
549 > F
549 > F
550 > /|
550 > /|
551 > C E
551 > C E
552 > | |
552 > | |
553 > B D G
553 > B D G
554 > \|/
554 > \|/
555 > A
555 > A
556 > EOF
556 > EOF
557
557
558 $ hg rebase -d G -r 'B + D + F'
558 $ hg rebase -d G -r 'B + D + F'
559 rebasing 1:112478962961 "B" (B)
559 rebasing 1:112478962961 "B" (B)
560 rebasing 2:b18e25de2cf5 "D" (D)
560 rebasing 2:b18e25de2cf5 "D" (D)
561 rebasing 6:f15c3adaf214 "F" (F tip)
561 rebasing 6:f15c3adaf214 "F" (F tip)
562 abort: cannot rebase 6:f15c3adaf214 without moving at least one of its parents
562 abort: cannot rebase 6:f15c3adaf214 without moving at least one of its parents
563 [255]
563 [255]
564
564
565 $ cd ..
565 $ cd ..
566
566
567 test on rebase dropping a merge
567 test on rebase dropping a merge
568
568
569 (setup)
569 (setup)
570
570
571 $ hg init dropmerge
571 $ hg init dropmerge
572 $ cd dropmerge
572 $ cd dropmerge
573 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
573 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
574 adding changesets
574 adding changesets
575 adding manifests
575 adding manifests
576 adding file changes
576 adding file changes
577 added 8 changesets with 7 changes to 7 files (+2 heads)
577 added 8 changesets with 7 changes to 7 files (+2 heads)
578 new changesets cd010b8cd998:02de42196ebe
578 new changesets cd010b8cd998:02de42196ebe
579 (run 'hg heads' to see heads, 'hg merge' to merge)
579 (run 'hg heads' to see heads, 'hg merge' to merge)
580 $ hg up 3
580 $ hg up 3
581 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
581 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
582 $ hg merge 7
582 $ hg merge 7
583 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
583 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
584 (branch merge, don't forget to commit)
584 (branch merge, don't forget to commit)
585 $ hg ci -m 'M'
585 $ hg ci -m 'M'
586 $ echo I > I
586 $ echo I > I
587 $ hg add I
587 $ hg add I
588 $ hg ci -m I
588 $ hg ci -m I
589 $ hg log -G
589 $ hg log -G
590 @ 9:4bde274eefcf I
590 @ 9:4bde274eefcf I
591 |
591 |
592 o 8:53a6a128b2b7 M
592 o 8:53a6a128b2b7 M
593 |\
593 |\
594 | o 7:02de42196ebe H
594 | o 7:02de42196ebe H
595 | |
595 | |
596 | | o 6:eea13746799a G
596 | | o 6:eea13746799a G
597 | |/|
597 | |/|
598 | o | 5:24b6387c8c8c F
598 | o | 5:24b6387c8c8c F
599 | | |
599 | | |
600 | | o 4:9520eea781bc E
600 | | o 4:9520eea781bc E
601 | |/
601 | |/
602 o | 3:32af7686d403 D
602 o | 3:32af7686d403 D
603 | |
603 | |
604 o | 2:5fddd98957c8 C
604 o | 2:5fddd98957c8 C
605 | |
605 | |
606 o | 1:42ccdea3bb16 B
606 o | 1:42ccdea3bb16 B
607 |/
607 |/
608 o 0:cd010b8cd998 A
608 o 0:cd010b8cd998 A
609
609
610 (actual test)
610 (actual test)
611
611
612 $ hg rebase --dest 6 --rev '((desc(H) + desc(D))::) - desc(M)'
612 $ hg rebase --dest 6 --rev '((desc(H) + desc(D))::) - desc(M)'
613 rebasing 3:32af7686d403 "D"
613 rebasing 3:32af7686d403 "D"
614 rebasing 7:02de42196ebe "H"
614 rebasing 7:02de42196ebe "H"
615 rebasing 9:4bde274eefcf "I" (tip)
615 rebasing 9:4bde274eefcf "I" (tip)
616 1 new orphan changesets
616 1 new orphan changesets
617 $ hg log -G
617 $ hg log -G
618 @ 12:acd174b7ab39 I
618 @ 12:acd174b7ab39 I
619 |
619 |
620 o 11:6c11a6218c97 H
620 o 11:6c11a6218c97 H
621 |
621 |
622 | o 10:b5313c85b22e D
622 | o 10:b5313c85b22e D
623 |/
623 |/
624 | * 8:53a6a128b2b7 M
624 | * 8:53a6a128b2b7 M
625 | |\
625 | |\
626 | | x 7:02de42196ebe H (rewritten using rebase as 11:6c11a6218c97)
626 | | x 7:02de42196ebe H (rewritten using rebase as 11:6c11a6218c97)
627 | | |
627 | | |
628 o---+ 6:eea13746799a G
628 o---+ 6:eea13746799a G
629 | | |
629 | | |
630 | | o 5:24b6387c8c8c F
630 | | o 5:24b6387c8c8c F
631 | | |
631 | | |
632 o---+ 4:9520eea781bc E
632 o---+ 4:9520eea781bc E
633 / /
633 / /
634 x | 3:32af7686d403 D (rewritten using rebase as 10:b5313c85b22e)
634 x | 3:32af7686d403 D (rewritten using rebase as 10:b5313c85b22e)
635 | |
635 | |
636 o | 2:5fddd98957c8 C
636 o | 2:5fddd98957c8 C
637 | |
637 | |
638 o | 1:42ccdea3bb16 B
638 o | 1:42ccdea3bb16 B
639 |/
639 |/
640 o 0:cd010b8cd998 A
640 o 0:cd010b8cd998 A
641
641
642
642
643 Test hidden changesets in the rebase set (issue4504)
643 Test hidden changesets in the rebase set (issue4504)
644
644
645 $ hg up --hidden 9
645 $ hg up --hidden 9
646 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
646 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
647 updated to hidden changeset 4bde274eefcf
647 updated to hidden changeset 4bde274eefcf
648 (hidden revision '4bde274eefcf' was rewritten as: acd174b7ab39)
648 (hidden revision '4bde274eefcf' was rewritten as: acd174b7ab39)
649 $ echo J > J
649 $ echo J > J
650 $ hg add J
650 $ hg add J
651 $ hg commit -m J
651 $ hg commit -m J
652 1 new orphan changesets
652 1 new orphan changesets
653 $ hg debugobsolete `hg log --rev . -T '{node}'`
653 $ hg debugobsolete `hg log --rev . -T '{node}'`
654 obsoleted 1 changesets
654 obsoleted 1 changesets
655
655
656 $ hg rebase --rev .~1::. --dest 'max(desc(D))' --traceback --config experimental.rebaseskipobsolete=off
656 $ hg rebase --rev .~1::. --dest 'max(desc(D))' --traceback --config experimental.rebaseskipobsolete=off
657 rebasing 9:4bde274eefcf "I"
657 rebasing 9:4bde274eefcf "I"
658 rebasing 13:06edfc82198f "J" (tip)
658 rebasing 13:06edfc82198f "J" (tip)
659 2 new content-divergent changesets
659 2 new content-divergent changesets
660 $ hg log -G
660 $ hg log -G
661 @ 15:5ae8a643467b J
661 @ 15:5ae8a643467b J
662 |
662 |
663 * 14:9ad579b4a5de I
663 * 14:9ad579b4a5de I
664 |
664 |
665 | * 12:acd174b7ab39 I
665 | * 12:acd174b7ab39 I
666 | |
666 | |
667 | o 11:6c11a6218c97 H
667 | o 11:6c11a6218c97 H
668 | |
668 | |
669 o | 10:b5313c85b22e D
669 o | 10:b5313c85b22e D
670 |/
670 |/
671 | * 8:53a6a128b2b7 M
671 | * 8:53a6a128b2b7 M
672 | |\
672 | |\
673 | | x 7:02de42196ebe H (rewritten using rebase as 11:6c11a6218c97)
673 | | x 7:02de42196ebe H (rewritten using rebase as 11:6c11a6218c97)
674 | | |
674 | | |
675 o---+ 6:eea13746799a G
675 o---+ 6:eea13746799a G
676 | | |
676 | | |
677 | | o 5:24b6387c8c8c F
677 | | o 5:24b6387c8c8c F
678 | | |
678 | | |
679 o---+ 4:9520eea781bc E
679 o---+ 4:9520eea781bc E
680 / /
680 / /
681 x | 3:32af7686d403 D (rewritten using rebase as 10:b5313c85b22e)
681 x | 3:32af7686d403 D (rewritten using rebase as 10:b5313c85b22e)
682 | |
682 | |
683 o | 2:5fddd98957c8 C
683 o | 2:5fddd98957c8 C
684 | |
684 | |
685 o | 1:42ccdea3bb16 B
685 o | 1:42ccdea3bb16 B
686 |/
686 |/
687 o 0:cd010b8cd998 A
687 o 0:cd010b8cd998 A
688
688
689 $ hg up 14 -C
689 $ hg up 14 -C
690 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
690 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
691 $ echo "K" > K
691 $ echo "K" > K
692 $ hg add K
692 $ hg add K
693 $ hg commit --amend -m "K"
693 $ hg commit --amend -m "K"
694 1 new orphan changesets
694 1 new orphan changesets
695 $ echo "L" > L
695 $ echo "L" > L
696 $ hg add L
696 $ hg add L
697 $ hg commit -m "L"
697 $ hg commit -m "L"
698 $ hg up '.^'
698 $ hg up '.^'
699 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
699 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
700 $ echo "M" > M
700 $ echo "M" > M
701 $ hg add M
701 $ hg add M
702 $ hg commit --amend -m "M"
702 $ hg commit --amend -m "M"
703 1 new orphan changesets
703 1 new orphan changesets
704 $ hg log -G
704 $ hg log -G
705 @ 18:bfaedf8eb73b M
705 @ 18:bfaedf8eb73b M
706 |
706 |
707 | * 17:97219452e4bd L
707 | * 17:97219452e4bd L
708 | |
708 | |
709 | x 16:fc37a630c901 K (rewritten using amend as 18:bfaedf8eb73b)
709 | x 16:fc37a630c901 K (rewritten using amend as 18:bfaedf8eb73b)
710 |/
710 |/
711 | * 15:5ae8a643467b J
711 | * 15:5ae8a643467b J
712 | |
712 | |
713 | x 14:9ad579b4a5de I (rewritten using amend as 16:fc37a630c901)
713 | x 14:9ad579b4a5de I (rewritten using amend as 16:fc37a630c901)
714 |/
714 |/
715 | * 12:acd174b7ab39 I
715 | * 12:acd174b7ab39 I
716 | |
716 | |
717 | o 11:6c11a6218c97 H
717 | o 11:6c11a6218c97 H
718 | |
718 | |
719 o | 10:b5313c85b22e D
719 o | 10:b5313c85b22e D
720 |/
720 |/
721 | * 8:53a6a128b2b7 M
721 | * 8:53a6a128b2b7 M
722 | |\
722 | |\
723 | | x 7:02de42196ebe H (rewritten using rebase as 11:6c11a6218c97)
723 | | x 7:02de42196ebe H (rewritten using rebase as 11:6c11a6218c97)
724 | | |
724 | | |
725 o---+ 6:eea13746799a G
725 o---+ 6:eea13746799a G
726 | | |
726 | | |
727 | | o 5:24b6387c8c8c F
727 | | o 5:24b6387c8c8c F
728 | | |
728 | | |
729 o---+ 4:9520eea781bc E
729 o---+ 4:9520eea781bc E
730 / /
730 / /
731 x | 3:32af7686d403 D (rewritten using rebase as 10:b5313c85b22e)
731 x | 3:32af7686d403 D (rewritten using rebase as 10:b5313c85b22e)
732 | |
732 | |
733 o | 2:5fddd98957c8 C
733 o | 2:5fddd98957c8 C
734 | |
734 | |
735 o | 1:42ccdea3bb16 B
735 o | 1:42ccdea3bb16 B
736 |/
736 |/
737 o 0:cd010b8cd998 A
737 o 0:cd010b8cd998 A
738
738
739 $ hg rebase -s 14 -d 17 --config experimental.rebaseskipobsolete=True
739 $ hg rebase -s 14 -d 17 --config experimental.rebaseskipobsolete=True
740 note: not rebasing 14:9ad579b4a5de "I", already in destination as 16:fc37a630c901 "K"
740 note: not rebasing 14:9ad579b4a5de "I", already in destination as 16:fc37a630c901 "K"
741 rebasing 15:5ae8a643467b "J"
741 rebasing 15:5ae8a643467b "J"
742 1 new orphan changesets
742 1 new orphan changesets
743
743
744 $ cd ..
744 $ cd ..
745
745
746 Skip obsolete changeset even with multiple hops
746 Skip obsolete changeset even with multiple hops
747 -----------------------------------------------
747 -----------------------------------------------
748
748
749 setup
749 setup
750
750
751 $ hg init obsskip
751 $ hg init obsskip
752 $ cd obsskip
752 $ cd obsskip
753 $ cat << EOF >> .hg/hgrc
753 $ cat << EOF >> .hg/hgrc
754 > [experimental]
754 > [experimental]
755 > rebaseskipobsolete = True
755 > rebaseskipobsolete = True
756 > [extensions]
756 > [extensions]
757 > strip =
757 > strip =
758 > EOF
758 > EOF
759 $ echo A > A
759 $ echo A > A
760 $ hg add A
760 $ hg add A
761 $ hg commit -m A
761 $ hg commit -m A
762 $ echo B > B
762 $ echo B > B
763 $ hg add B
763 $ hg add B
764 $ hg commit -m B0
764 $ hg commit -m B0
765 $ hg commit --amend -m B1
765 $ hg commit --amend -m B1
766 $ hg commit --amend -m B2
766 $ hg commit --amend -m B2
767 $ hg up --hidden 'desc(B0)'
767 $ hg up --hidden 'desc(B0)'
768 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
768 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
769 updated to hidden changeset a8b11f55fb19
769 updated to hidden changeset a8b11f55fb19
770 (hidden revision 'a8b11f55fb19' was rewritten as: 261e70097290)
770 (hidden revision 'a8b11f55fb19' was rewritten as: 261e70097290)
771 $ echo C > C
771 $ echo C > C
772 $ hg add C
772 $ hg add C
773 $ hg commit -m C
773 $ hg commit -m C
774 1 new orphan changesets
774 1 new orphan changesets
775 $ hg log -G
775 $ hg log -G
776 @ 4:212cb178bcbb C
776 @ 4:212cb178bcbb C
777 |
777 |
778 | o 3:261e70097290 B2
778 | o 3:261e70097290 B2
779 | |
779 | |
780 x | 1:a8b11f55fb19 B0 (rewritten using amend as 3:261e70097290)
780 x | 1:a8b11f55fb19 B0 (rewritten using amend as 3:261e70097290)
781 |/
781 |/
782 o 0:4a2df7238c3b A
782 o 0:4a2df7238c3b A
783
783
784
784
785 Rebase finds its way in a chain of marker
785 Rebase finds its way in a chain of marker
786
786
787 $ hg rebase -d 'desc(B2)'
787 $ hg rebase -d 'desc(B2)'
788 note: not rebasing 1:a8b11f55fb19 "B0", already in destination as 3:261e70097290 "B2"
788 note: not rebasing 1:a8b11f55fb19 "B0", already in destination as 3:261e70097290 "B2"
789 rebasing 4:212cb178bcbb "C" (tip)
789 rebasing 4:212cb178bcbb "C" (tip)
790
790
791 Even when the chain include missing node
791 Even when the chain include missing node
792
792
793 $ hg up --hidden 'desc(B0)'
793 $ hg up --hidden 'desc(B0)'
794 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
794 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
795 updated to hidden changeset a8b11f55fb19
795 updated to hidden changeset a8b11f55fb19
796 (hidden revision 'a8b11f55fb19' was rewritten as: 261e70097290)
796 (hidden revision 'a8b11f55fb19' was rewritten as: 261e70097290)
797 $ echo D > D
797 $ echo D > D
798 $ hg add D
798 $ hg add D
799 $ hg commit -m D
799 $ hg commit -m D
800 1 new orphan changesets
800 1 new orphan changesets
801 $ hg --hidden strip -r 'desc(B1)'
801 $ hg --hidden strip -r 'desc(B1)'
802 saved backup bundle to $TESTTMP/obsskip/.hg/strip-backup/86f6414ccda7-b1c452ee-backup.hg
802 saved backup bundle to $TESTTMP/obsskip/.hg/strip-backup/86f6414ccda7-b1c452ee-backup.hg
803 1 new orphan changesets
803 1 new orphan changesets
804 $ hg log -G
804 $ hg log -G
805 @ 5:1a79b7535141 D
805 @ 5:1a79b7535141 D
806 |
806 |
807 | o 4:ff2c4d47b71d C
807 | o 4:ff2c4d47b71d C
808 | |
808 | |
809 | o 2:261e70097290 B2
809 | o 2:261e70097290 B2
810 | |
810 | |
811 x | 1:a8b11f55fb19 B0 (rewritten using amend as 2:261e70097290)
811 x | 1:a8b11f55fb19 B0 (rewritten using amend as 2:261e70097290)
812 |/
812 |/
813 o 0:4a2df7238c3b A
813 o 0:4a2df7238c3b A
814
814
815
815
816 $ hg rebase -d 'desc(B2)'
816 $ hg rebase -d 'desc(B2)'
817 note: not rebasing 1:a8b11f55fb19 "B0", already in destination as 2:261e70097290 "B2"
817 note: not rebasing 1:a8b11f55fb19 "B0", already in destination as 2:261e70097290 "B2"
818 rebasing 5:1a79b7535141 "D" (tip)
818 rebasing 5:1a79b7535141 "D" (tip)
819 $ hg up 4
819 $ hg up 4
820 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
820 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
821 $ echo "O" > O
821 $ echo "O" > O
822 $ hg add O
822 $ hg add O
823 $ hg commit -m O
823 $ hg commit -m O
824 $ echo "P" > P
824 $ echo "P" > P
825 $ hg add P
825 $ hg add P
826 $ hg commit -m P
826 $ hg commit -m P
827 $ hg log -G
827 $ hg log -G
828 @ 8:8d47583e023f P
828 @ 8:8d47583e023f P
829 |
829 |
830 o 7:360bbaa7d3ce O
830 o 7:360bbaa7d3ce O
831 |
831 |
832 | o 6:9c48361117de D
832 | o 6:9c48361117de D
833 | |
833 | |
834 o | 4:ff2c4d47b71d C
834 o | 4:ff2c4d47b71d C
835 |/
835 |/
836 o 2:261e70097290 B2
836 o 2:261e70097290 B2
837 |
837 |
838 o 0:4a2df7238c3b A
838 o 0:4a2df7238c3b A
839
839
840 $ hg debugobsolete `hg log -r 7 -T '{node}\n'` --config experimental.evolution=true
840 $ hg debugobsolete `hg log -r 7 -T '{node}\n'` --config experimental.evolution=true
841 obsoleted 1 changesets
841 obsoleted 1 changesets
842 1 new orphan changesets
842 1 new orphan changesets
843 $ hg rebase -d 6 -r "4::"
843 $ hg rebase -d 6 -r "4::"
844 rebasing 4:ff2c4d47b71d "C"
844 rebasing 4:ff2c4d47b71d "C"
845 note: not rebasing 7:360bbaa7d3ce "O", it has no successor
845 note: not rebasing 7:360bbaa7d3ce "O", it has no successor
846 rebasing 8:8d47583e023f "P" (tip)
846 rebasing 8:8d47583e023f "P" (tip)
847
847
848 If all the changeset to be rebased are obsolete and present in the destination, we
848 If all the changeset to be rebased are obsolete and present in the destination, we
849 should display a friendly error message
849 should display a friendly error message
850
850
851 $ hg log -G
851 $ hg log -G
852 @ 10:121d9e3bc4c6 P
852 @ 10:121d9e3bc4c6 P
853 |
853 |
854 o 9:4be60e099a77 C
854 o 9:4be60e099a77 C
855 |
855 |
856 o 6:9c48361117de D
856 o 6:9c48361117de D
857 |
857 |
858 o 2:261e70097290 B2
858 o 2:261e70097290 B2
859 |
859 |
860 o 0:4a2df7238c3b A
860 o 0:4a2df7238c3b A
861
861
862
862
863 $ hg up 9
863 $ hg up 9
864 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
864 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
865 $ echo "non-relevant change" > nonrelevant
865 $ echo "non-relevant change" > nonrelevant
866 $ hg add nonrelevant
866 $ hg add nonrelevant
867 $ hg commit -m nonrelevant
867 $ hg commit -m nonrelevant
868 created new head
868 created new head
869 $ hg debugobsolete `hg log -r 11 -T '{node}\n'` --config experimental.evolution=true
869 $ hg debugobsolete `hg log -r 11 -T '{node}\n'` --config experimental.evolution=true
870 obsoleted 1 changesets
870 obsoleted 1 changesets
871 $ hg log -G
871 $ hg log -G
872 @ 11:f44da1f4954c nonrelevant (pruned)
872 @ 11:f44da1f4954c nonrelevant (pruned)
873 |
873 |
874 | o 10:121d9e3bc4c6 P
874 | o 10:121d9e3bc4c6 P
875 |/
875 |/
876 o 9:4be60e099a77 C
876 o 9:4be60e099a77 C
877 |
877 |
878 o 6:9c48361117de D
878 o 6:9c48361117de D
879 |
879 |
880 o 2:261e70097290 B2
880 o 2:261e70097290 B2
881 |
881 |
882 o 0:4a2df7238c3b A
882 o 0:4a2df7238c3b A
883
883
884 $ hg rebase -r . -d 10
884 $ hg rebase -r . -d 10
885 note: not rebasing 11:f44da1f4954c "nonrelevant" (tip), it has no successor
885 note: not rebasing 11:f44da1f4954c "nonrelevant" (tip), it has no successor
886
886
887 If a rebase is going to create divergence, it should abort
887 If a rebase is going to create divergence, it should abort
888
888
889 $ hg log -G
889 $ hg log -G
890 @ 10:121d9e3bc4c6 P
890 @ 10:121d9e3bc4c6 P
891 |
891 |
892 o 9:4be60e099a77 C
892 o 9:4be60e099a77 C
893 |
893 |
894 o 6:9c48361117de D
894 o 6:9c48361117de D
895 |
895 |
896 o 2:261e70097290 B2
896 o 2:261e70097290 B2
897 |
897 |
898 o 0:4a2df7238c3b A
898 o 0:4a2df7238c3b A
899
899
900
900
901 $ hg up 9
901 $ hg up 9
902 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
902 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
903 $ echo "john" > doe
903 $ echo "john" > doe
904 $ hg add doe
904 $ hg add doe
905 $ hg commit -m "john doe"
905 $ hg commit -m "john doe"
906 created new head
906 created new head
907 $ hg up 10
907 $ hg up 10
908 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
908 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
909 $ echo "foo" > bar
909 $ echo "foo" > bar
910 $ hg add bar
910 $ hg add bar
911 $ hg commit --amend -m "10'"
911 $ hg commit --amend -m "10'"
912 $ hg up 10 --hidden
912 $ hg up 10 --hidden
913 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
913 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
914 updated to hidden changeset 121d9e3bc4c6
914 updated to hidden changeset 121d9e3bc4c6
915 (hidden revision '121d9e3bc4c6' was rewritten as: 77d874d096a2)
915 (hidden revision '121d9e3bc4c6' was rewritten as: 77d874d096a2)
916 $ echo "bar" > foo
916 $ echo "bar" > foo
917 $ hg add foo
917 $ hg add foo
918 $ hg commit -m "bar foo"
918 $ hg commit -m "bar foo"
919 1 new orphan changesets
919 1 new orphan changesets
920 $ hg log -G
920 $ hg log -G
921 @ 14:73568ab6879d bar foo
921 @ 14:73568ab6879d bar foo
922 |
922 |
923 | o 13:77d874d096a2 10'
923 | o 13:77d874d096a2 10'
924 | |
924 | |
925 | | o 12:3eb461388009 john doe
925 | | o 12:3eb461388009 john doe
926 | |/
926 | |/
927 x | 10:121d9e3bc4c6 P (rewritten using amend as 13:77d874d096a2)
927 x | 10:121d9e3bc4c6 P (rewritten using amend as 13:77d874d096a2)
928 |/
928 |/
929 o 9:4be60e099a77 C
929 o 9:4be60e099a77 C
930 |
930 |
931 o 6:9c48361117de D
931 o 6:9c48361117de D
932 |
932 |
933 o 2:261e70097290 B2
933 o 2:261e70097290 B2
934 |
934 |
935 o 0:4a2df7238c3b A
935 o 0:4a2df7238c3b A
936
936
937 $ hg summary
937 $ hg summary
938 parent: 14:73568ab6879d tip (orphan)
938 parent: 14:73568ab6879d tip (orphan)
939 bar foo
939 bar foo
940 branch: default
940 branch: default
941 commit: (clean)
941 commit: (clean)
942 update: 2 new changesets, 3 branch heads (merge)
942 update: 2 new changesets, 3 branch heads (merge)
943 phases: 8 draft
943 phases: 8 draft
944 orphan: 1 changesets
944 orphan: 1 changesets
945 $ hg rebase -s 10 -d 12
945 $ hg rebase -s 10 -d 12
946 abort: this rebase will cause divergences from: 121d9e3bc4c6
946 abort: this rebase will cause divergences from: 121d9e3bc4c6
947 (to force the rebase please set experimental.evolution.allowdivergence=True)
947 (to force the rebase please set experimental.evolution.allowdivergence=True)
948 [255]
948 [255]
949 $ hg log -G
949 $ hg log -G
950 @ 14:73568ab6879d bar foo
950 @ 14:73568ab6879d bar foo
951 |
951 |
952 | o 13:77d874d096a2 10'
952 | o 13:77d874d096a2 10'
953 | |
953 | |
954 | | o 12:3eb461388009 john doe
954 | | o 12:3eb461388009 john doe
955 | |/
955 | |/
956 x | 10:121d9e3bc4c6 P (rewritten using amend as 13:77d874d096a2)
956 x | 10:121d9e3bc4c6 P (rewritten using amend as 13:77d874d096a2)
957 |/
957 |/
958 o 9:4be60e099a77 C
958 o 9:4be60e099a77 C
959 |
959 |
960 o 6:9c48361117de D
960 o 6:9c48361117de D
961 |
961 |
962 o 2:261e70097290 B2
962 o 2:261e70097290 B2
963 |
963 |
964 o 0:4a2df7238c3b A
964 o 0:4a2df7238c3b A
965
965
966 With experimental.evolution.allowdivergence=True, rebase can create divergence
966 With experimental.evolution.allowdivergence=True, rebase can create divergence
967
967
968 $ hg rebase -s 10 -d 12 --config experimental.evolution.allowdivergence=True
968 $ hg rebase -s 10 -d 12 --config experimental.evolution.allowdivergence=True
969 rebasing 10:121d9e3bc4c6 "P"
969 rebasing 10:121d9e3bc4c6 "P"
970 rebasing 14:73568ab6879d "bar foo" (tip)
970 rebasing 14:73568ab6879d "bar foo" (tip)
971 2 new content-divergent changesets
971 2 new content-divergent changesets
972 $ hg summary
972 $ hg summary
973 parent: 16:61bd55f69bc4 tip
973 parent: 16:61bd55f69bc4 tip
974 bar foo
974 bar foo
975 branch: default
975 branch: default
976 commit: (clean)
976 commit: (clean)
977 update: 1 new changesets, 2 branch heads (merge)
977 update: 1 new changesets, 2 branch heads (merge)
978 phases: 8 draft
978 phases: 8 draft
979 content-divergent: 2 changesets
979 content-divergent: 2 changesets
980
980
981 rebase --continue + skipped rev because their successors are in destination
981 rebase --continue + skipped rev because their successors are in destination
982 we make a change in trunk and work on conflicting changes to make rebase abort.
982 we make a change in trunk and work on conflicting changes to make rebase abort.
983
983
984 $ hg log -G -r 16::
984 $ hg log -G -r 16::
985 @ 16:61bd55f69bc4 bar foo
985 @ 16:61bd55f69bc4 bar foo
986 |
986 |
987 ~
987 ~
988
988
989 Create the two changes in trunk
989 Create the two changes in trunk
990 $ printf "a" > willconflict
990 $ printf "a" > willconflict
991 $ hg add willconflict
991 $ hg add willconflict
992 $ hg commit -m "willconflict first version"
992 $ hg commit -m "willconflict first version"
993
993
994 $ printf "dummy" > C
994 $ printf "dummy" > C
995 $ hg commit -m "dummy change successor"
995 $ hg commit -m "dummy change successor"
996
996
997 Create the changes that we will rebase
997 Create the changes that we will rebase
998 $ hg update -C 16 -q
998 $ hg update -C 16 -q
999 $ printf "b" > willconflict
999 $ printf "b" > willconflict
1000 $ hg add willconflict
1000 $ hg add willconflict
1001 $ hg commit -m "willconflict second version"
1001 $ hg commit -m "willconflict second version"
1002 created new head
1002 created new head
1003 $ printf "dummy" > K
1003 $ printf "dummy" > K
1004 $ hg add K
1004 $ hg add K
1005 $ hg commit -m "dummy change"
1005 $ hg commit -m "dummy change"
1006 $ printf "dummy" > L
1006 $ printf "dummy" > L
1007 $ hg add L
1007 $ hg add L
1008 $ hg commit -m "dummy change"
1008 $ hg commit -m "dummy change"
1009 $ hg debugobsolete `hg log -r ".^" -T '{node}'` `hg log -r 18 -T '{node}'` --config experimental.evolution=true
1009 $ hg debugobsolete `hg log -r ".^" -T '{node}'` `hg log -r 18 -T '{node}'` --config experimental.evolution=true
1010 obsoleted 1 changesets
1010 obsoleted 1 changesets
1011 1 new orphan changesets
1011 1 new orphan changesets
1012
1012
1013 $ hg log -G -r 16::
1013 $ hg log -G -r 16::
1014 @ 21:7bdc8a87673d dummy change
1014 @ 21:7bdc8a87673d dummy change
1015 |
1015 |
1016 x 20:8b31da3c4919 dummy change (rewritten as 18:601db7a18f51)
1016 x 20:8b31da3c4919 dummy change (rewritten as 18:601db7a18f51)
1017 |
1017 |
1018 o 19:b82fb57ea638 willconflict second version
1018 o 19:b82fb57ea638 willconflict second version
1019 |
1019 |
1020 | o 18:601db7a18f51 dummy change successor
1020 | o 18:601db7a18f51 dummy change successor
1021 | |
1021 | |
1022 | o 17:357ddf1602d5 willconflict first version
1022 | o 17:357ddf1602d5 willconflict first version
1023 |/
1023 |/
1024 o 16:61bd55f69bc4 bar foo
1024 o 16:61bd55f69bc4 bar foo
1025 |
1025 |
1026 ~
1026 ~
1027 $ hg rebase -r ".^^ + .^ + ." -d 18
1027 $ hg rebase -r ".^^ + .^ + ." -d 18
1028 rebasing 19:b82fb57ea638 "willconflict second version"
1028 rebasing 19:b82fb57ea638 "willconflict second version"
1029 merging willconflict
1029 merging willconflict
1030 warning: conflicts while merging willconflict! (edit, then use 'hg resolve --mark')
1030 warning: conflicts while merging willconflict! (edit, then use 'hg resolve --mark')
1031 unresolved conflicts (see hg resolve, then hg rebase --continue)
1031 unresolved conflicts (see hg resolve, then hg rebase --continue)
1032 [1]
1032 [1]
1033
1033
1034 $ hg resolve --mark willconflict
1034 $ hg resolve --mark willconflict
1035 (no more unresolved files)
1035 (no more unresolved files)
1036 continue: hg rebase --continue
1036 continue: hg rebase --continue
1037 $ hg rebase --continue
1037 $ hg rebase --continue
1038 rebasing 19:b82fb57ea638 "willconflict second version"
1038 rebasing 19:b82fb57ea638 "willconflict second version"
1039 note: not rebasing 20:8b31da3c4919 "dummy change", already in destination as 18:601db7a18f51 "dummy change successor"
1039 note: not rebasing 20:8b31da3c4919 "dummy change", already in destination as 18:601db7a18f51 "dummy change successor"
1040 rebasing 21:7bdc8a87673d "dummy change" (tip)
1040 rebasing 21:7bdc8a87673d "dummy change" (tip)
1041 $ cd ..
1041 $ cd ..
1042
1042
1043 Divergence cases due to obsolete changesets
1043 Divergence cases due to obsolete changesets
1044 -------------------------------------------
1044 -------------------------------------------
1045
1045
1046 We should ignore branches with unstable changesets when they are based on an
1046 We should ignore branches with unstable changesets when they are based on an
1047 obsolete changeset which successor is in rebase set.
1047 obsolete changeset which successor is in rebase set.
1048
1048
1049 $ hg init divergence
1049 $ hg init divergence
1050 $ cd divergence
1050 $ cd divergence
1051 $ cat >> .hg/hgrc << EOF
1051 $ cat >> .hg/hgrc << EOF
1052 > [extensions]
1052 > [extensions]
1053 > strip =
1053 > strip =
1054 > [alias]
1054 > [alias]
1055 > strip = strip --no-backup --quiet
1055 > strip = strip --no-backup --quiet
1056 > [templates]
1056 > [templates]
1057 > instabilities = '{rev}:{node|short} {desc|firstline}{if(instabilities," ({instabilities})")}\n'
1057 > instabilities = '{rev}:{node|short} {desc|firstline}{if(instabilities," ({instabilities})")}\n'
1058 > EOF
1058 > EOF
1059
1059
1060 $ hg debugdrawdag <<EOF
1060 $ hg debugdrawdag <<EOF
1061 > e f
1061 > e f
1062 > | |
1062 > | |
1063 > d' d # replace: d -> d'
1063 > d' d # replace: d -> d'
1064 > \ /
1064 > \ /
1065 > c
1065 > c
1066 > |
1066 > |
1067 > x b
1067 > x b
1068 > \|
1068 > \|
1069 > a
1069 > a
1070 > EOF
1070 > EOF
1071 1 new orphan changesets
1071 1 new orphan changesets
1072 $ hg log -G -r 'a'::
1072 $ hg log -G -r 'a'::
1073 * 7:1143e9adc121 f
1073 * 7:1143e9adc121 f
1074 |
1074 |
1075 | o 6:d60ebfa0f1cb e
1075 | o 6:d60ebfa0f1cb e
1076 | |
1076 | |
1077 | o 5:027ad6c5830d d'
1077 | o 5:027ad6c5830d d'
1078 | |
1078 | |
1079 x | 4:76be324c128b d (rewritten using replace as 5:027ad6c5830d)
1079 x | 4:76be324c128b d (rewritten using replace as 5:027ad6c5830d)
1080 |/
1080 |/
1081 o 3:a82ac2b38757 c
1081 o 3:a82ac2b38757 c
1082 |
1082 |
1083 | o 2:630d7c95eff7 x
1083 | o 2:630d7c95eff7 x
1084 | |
1084 | |
1085 o | 1:488e1b7e7341 b
1085 o | 1:488e1b7e7341 b
1086 |/
1086 |/
1087 o 0:b173517d0057 a
1087 o 0:b173517d0057 a
1088
1088
1089
1089
1090 Changeset d and its descendants are excluded to avoid divergence of d, which
1090 Changeset d and its descendants are excluded to avoid divergence of d, which
1091 would occur because the successor of d (d') is also in rebaseset. As a
1091 would occur because the successor of d (d') is also in rebaseset. As a
1092 consequence f (descendant of d) is left behind.
1092 consequence f (descendant of d) is left behind.
1093
1093
1094 $ hg rebase -b 'e' -d 'x'
1094 $ hg rebase -b 'e' -d 'x'
1095 rebasing 1:488e1b7e7341 "b" (b)
1095 rebasing 1:488e1b7e7341 "b" (b)
1096 rebasing 3:a82ac2b38757 "c" (c)
1096 rebasing 3:a82ac2b38757 "c" (c)
1097 rebasing 5:027ad6c5830d "d'" (d')
1097 rebasing 5:027ad6c5830d "d'" (d')
1098 rebasing 6:d60ebfa0f1cb "e" (e)
1098 rebasing 6:d60ebfa0f1cb "e" (e)
1099 note: not rebasing 4:76be324c128b "d" (d) and its descendants as this would cause divergence
1099 note: not rebasing 4:76be324c128b "d" (d) and its descendants as this would cause divergence
1100 $ hg log -G -r 'a'::
1100 $ hg log -G -r 'a'::
1101 o 11:eb6d63fc4ed5 e
1101 o 11:eb6d63fc4ed5 e
1102 |
1102 |
1103 o 10:44d8c724a70c d'
1103 o 10:44d8c724a70c d'
1104 |
1104 |
1105 o 9:d008e6b4d3fd c
1105 o 9:d008e6b4d3fd c
1106 |
1106 |
1107 o 8:67e8f4a16c49 b
1107 o 8:67e8f4a16c49 b
1108 |
1108 |
1109 | * 7:1143e9adc121 f
1109 | * 7:1143e9adc121 f
1110 | |
1110 | |
1111 | | x 6:d60ebfa0f1cb e (rewritten using rebase as 11:eb6d63fc4ed5)
1111 | | x 6:d60ebfa0f1cb e (rewritten using rebase as 11:eb6d63fc4ed5)
1112 | | |
1112 | | |
1113 | | x 5:027ad6c5830d d' (rewritten using rebase as 10:44d8c724a70c)
1113 | | x 5:027ad6c5830d d' (rewritten using rebase as 10:44d8c724a70c)
1114 | | |
1114 | | |
1115 | x | 4:76be324c128b d (rewritten using replace as 5:027ad6c5830d)
1115 | x | 4:76be324c128b d (rewritten using replace as 5:027ad6c5830d)
1116 | |/
1116 | |/
1117 | x 3:a82ac2b38757 c (rewritten using rebase as 9:d008e6b4d3fd)
1117 | x 3:a82ac2b38757 c (rewritten using rebase as 9:d008e6b4d3fd)
1118 | |
1118 | |
1119 o | 2:630d7c95eff7 x
1119 o | 2:630d7c95eff7 x
1120 | |
1120 | |
1121 | x 1:488e1b7e7341 b (rewritten using rebase as 8:67e8f4a16c49)
1121 | x 1:488e1b7e7341 b (rewritten using rebase as 8:67e8f4a16c49)
1122 |/
1122 |/
1123 o 0:b173517d0057 a
1123 o 0:b173517d0057 a
1124
1124
1125 $ hg strip -r 8:
1125 $ hg strip -r 8:
1126
1126
1127 If the rebase set has an obsolete (d) with a successor (d') outside the rebase
1127 If the rebase set has an obsolete (d) with a successor (d') outside the rebase
1128 set and none in destination, we still get the divergence warning.
1128 set and none in destination, we still get the divergence warning.
1129 By allowing divergence, we can perform the rebase.
1129 By allowing divergence, we can perform the rebase.
1130
1130
1131 $ hg rebase -r 'c'::'f' -d 'x'
1131 $ hg rebase -r 'c'::'f' -d 'x'
1132 abort: this rebase will cause divergences from: 76be324c128b
1132 abort: this rebase will cause divergences from: 76be324c128b
1133 (to force the rebase please set experimental.evolution.allowdivergence=True)
1133 (to force the rebase please set experimental.evolution.allowdivergence=True)
1134 [255]
1134 [255]
1135 $ hg rebase --config experimental.evolution.allowdivergence=true -r 'c'::'f' -d 'x'
1135 $ hg rebase --config experimental.evolution.allowdivergence=true -r 'c'::'f' -d 'x'
1136 rebasing 3:a82ac2b38757 "c" (c)
1136 rebasing 3:a82ac2b38757 "c" (c)
1137 rebasing 4:76be324c128b "d" (d)
1137 rebasing 4:76be324c128b "d" (d)
1138 rebasing 7:1143e9adc121 "f" (f tip)
1138 rebasing 7:1143e9adc121 "f" (f tip)
1139 1 new orphan changesets
1139 1 new orphan changesets
1140 2 new content-divergent changesets
1140 2 new content-divergent changesets
1141 $ hg log -G -r 'a':: -T instabilities
1141 $ hg log -G -r 'a':: -T instabilities
1142 o 10:e1744ea07510 f
1142 o 10:e1744ea07510 f
1143 |
1143 |
1144 * 9:e2b36ea9a0a0 d (content-divergent)
1144 * 9:e2b36ea9a0a0 d (content-divergent)
1145 |
1145 |
1146 o 8:6a0376de376e c
1146 o 8:6a0376de376e c
1147 |
1147 |
1148 | x 7:1143e9adc121 f
1148 | x 7:1143e9adc121 f
1149 | |
1149 | |
1150 | | * 6:d60ebfa0f1cb e (orphan)
1150 | | * 6:d60ebfa0f1cb e (orphan)
1151 | | |
1151 | | |
1152 | | * 5:027ad6c5830d d' (orphan content-divergent)
1152 | | * 5:027ad6c5830d d' (orphan content-divergent)
1153 | | |
1153 | | |
1154 | x | 4:76be324c128b d
1154 | x | 4:76be324c128b d
1155 | |/
1155 | |/
1156 | x 3:a82ac2b38757 c
1156 | x 3:a82ac2b38757 c
1157 | |
1157 | |
1158 o | 2:630d7c95eff7 x
1158 o | 2:630d7c95eff7 x
1159 | |
1159 | |
1160 | o 1:488e1b7e7341 b
1160 | o 1:488e1b7e7341 b
1161 |/
1161 |/
1162 o 0:b173517d0057 a
1162 o 0:b173517d0057 a
1163
1163
1164 $ hg strip -r 8:
1164 $ hg strip -r 8:
1165
1165
1166 (Not skipping obsoletes means that divergence is allowed.)
1166 (Not skipping obsoletes means that divergence is allowed.)
1167
1167
1168 $ hg rebase --config experimental.rebaseskipobsolete=false -r 'c'::'f' -d 'x'
1168 $ hg rebase --config experimental.rebaseskipobsolete=false -r 'c'::'f' -d 'x'
1169 rebasing 3:a82ac2b38757 "c" (c)
1169 rebasing 3:a82ac2b38757 "c" (c)
1170 rebasing 4:76be324c128b "d" (d)
1170 rebasing 4:76be324c128b "d" (d)
1171 rebasing 7:1143e9adc121 "f" (f tip)
1171 rebasing 7:1143e9adc121 "f" (f tip)
1172 1 new orphan changesets
1172 1 new orphan changesets
1173 2 new content-divergent changesets
1173 2 new content-divergent changesets
1174
1174
1175 $ hg strip -r 0:
1175 $ hg strip -r 0:
1176
1176
1177 Similar test on a more complex graph
1177 Similar test on a more complex graph
1178
1178
1179 $ hg debugdrawdag <<EOF
1179 $ hg debugdrawdag <<EOF
1180 > g
1180 > g
1181 > |
1181 > |
1182 > f e
1182 > f e
1183 > | |
1183 > | |
1184 > e' d # replace: e -> e'
1184 > e' d # replace: e -> e'
1185 > \ /
1185 > \ /
1186 > c
1186 > c
1187 > |
1187 > |
1188 > x b
1188 > x b
1189 > \|
1189 > \|
1190 > a
1190 > a
1191 > EOF
1191 > EOF
1192 1 new orphan changesets
1192 1 new orphan changesets
1193 $ hg log -G -r 'a':
1193 $ hg log -G -r 'a':
1194 * 8:2876ce66c6eb g
1194 * 8:2876ce66c6eb g
1195 |
1195 |
1196 | o 7:3ffec603ab53 f
1196 | o 7:3ffec603ab53 f
1197 | |
1197 | |
1198 x | 6:e36fae928aec e (rewritten using replace as 5:63324dc512ea)
1198 x | 6:e36fae928aec e (rewritten using replace as 5:63324dc512ea)
1199 | |
1199 | |
1200 | o 5:63324dc512ea e'
1200 | o 5:63324dc512ea e'
1201 | |
1201 | |
1202 o | 4:76be324c128b d
1202 o | 4:76be324c128b d
1203 |/
1203 |/
1204 o 3:a82ac2b38757 c
1204 o 3:a82ac2b38757 c
1205 |
1205 |
1206 | o 2:630d7c95eff7 x
1206 | o 2:630d7c95eff7 x
1207 | |
1207 | |
1208 o | 1:488e1b7e7341 b
1208 o | 1:488e1b7e7341 b
1209 |/
1209 |/
1210 o 0:b173517d0057 a
1210 o 0:b173517d0057 a
1211
1211
1212 $ hg rebase -b 'f' -d 'x'
1212 $ hg rebase -b 'f' -d 'x'
1213 rebasing 1:488e1b7e7341 "b" (b)
1213 rebasing 1:488e1b7e7341 "b" (b)
1214 rebasing 3:a82ac2b38757 "c" (c)
1214 rebasing 3:a82ac2b38757 "c" (c)
1215 rebasing 5:63324dc512ea "e'" (e')
1215 rebasing 5:63324dc512ea "e'" (e')
1216 rebasing 7:3ffec603ab53 "f" (f)
1216 rebasing 7:3ffec603ab53 "f" (f)
1217 rebasing 4:76be324c128b "d" (d)
1217 rebasing 4:76be324c128b "d" (d)
1218 note: not rebasing 6:e36fae928aec "e" (e) and its descendants as this would cause divergence
1218 note: not rebasing 6:e36fae928aec "e" (e) and its descendants as this would cause divergence
1219 $ hg log -G -r 'a':
1219 $ hg log -G -r 'a':
1220 o 13:a1707a5b7c2c d
1220 o 13:a1707a5b7c2c d
1221 |
1221 |
1222 | o 12:ef6251596616 f
1222 | o 12:ef6251596616 f
1223 | |
1223 | |
1224 | o 11:b6f172e64af9 e'
1224 | o 11:b6f172e64af9 e'
1225 |/
1225 |/
1226 o 10:d008e6b4d3fd c
1226 o 10:d008e6b4d3fd c
1227 |
1227 |
1228 o 9:67e8f4a16c49 b
1228 o 9:67e8f4a16c49 b
1229 |
1229 |
1230 | * 8:2876ce66c6eb g
1230 | * 8:2876ce66c6eb g
1231 | |
1231 | |
1232 | | x 7:3ffec603ab53 f (rewritten using rebase as 12:ef6251596616)
1232 | | x 7:3ffec603ab53 f (rewritten using rebase as 12:ef6251596616)
1233 | | |
1233 | | |
1234 | x | 6:e36fae928aec e (rewritten using replace as 5:63324dc512ea)
1234 | x | 6:e36fae928aec e (rewritten using replace as 5:63324dc512ea)
1235 | | |
1235 | | |
1236 | | x 5:63324dc512ea e' (rewritten using rebase as 11:b6f172e64af9)
1236 | | x 5:63324dc512ea e' (rewritten using rebase as 11:b6f172e64af9)
1237 | | |
1237 | | |
1238 | x | 4:76be324c128b d (rewritten using rebase as 13:a1707a5b7c2c)
1238 | x | 4:76be324c128b d (rewritten using rebase as 13:a1707a5b7c2c)
1239 | |/
1239 | |/
1240 | x 3:a82ac2b38757 c (rewritten using rebase as 10:d008e6b4d3fd)
1240 | x 3:a82ac2b38757 c (rewritten using rebase as 10:d008e6b4d3fd)
1241 | |
1241 | |
1242 o | 2:630d7c95eff7 x
1242 o | 2:630d7c95eff7 x
1243 | |
1243 | |
1244 | x 1:488e1b7e7341 b (rewritten using rebase as 9:67e8f4a16c49)
1244 | x 1:488e1b7e7341 b (rewritten using rebase as 9:67e8f4a16c49)
1245 |/
1245 |/
1246 o 0:b173517d0057 a
1246 o 0:b173517d0057 a
1247
1247
1248
1248
1249 issue5782
1249 issue5782
1250 $ hg strip -r 0:
1250 $ hg strip -r 0:
1251 $ hg debugdrawdag <<EOF
1251 $ hg debugdrawdag <<EOF
1252 > d
1252 > d
1253 > |
1253 > |
1254 > c1 c # replace: c -> c1
1254 > c1 c # replace: c -> c1
1255 > \ /
1255 > \ /
1256 > b
1256 > b
1257 > |
1257 > |
1258 > a
1258 > a
1259 > EOF
1259 > EOF
1260 1 new orphan changesets
1260 1 new orphan changesets
1261 $ hg debugobsolete `hg log -T "{node}" --hidden -r 'desc("c1")'`
1261 $ hg debugobsolete `hg log -T "{node}" --hidden -r 'desc("c1")'`
1262 obsoleted 1 changesets
1262 obsoleted 1 changesets
1263 $ hg log -G -r 'a': --hidden
1263 $ hg log -G -r 'a': --hidden
1264 * 4:76be324c128b d
1264 * 4:76be324c128b d
1265 |
1265 |
1266 | x 3:ef8a456de8fa c1 (pruned)
1266 | x 3:ef8a456de8fa c1 (pruned)
1267 | |
1267 | |
1268 x | 2:a82ac2b38757 c (rewritten using replace as 3:ef8a456de8fa)
1268 x | 2:a82ac2b38757 c (rewritten using replace as 3:ef8a456de8fa)
1269 |/
1269 |/
1270 o 1:488e1b7e7341 b
1270 o 1:488e1b7e7341 b
1271 |
1271 |
1272 o 0:b173517d0057 a
1272 o 0:b173517d0057 a
1273
1273
1274 $ hg rebase -d 0 -r 2
1274 $ hg rebase -d 0 -r 2
1275 rebasing 2:a82ac2b38757 "c" (c)
1275 rebasing 2:a82ac2b38757 "c" (c)
1276 $ hg log -G -r 'a': --hidden
1276 $ hg log -G -r 'a': --hidden
1277 o 5:69ad416a4a26 c
1277 o 5:69ad416a4a26 c
1278 |
1278 |
1279 | * 4:76be324c128b d
1279 | * 4:76be324c128b d
1280 | |
1280 | |
1281 | | x 3:ef8a456de8fa c1 (pruned)
1281 | | x 3:ef8a456de8fa c1 (pruned)
1282 | | |
1282 | | |
1283 | x | 2:a82ac2b38757 c (rewritten using replace as 3:ef8a456de8fa rewritten using rebase as 5:69ad416a4a26)
1283 | x | 2:a82ac2b38757 c (rewritten using replace as 3:ef8a456de8fa rewritten using rebase as 5:69ad416a4a26)
1284 | |/
1284 | |/
1285 | o 1:488e1b7e7341 b
1285 | o 1:488e1b7e7341 b
1286 |/
1286 |/
1287 o 0:b173517d0057 a
1287 o 0:b173517d0057 a
1288
1288
1289 $ cd ..
1289 $ cd ..
1290
1290
1291 Rebase merge where successor of one parent is equal to destination (issue5198)
1291 Rebase merge where successor of one parent is equal to destination (issue5198)
1292
1292
1293 $ hg init p1-succ-is-dest
1293 $ hg init p1-succ-is-dest
1294 $ cd p1-succ-is-dest
1294 $ cd p1-succ-is-dest
1295
1295
1296 $ hg debugdrawdag <<EOF
1296 $ hg debugdrawdag <<EOF
1297 > F
1297 > F
1298 > /|
1298 > /|
1299 > E D B # replace: D -> B
1299 > E D B # replace: D -> B
1300 > \|/
1300 > \|/
1301 > A
1301 > A
1302 > EOF
1302 > EOF
1303 1 new orphan changesets
1303 1 new orphan changesets
1304
1304
1305 $ hg rebase -d B -s D
1305 $ hg rebase -d B -s D
1306 note: not rebasing 2:b18e25de2cf5 "D" (D), already in destination as 1:112478962961 "B" (B)
1306 note: not rebasing 2:b18e25de2cf5 "D" (D), already in destination as 1:112478962961 "B" (B)
1307 rebasing 4:66f1a38021c9 "F" (F tip)
1307 rebasing 4:66f1a38021c9 "F" (F tip)
1308 $ hg log -G
1308 $ hg log -G
1309 o 5:50e9d60b99c6 F
1309 o 5:50e9d60b99c6 F
1310 |\
1310 |\
1311 | | x 4:66f1a38021c9 F (rewritten using rebase as 5:50e9d60b99c6)
1311 | | x 4:66f1a38021c9 F (rewritten using rebase as 5:50e9d60b99c6)
1312 | |/|
1312 | |/|
1313 | o | 3:7fb047a69f22 E
1313 | o | 3:7fb047a69f22 E
1314 | | |
1314 | | |
1315 | | x 2:b18e25de2cf5 D (rewritten using replace as 1:112478962961)
1315 | | x 2:b18e25de2cf5 D (rewritten using replace as 1:112478962961)
1316 | |/
1316 | |/
1317 o | 1:112478962961 B
1317 o | 1:112478962961 B
1318 |/
1318 |/
1319 o 0:426bada5c675 A
1319 o 0:426bada5c675 A
1320
1320
1321 $ cd ..
1321 $ cd ..
1322
1322
1323 Rebase merge where successor of other parent is equal to destination
1323 Rebase merge where successor of other parent is equal to destination
1324
1324
1325 $ hg init p2-succ-is-dest
1325 $ hg init p2-succ-is-dest
1326 $ cd p2-succ-is-dest
1326 $ cd p2-succ-is-dest
1327
1327
1328 $ hg debugdrawdag <<EOF
1328 $ hg debugdrawdag <<EOF
1329 > F
1329 > F
1330 > /|
1330 > /|
1331 > E D B # replace: E -> B
1331 > E D B # replace: E -> B
1332 > \|/
1332 > \|/
1333 > A
1333 > A
1334 > EOF
1334 > EOF
1335 1 new orphan changesets
1335 1 new orphan changesets
1336
1336
1337 $ hg rebase -d B -s E
1337 $ hg rebase -d B -s E
1338 note: not rebasing 3:7fb047a69f22 "E" (E), already in destination as 1:112478962961 "B" (B)
1338 note: not rebasing 3:7fb047a69f22 "E" (E), already in destination as 1:112478962961 "B" (B)
1339 rebasing 4:66f1a38021c9 "F" (F tip)
1339 rebasing 4:66f1a38021c9 "F" (F tip)
1340 $ hg log -G
1340 $ hg log -G
1341 o 5:aae1787dacee F
1341 o 5:aae1787dacee F
1342 |\
1342 |\
1343 | | x 4:66f1a38021c9 F (rewritten using rebase as 5:aae1787dacee)
1343 | | x 4:66f1a38021c9 F (rewritten using rebase as 5:aae1787dacee)
1344 | |/|
1344 | |/|
1345 | | x 3:7fb047a69f22 E (rewritten using replace as 1:112478962961)
1345 | | x 3:7fb047a69f22 E (rewritten using replace as 1:112478962961)
1346 | | |
1346 | | |
1347 | o | 2:b18e25de2cf5 D
1347 | o | 2:b18e25de2cf5 D
1348 | |/
1348 | |/
1349 o / 1:112478962961 B
1349 o / 1:112478962961 B
1350 |/
1350 |/
1351 o 0:426bada5c675 A
1351 o 0:426bada5c675 A
1352
1352
1353 $ cd ..
1353 $ cd ..
1354
1354
1355 Rebase merge where successor of one parent is ancestor of destination
1355 Rebase merge where successor of one parent is ancestor of destination
1356
1356
1357 $ hg init p1-succ-in-dest
1357 $ hg init p1-succ-in-dest
1358 $ cd p1-succ-in-dest
1358 $ cd p1-succ-in-dest
1359
1359
1360 $ hg debugdrawdag <<EOF
1360 $ hg debugdrawdag <<EOF
1361 > F C
1361 > F C
1362 > /| |
1362 > /| |
1363 > E D B # replace: D -> B
1363 > E D B # replace: D -> B
1364 > \|/
1364 > \|/
1365 > A
1365 > A
1366 > EOF
1366 > EOF
1367 1 new orphan changesets
1367 1 new orphan changesets
1368
1368
1369 $ hg rebase -d C -s D
1369 $ hg rebase -d C -s D
1370 note: not rebasing 2:b18e25de2cf5 "D" (D), already in destination as 1:112478962961 "B" (B)
1370 note: not rebasing 2:b18e25de2cf5 "D" (D), already in destination as 1:112478962961 "B" (B)
1371 rebasing 5:66f1a38021c9 "F" (F tip)
1371 rebasing 5:66f1a38021c9 "F" (F tip)
1372
1372
1373 $ hg log -G
1373 $ hg log -G
1374 o 6:0913febf6439 F
1374 o 6:0913febf6439 F
1375 |\
1375 |\
1376 +---x 5:66f1a38021c9 F (rewritten using rebase as 6:0913febf6439)
1376 +---x 5:66f1a38021c9 F (rewritten using rebase as 6:0913febf6439)
1377 | | |
1377 | | |
1378 | o | 4:26805aba1e60 C
1378 | o | 4:26805aba1e60 C
1379 | | |
1379 | | |
1380 o | | 3:7fb047a69f22 E
1380 o | | 3:7fb047a69f22 E
1381 | | |
1381 | | |
1382 +---x 2:b18e25de2cf5 D (rewritten using replace as 1:112478962961)
1382 +---x 2:b18e25de2cf5 D (rewritten using replace as 1:112478962961)
1383 | |
1383 | |
1384 | o 1:112478962961 B
1384 | o 1:112478962961 B
1385 |/
1385 |/
1386 o 0:426bada5c675 A
1386 o 0:426bada5c675 A
1387
1387
1388 $ cd ..
1388 $ cd ..
1389
1389
1390 Rebase merge where successor of other parent is ancestor of destination
1390 Rebase merge where successor of other parent is ancestor of destination
1391
1391
1392 $ hg init p2-succ-in-dest
1392 $ hg init p2-succ-in-dest
1393 $ cd p2-succ-in-dest
1393 $ cd p2-succ-in-dest
1394
1394
1395 $ hg debugdrawdag <<EOF
1395 $ hg debugdrawdag <<EOF
1396 > F C
1396 > F C
1397 > /| |
1397 > /| |
1398 > E D B # replace: E -> B
1398 > E D B # replace: E -> B
1399 > \|/
1399 > \|/
1400 > A
1400 > A
1401 > EOF
1401 > EOF
1402 1 new orphan changesets
1402 1 new orphan changesets
1403
1403
1404 $ hg rebase -d C -s E
1404 $ hg rebase -d C -s E
1405 note: not rebasing 3:7fb047a69f22 "E" (E), already in destination as 1:112478962961 "B" (B)
1405 note: not rebasing 3:7fb047a69f22 "E" (E), already in destination as 1:112478962961 "B" (B)
1406 rebasing 5:66f1a38021c9 "F" (F tip)
1406 rebasing 5:66f1a38021c9 "F" (F tip)
1407 $ hg log -G
1407 $ hg log -G
1408 o 6:c6ab0cc6d220 F
1408 o 6:c6ab0cc6d220 F
1409 |\
1409 |\
1410 +---x 5:66f1a38021c9 F (rewritten using rebase as 6:c6ab0cc6d220)
1410 +---x 5:66f1a38021c9 F (rewritten using rebase as 6:c6ab0cc6d220)
1411 | | |
1411 | | |
1412 | o | 4:26805aba1e60 C
1412 | o | 4:26805aba1e60 C
1413 | | |
1413 | | |
1414 | | x 3:7fb047a69f22 E (rewritten using replace as 1:112478962961)
1414 | | x 3:7fb047a69f22 E (rewritten using replace as 1:112478962961)
1415 | | |
1415 | | |
1416 o---+ 2:b18e25de2cf5 D
1416 o---+ 2:b18e25de2cf5 D
1417 / /
1417 / /
1418 o / 1:112478962961 B
1418 o / 1:112478962961 B
1419 |/
1419 |/
1420 o 0:426bada5c675 A
1420 o 0:426bada5c675 A
1421
1421
1422 $ cd ..
1422 $ cd ..
1423
1423
1424 Rebase merge where successor of one parent is ancestor of destination
1424 Rebase merge where successor of one parent is ancestor of destination
1425
1425
1426 $ hg init p1-succ-in-dest-b
1426 $ hg init p1-succ-in-dest-b
1427 $ cd p1-succ-in-dest-b
1427 $ cd p1-succ-in-dest-b
1428
1428
1429 $ hg debugdrawdag <<EOF
1429 $ hg debugdrawdag <<EOF
1430 > F C
1430 > F C
1431 > /| |
1431 > /| |
1432 > E D B # replace: E -> B
1432 > E D B # replace: E -> B
1433 > \|/
1433 > \|/
1434 > A
1434 > A
1435 > EOF
1435 > EOF
1436 1 new orphan changesets
1436 1 new orphan changesets
1437
1437
1438 $ hg rebase -d C -b F
1438 $ hg rebase -d C -b F
1439 rebasing 2:b18e25de2cf5 "D" (D)
1439 rebasing 2:b18e25de2cf5 "D" (D)
1440 note: not rebasing 3:7fb047a69f22 "E" (E), already in destination as 1:112478962961 "B" (B)
1440 note: not rebasing 3:7fb047a69f22 "E" (E), already in destination as 1:112478962961 "B" (B)
1441 rebasing 5:66f1a38021c9 "F" (F tip)
1441 rebasing 5:66f1a38021c9 "F" (F tip)
1442 note: rebase of 5:66f1a38021c9 created no changes to commit
1442 note: rebase of 5:66f1a38021c9 created no changes to commit
1443 $ hg log -G
1443 $ hg log -G
1444 o 6:8f47515dda15 D
1444 o 6:8f47515dda15 D
1445 |
1445 |
1446 | x 5:66f1a38021c9 F (pruned using rebase)
1446 | x 5:66f1a38021c9 F (pruned using rebase)
1447 | |\
1447 | |\
1448 o | | 4:26805aba1e60 C
1448 o | | 4:26805aba1e60 C
1449 | | |
1449 | | |
1450 | | x 3:7fb047a69f22 E (rewritten using replace as 1:112478962961)
1450 | | x 3:7fb047a69f22 E (rewritten using replace as 1:112478962961)
1451 | | |
1451 | | |
1452 | x | 2:b18e25de2cf5 D (rewritten using rebase as 6:8f47515dda15)
1452 | x | 2:b18e25de2cf5 D (rewritten using rebase as 6:8f47515dda15)
1453 | |/
1453 | |/
1454 o / 1:112478962961 B
1454 o / 1:112478962961 B
1455 |/
1455 |/
1456 o 0:426bada5c675 A
1456 o 0:426bada5c675 A
1457
1457
1458 $ cd ..
1458 $ cd ..
1459
1459
1460 Rebase merge where successor of other parent is ancestor of destination
1460 Rebase merge where successor of other parent is ancestor of destination
1461
1461
1462 $ hg init p2-succ-in-dest-b
1462 $ hg init p2-succ-in-dest-b
1463 $ cd p2-succ-in-dest-b
1463 $ cd p2-succ-in-dest-b
1464
1464
1465 $ hg debugdrawdag <<EOF
1465 $ hg debugdrawdag <<EOF
1466 > F C
1466 > F C
1467 > /| |
1467 > /| |
1468 > E D B # replace: D -> B
1468 > E D B # replace: D -> B
1469 > \|/
1469 > \|/
1470 > A
1470 > A
1471 > EOF
1471 > EOF
1472 1 new orphan changesets
1472 1 new orphan changesets
1473
1473
1474 $ hg rebase -d C -b F
1474 $ hg rebase -d C -b F
1475 note: not rebasing 2:b18e25de2cf5 "D" (D), already in destination as 1:112478962961 "B" (B)
1475 note: not rebasing 2:b18e25de2cf5 "D" (D), already in destination as 1:112478962961 "B" (B)
1476 rebasing 3:7fb047a69f22 "E" (E)
1476 rebasing 3:7fb047a69f22 "E" (E)
1477 rebasing 5:66f1a38021c9 "F" (F tip)
1477 rebasing 5:66f1a38021c9 "F" (F tip)
1478 note: rebase of 5:66f1a38021c9 created no changes to commit
1478 note: rebase of 5:66f1a38021c9 created no changes to commit
1479
1479
1480 $ hg log -G
1480 $ hg log -G
1481 o 6:533690786a86 E
1481 o 6:533690786a86 E
1482 |
1482 |
1483 | x 5:66f1a38021c9 F (pruned using rebase)
1483 | x 5:66f1a38021c9 F (pruned using rebase)
1484 | |\
1484 | |\
1485 o | | 4:26805aba1e60 C
1485 o | | 4:26805aba1e60 C
1486 | | |
1486 | | |
1487 | | x 3:7fb047a69f22 E (rewritten using rebase as 6:533690786a86)
1487 | | x 3:7fb047a69f22 E (rewritten using rebase as 6:533690786a86)
1488 | | |
1488 | | |
1489 | x | 2:b18e25de2cf5 D (rewritten using replace as 1:112478962961)
1489 | x | 2:b18e25de2cf5 D (rewritten using replace as 1:112478962961)
1490 | |/
1490 | |/
1491 o / 1:112478962961 B
1491 o / 1:112478962961 B
1492 |/
1492 |/
1493 o 0:426bada5c675 A
1493 o 0:426bada5c675 A
1494
1494
1495 $ cd ..
1495 $ cd ..
1496
1496
1497 $ hg init p2-succ-in-dest-c
1497 $ hg init p2-succ-in-dest-c
1498 $ cd p2-succ-in-dest-c
1498 $ cd p2-succ-in-dest-c
1499
1499
1500 The scenario here was that B::D were developed on default. B was queued on
1500 The scenario here was that B::D were developed on default. B was queued on
1501 stable, but amended before being push to hg-committed. C was queued on default,
1501 stable, but amended before being push to hg-committed. C was queued on default,
1502 along with unrelated J.
1502 along with unrelated J.
1503
1503
1504 $ hg debugdrawdag <<EOF
1504 $ hg debugdrawdag <<EOF
1505 > J
1505 > J
1506 > |
1506 > |
1507 > F
1507 > F
1508 > |
1508 > |
1509 > E
1509 > E
1510 > | D
1510 > | D
1511 > | |
1511 > | |
1512 > | C # replace: C -> F
1512 > | C # replace: C -> F
1513 > | | H I # replace: B -> H -> I
1513 > | | H I # replace: B -> H -> I
1514 > | B |/
1514 > | B |/
1515 > |/ G
1515 > |/ G
1516 > A
1516 > A
1517 > EOF
1517 > EOF
1518 1 new orphan changesets
1518 1 new orphan changesets
1519
1519
1520 This strip seems to be the key to avoid an early divergence warning.
1520 This strip seems to be the key to avoid an early divergence warning.
1521 $ hg --config extensions.strip= --hidden strip -qr H
1521 $ hg --config extensions.strip= --hidden strip -qr H
1522 1 new orphan changesets
1522 1 new orphan changesets
1523
1523
1524 $ hg rebase -b 'desc("D")' -d 'desc("J")'
1524 $ hg rebase -b 'desc("D")' -d 'desc("J")'
1525 abort: this rebase will cause divergences from: 112478962961
1525 abort: this rebase will cause divergences from: 112478962961
1526 (to force the rebase please set experimental.evolution.allowdivergence=True)
1526 (to force the rebase please set experimental.evolution.allowdivergence=True)
1527 [255]
1527 [255]
1528
1528
1529 Rebase merge where both parents have successors in destination
1529 Rebase merge where both parents have successors in destination
1530
1530
1531 $ hg init p12-succ-in-dest
1531 $ hg init p12-succ-in-dest
1532 $ cd p12-succ-in-dest
1532 $ cd p12-succ-in-dest
1533 $ hg debugdrawdag <<'EOS'
1533 $ hg debugdrawdag <<'EOS'
1534 > E F
1534 > E F
1535 > /| /| # replace: A -> C
1535 > /| /| # replace: A -> C
1536 > A B C D # replace: B -> D
1536 > A B C D # replace: B -> D
1537 > | |
1537 > | |
1538 > X Y
1538 > X Y
1539 > EOS
1539 > EOS
1540 1 new orphan changesets
1540 1 new orphan changesets
1541 $ hg rebase -r A+B+E -d F
1541 $ hg rebase -r A+B+E -d F
1542 note: not rebasing 4:a3d17304151f "A" (A), already in destination as 0:96cc3511f894 "C" (C)
1542 note: not rebasing 4:a3d17304151f "A" (A), already in destination as 0:96cc3511f894 "C" (C)
1543 note: not rebasing 5:b23a2cc00842 "B" (B), already in destination as 1:058c1e1fb10a "D" (D)
1543 note: not rebasing 5:b23a2cc00842 "B" (B), already in destination as 1:058c1e1fb10a "D" (D)
1544 rebasing 7:dac5d11c5a7d "E" (E tip)
1544 rebasing 7:dac5d11c5a7d "E" (E tip)
1545 abort: rebasing 7:dac5d11c5a7d will include unwanted changes from 3:59c792af609c, 5:b23a2cc00842 or 2:ba2b7fa7166d, 4:a3d17304151f
1545 abort: rebasing 7:dac5d11c5a7d will include unwanted changes from 3:59c792af609c, 5:b23a2cc00842 or 2:ba2b7fa7166d, 4:a3d17304151f
1546 [255]
1546 [255]
1547 $ cd ..
1547 $ cd ..
1548
1548
1549 Rebase a non-clean merge. One parent has successor in destination, the other
1549 Rebase a non-clean merge. One parent has successor in destination, the other
1550 parent moves as requested.
1550 parent moves as requested.
1551
1551
1552 $ hg init p1-succ-p2-move
1552 $ hg init p1-succ-p2-move
1553 $ cd p1-succ-p2-move
1553 $ cd p1-succ-p2-move
1554 $ hg debugdrawdag <<'EOS'
1554 $ hg debugdrawdag <<'EOS'
1555 > D Z
1555 > D Z
1556 > /| | # replace: A -> C
1556 > /| | # replace: A -> C
1557 > A B C # D/D = D
1557 > A B C # D/D = D
1558 > EOS
1558 > EOS
1559 1 new orphan changesets
1559 1 new orphan changesets
1560 $ hg rebase -r A+B+D -d Z
1560 $ hg rebase -r A+B+D -d Z
1561 note: not rebasing 0:426bada5c675 "A" (A), already in destination as 2:96cc3511f894 "C" (C)
1561 note: not rebasing 0:426bada5c675 "A" (A), already in destination as 2:96cc3511f894 "C" (C)
1562 rebasing 1:fc2b737bb2e5 "B" (B)
1562 rebasing 1:fc2b737bb2e5 "B" (B)
1563 rebasing 3:b8ed089c80ad "D" (D)
1563 rebasing 3:b8ed089c80ad "D" (D)
1564
1564
1565 $ rm .hg/localtags
1565 $ rm .hg/localtags
1566 $ hg log -G
1566 $ hg log -G
1567 o 6:e4f78693cc88 D
1567 o 6:e4f78693cc88 D
1568 |
1568 |
1569 o 5:76840d832e98 B
1569 o 5:76840d832e98 B
1570 |
1570 |
1571 o 4:50e41c1f3950 Z
1571 o 4:50e41c1f3950 Z
1572 |
1572 |
1573 o 2:96cc3511f894 C
1573 o 2:96cc3511f894 C
1574
1574
1575 $ hg files -r tip
1575 $ hg files -r tip
1576 B
1576 B
1577 C
1577 C
1578 D
1578 D
1579 Z
1579 Z
1580
1580
1581 $ cd ..
1581 $ cd ..
1582
1582
1583 $ hg init p1-move-p2-succ
1583 $ hg init p1-move-p2-succ
1584 $ cd p1-move-p2-succ
1584 $ cd p1-move-p2-succ
1585 $ hg debugdrawdag <<'EOS'
1585 $ hg debugdrawdag <<'EOS'
1586 > D Z
1586 > D Z
1587 > /| | # replace: B -> C
1587 > /| | # replace: B -> C
1588 > A B C # D/D = D
1588 > A B C # D/D = D
1589 > EOS
1589 > EOS
1590 1 new orphan changesets
1590 1 new orphan changesets
1591 $ hg rebase -r B+A+D -d Z
1591 $ hg rebase -r B+A+D -d Z
1592 rebasing 0:426bada5c675 "A" (A)
1592 rebasing 0:426bada5c675 "A" (A)
1593 note: not rebasing 1:fc2b737bb2e5 "B" (B), already in destination as 2:96cc3511f894 "C" (C)
1593 note: not rebasing 1:fc2b737bb2e5 "B" (B), already in destination as 2:96cc3511f894 "C" (C)
1594 rebasing 3:b8ed089c80ad "D" (D)
1594 rebasing 3:b8ed089c80ad "D" (D)
1595
1595
1596 $ rm .hg/localtags
1596 $ rm .hg/localtags
1597 $ hg log -G
1597 $ hg log -G
1598 o 6:1b355ed94d82 D
1598 o 6:1b355ed94d82 D
1599 |
1599 |
1600 o 5:a81a74d764a6 A
1600 o 5:a81a74d764a6 A
1601 |
1601 |
1602 o 4:50e41c1f3950 Z
1602 o 4:50e41c1f3950 Z
1603 |
1603 |
1604 o 2:96cc3511f894 C
1604 o 2:96cc3511f894 C
1605
1605
1606 $ hg files -r tip
1606 $ hg files -r tip
1607 A
1607 A
1608 C
1608 C
1609 D
1609 D
1610 Z
1610 Z
1611
1611
1612 $ cd ..
1612 $ cd ..
1613
1613
1614 Test that bookmark is moved and working dir is updated when all changesets have
1614 Test that bookmark is moved and working dir is updated when all changesets have
1615 equivalents in destination
1615 equivalents in destination
1616 $ hg init rbsrepo && cd rbsrepo
1616 $ hg init rbsrepo && cd rbsrepo
1617 $ echo "[experimental]" > .hg/hgrc
1617 $ echo "[experimental]" > .hg/hgrc
1618 $ echo "evolution=true" >> .hg/hgrc
1618 $ echo "evolution=true" >> .hg/hgrc
1619 $ echo "rebaseskipobsolete=on" >> .hg/hgrc
1619 $ echo "rebaseskipobsolete=on" >> .hg/hgrc
1620 $ echo root > root && hg ci -Am root
1620 $ echo root > root && hg ci -Am root
1621 adding root
1621 adding root
1622 $ echo a > a && hg ci -Am a
1622 $ echo a > a && hg ci -Am a
1623 adding a
1623 adding a
1624 $ hg up 0
1624 $ hg up 0
1625 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1625 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1626 $ echo b > b && hg ci -Am b
1626 $ echo b > b && hg ci -Am b
1627 adding b
1627 adding b
1628 created new head
1628 created new head
1629 $ hg rebase -r 2 -d 1
1629 $ hg rebase -r 2 -d 1
1630 rebasing 2:1e9a3c00cbe9 "b" (tip)
1630 rebasing 2:1e9a3c00cbe9 "b" (tip)
1631 $ hg log -r . # working dir is at rev 3 (successor of 2)
1631 $ hg log -r . # working dir is at rev 3 (successor of 2)
1632 3:be1832deae9a b (no-eol)
1632 3:be1832deae9a b (no-eol)
1633 $ hg book -r 2 mybook --hidden # rev 2 has a bookmark on it now
1633 $ hg book -r 2 mybook --hidden # rev 2 has a bookmark on it now
1634 bookmarking hidden changeset 1e9a3c00cbe9
1634 bookmarking hidden changeset 1e9a3c00cbe9
1635 (hidden revision '1e9a3c00cbe9' was rewritten as: be1832deae9a)
1635 (hidden revision '1e9a3c00cbe9' was rewritten as: be1832deae9a)
1636 $ hg up 2 && hg log -r . # working dir is at rev 2 again
1636 $ hg up 2 && hg log -r . # working dir is at rev 2 again
1637 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1637 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1638 2:1e9a3c00cbe9 b (rewritten using rebase as 3:be1832deae9a) (no-eol)
1638 2:1e9a3c00cbe9 b (rewritten using rebase as 3:be1832deae9a) (no-eol)
1639 $ hg rebase -r 2 -d 3 --config experimental.evolution.track-operation=1
1639 $ hg rebase -r 2 -d 3 --config experimental.evolution.track-operation=1
1640 note: not rebasing 2:1e9a3c00cbe9 "b" (mybook), already in destination as 3:be1832deae9a "b" (tip)
1640 note: not rebasing 2:1e9a3c00cbe9 "b" (mybook), already in destination as 3:be1832deae9a "b" (tip)
1641 Check that working directory and bookmark was updated to rev 3 although rev 2
1641 Check that working directory and bookmark was updated to rev 3 although rev 2
1642 was skipped
1642 was skipped
1643 $ hg log -r .
1643 $ hg log -r .
1644 3:be1832deae9a b (no-eol)
1644 3:be1832deae9a b (no-eol)
1645 $ hg bookmarks
1645 $ hg bookmarks
1646 mybook 3:be1832deae9a
1646 mybook 3:be1832deae9a
1647 $ hg debugobsolete --rev tip
1647 $ hg debugobsolete --rev tip
1648 1e9a3c00cbe90d236ac05ef61efcc5e40b7412bc be1832deae9ac531caa7438b8dcf6055a122cd8e 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
1648 1e9a3c00cbe90d236ac05ef61efcc5e40b7412bc be1832deae9ac531caa7438b8dcf6055a122cd8e 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
1649
1649
1650 Obsoleted working parent and bookmark could be moved if an ancestor of working
1650 Obsoleted working parent and bookmark could be moved if an ancestor of working
1651 parent gets moved:
1651 parent gets moved:
1652
1652
1653 $ hg init $TESTTMP/ancestor-wd-move
1653 $ hg init $TESTTMP/ancestor-wd-move
1654 $ cd $TESTTMP/ancestor-wd-move
1654 $ cd $TESTTMP/ancestor-wd-move
1655 $ hg debugdrawdag <<'EOS'
1655 $ hg debugdrawdag <<'EOS'
1656 > E D1 # rebase: D1 -> D2
1656 > E D1 # rebase: D1 -> D2
1657 > | |
1657 > | |
1658 > | C
1658 > | C
1659 > D2 |
1659 > D2 |
1660 > | B
1660 > | B
1661 > |/
1661 > |/
1662 > A
1662 > A
1663 > EOS
1663 > EOS
1664 $ hg update D1 -q
1664 $ hg update D1 -q
1665 $ hg bookmark book -i
1665 $ hg bookmark book -i
1666 $ hg rebase -r B+D1 -d E
1666 $ hg rebase -r B+D1 -d E
1667 rebasing 1:112478962961 "B" (B)
1667 rebasing 1:112478962961 "B" (B)
1668 note: not rebasing 5:15ecf15e0114 "D1" (book D1 tip), already in destination as 2:0807738e0be9 "D2" (D2)
1668 note: not rebasing 5:15ecf15e0114 "D1" (book D1 tip), already in destination as 2:0807738e0be9 "D2" (D2)
1669 1 new orphan changesets
1669 1 new orphan changesets
1670 $ hg log -G -T '{desc} {bookmarks}'
1670 $ hg log -G -T '{desc} {bookmarks}'
1671 @ B book
1671 @ B book
1672 |
1672 |
1673 | x D1
1673 | x D1
1674 | |
1674 | |
1675 o | E
1675 o | E
1676 | |
1676 | |
1677 | * C
1677 | * C
1678 | |
1678 | |
1679 o | D2
1679 o | D2
1680 | |
1680 | |
1681 | x B
1681 | x B
1682 |/
1682 |/
1683 o A
1683 o A
1684
1684
1685 Rebasing a merge with one of its parent having a hidden successor
1685 Rebasing a merge with one of its parent having a hidden successor
1686
1686
1687 $ hg init $TESTTMP/merge-p1-hidden-successor
1687 $ hg init $TESTTMP/merge-p1-hidden-successor
1688 $ cd $TESTTMP/merge-p1-hidden-successor
1688 $ cd $TESTTMP/merge-p1-hidden-successor
1689
1689
1690 $ hg debugdrawdag <<'EOS'
1690 $ hg debugdrawdag <<'EOS'
1691 > E
1691 > E
1692 > |
1692 > |
1693 > B3 B2 # amend: B1 -> B2 -> B3
1693 > B3 B2 # amend: B1 -> B2 -> B3
1694 > |/ # B2 is hidden
1694 > |/ # B2 is hidden
1695 > | D
1695 > | D
1696 > | |\
1696 > | |\
1697 > | B1 C
1697 > | B1 C
1698 > |/
1698 > |/
1699 > A
1699 > A
1700 > EOS
1700 > EOS
1701 1 new orphan changesets
1701 1 new orphan changesets
1702
1702
1703 $ eval `hg tags -T '{tag}={node}\n'`
1703 $ eval `hg tags -T '{tag}={node}\n'`
1704 $ rm .hg/localtags
1704 $ rm .hg/localtags
1705
1705
1706 $ hg rebase -r $D -d $E
1706 $ hg rebase -r $D -d $E
1707 rebasing 5:9e62094e4d94 "D"
1707 rebasing 5:9e62094e4d94 "D"
1708
1708
1709 $ hg log -G
1709 $ hg log -G
1710 o 7:a699d059adcf D
1710 o 7:a699d059adcf D
1711 |\
1711 |\
1712 | o 6:ecc93090a95c E
1712 | o 6:ecc93090a95c E
1713 | |
1713 | |
1714 | o 4:0dc878468a23 B3
1714 | o 4:0dc878468a23 B3
1715 | |
1715 | |
1716 o | 1:96cc3511f894 C
1716 o | 1:96cc3511f894 C
1717 /
1717 /
1718 o 0:426bada5c675 A
1718 o 0:426bada5c675 A
1719
1719
1720 For some reasons (--hidden, rebaseskipobsolete=0, directaccess, etc.),
1720 For some reasons (--hidden, rebaseskipobsolete=0, directaccess, etc.),
1721 rebasestate may contain hidden hashes. "rebase --abort" should work regardless.
1721 rebasestate may contain hidden hashes. "rebase --abort" should work regardless.
1722
1722
1723 $ hg init $TESTTMP/hidden-state1
1723 $ hg init $TESTTMP/hidden-state1
1724 $ cd $TESTTMP/hidden-state1
1724 $ cd $TESTTMP/hidden-state1
1725 $ cat >> .hg/hgrc <<EOF
1725 $ cat >> .hg/hgrc <<EOF
1726 > [experimental]
1726 > [experimental]
1727 > rebaseskipobsolete=0
1727 > rebaseskipobsolete=0
1728 > EOF
1728 > EOF
1729
1729
1730 $ hg debugdrawdag <<'EOS'
1730 $ hg debugdrawdag <<'EOS'
1731 > C
1731 > C
1732 > |
1732 > |
1733 > D B # prune: B, C
1733 > D B # prune: B, C
1734 > |/ # B/D=B
1734 > |/ # B/D=B
1735 > A
1735 > A
1736 > EOS
1736 > EOS
1737
1737
1738 $ eval `hg tags -T '{tag}={node}\n'`
1738 $ eval `hg tags -T '{tag}={node}\n'`
1739 $ rm .hg/localtags
1739 $ rm .hg/localtags
1740
1740
1741 $ hg update -q $C --hidden
1741 $ hg update -q $C --hidden
1742 updated to hidden changeset 7829726be4dc
1742 updated to hidden changeset 7829726be4dc
1743 (hidden revision '7829726be4dc' is pruned)
1743 (hidden revision '7829726be4dc' is pruned)
1744 $ hg rebase -s $B -d $D
1744 $ hg rebase -s $B -d $D
1745 rebasing 1:2ec65233581b "B"
1745 rebasing 1:2ec65233581b "B"
1746 merging D
1746 merging D
1747 warning: conflicts while merging D! (edit, then use 'hg resolve --mark')
1747 warning: conflicts while merging D! (edit, then use 'hg resolve --mark')
1748 unresolved conflicts (see hg resolve, then hg rebase --continue)
1748 unresolved conflicts (see hg resolve, then hg rebase --continue)
1749 [1]
1749 [1]
1750
1750
1751 $ cp -R . $TESTTMP/hidden-state2
1751 $ cp -R . $TESTTMP/hidden-state2
1752
1752
1753 $ hg log -G
1753 $ hg log -G
1754 @ 2:b18e25de2cf5 D
1754 @ 2:b18e25de2cf5 D
1755 |
1755 |
1756 | @ 1:2ec65233581b B (pruned using prune)
1756 | @ 1:2ec65233581b B (pruned using prune)
1757 |/
1757 |/
1758 o 0:426bada5c675 A
1758 o 0:426bada5c675 A
1759
1759
1760 $ hg summary
1760 $ hg summary
1761 parent: 2:b18e25de2cf5 tip
1761 parent: 2:b18e25de2cf5 tip
1762 D
1762 D
1763 parent: 1:2ec65233581b (obsolete)
1763 parent: 1:2ec65233581b (obsolete)
1764 B
1764 B
1765 branch: default
1765 branch: default
1766 commit: 2 modified, 1 unknown, 1 unresolved (merge)
1766 commit: 2 modified, 1 unknown, 1 unresolved (merge)
1767 update: (current)
1767 update: (current)
1768 phases: 3 draft
1768 phases: 3 draft
1769 rebase: 0 rebased, 2 remaining (rebase --continue)
1769 rebase: 0 rebased, 2 remaining (rebase --continue)
1770
1770
1771 $ hg rebase --abort
1771 $ hg rebase --abort
1772 rebase aborted
1772 rebase aborted
1773
1773
1774 Also test --continue for the above case
1774 Also test --continue for the above case
1775
1775
1776 $ cd $TESTTMP/hidden-state2
1776 $ cd $TESTTMP/hidden-state2
1777 $ hg resolve -m
1777 $ hg resolve -m
1778 (no more unresolved files)
1778 (no more unresolved files)
1779 continue: hg rebase --continue
1779 continue: hg rebase --continue
1780 $ hg rebase --continue
1780 $ hg rebase --continue
1781 rebasing 1:2ec65233581b "B"
1781 rebasing 1:2ec65233581b "B"
1782 rebasing 3:7829726be4dc "C" (tip)
1782 rebasing 3:7829726be4dc "C" (tip)
1783 $ hg log -G
1783 $ hg log -G
1784 @ 5:1964d5d5b547 C
1784 @ 5:1964d5d5b547 C
1785 |
1785 |
1786 o 4:68deb90c12a2 B
1786 o 4:68deb90c12a2 B
1787 |
1787 |
1788 o 2:b18e25de2cf5 D
1788 o 2:b18e25de2cf5 D
1789 |
1789 |
1790 o 0:426bada5c675 A
1790 o 0:426bada5c675 A
1791
1791
1792 ====================
1792 ====================
1793 Test --stop option |
1793 Test --stop option |
1794 ====================
1794 ====================
1795 $ cd ..
1795 $ cd ..
1796 $ hg init rbstop
1796 $ hg init rbstop
1797 $ cd rbstop
1797 $ cd rbstop
1798 $ echo a>a
1798 $ echo a>a
1799 $ hg ci -Aqma
1799 $ hg ci -Aqma
1800 $ echo b>b
1800 $ echo b>b
1801 $ hg ci -Aqmb
1801 $ hg ci -Aqmb
1802 $ echo c>c
1802 $ echo c>c
1803 $ hg ci -Aqmc
1803 $ hg ci -Aqmc
1804 $ echo d>d
1804 $ echo d>d
1805 $ hg ci -Aqmd
1805 $ hg ci -Aqmd
1806 $ hg up 0 -q
1806 $ hg up 0 -q
1807 $ echo f>f
1807 $ echo f>f
1808 $ hg ci -Aqmf
1808 $ hg ci -Aqmf
1809 $ echo D>d
1809 $ echo D>d
1810 $ hg ci -Aqm "conflict with d"
1810 $ hg ci -Aqm "conflict with d"
1811 $ hg up 3 -q
1811 $ hg up 3 -q
1812 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
1812 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
1813 o 5:00bfc9898aeb test
1813 o 5:00bfc9898aeb test
1814 | conflict with d
1814 | conflict with d
1815 |
1815 |
1816 o 4:dafd40200f93 test
1816 o 4:dafd40200f93 test
1817 | f
1817 | f
1818 |
1818 |
1819 | @ 3:055a42cdd887 test
1819 | @ 3:055a42cdd887 test
1820 | | d
1820 | | d
1821 | |
1821 | |
1822 | o 2:177f92b77385 test
1822 | o 2:177f92b77385 test
1823 | | c
1823 | | c
1824 | |
1824 | |
1825 | o 1:d2ae7f538514 test
1825 | o 1:d2ae7f538514 test
1826 |/ b
1826 |/ b
1827 |
1827 |
1828 o 0:cb9a9f314b8b test
1828 o 0:cb9a9f314b8b test
1829 a
1829 a
1830
1830
1831 $ hg rebase -s 1 -d 5
1831 $ hg rebase -s 1 -d 5
1832 rebasing 1:d2ae7f538514 "b"
1832 rebasing 1:d2ae7f538514 "b"
1833 rebasing 2:177f92b77385 "c"
1833 rebasing 2:177f92b77385 "c"
1834 rebasing 3:055a42cdd887 "d"
1834 rebasing 3:055a42cdd887 "d"
1835 merging d
1835 merging d
1836 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
1836 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
1837 unresolved conflicts (see hg resolve, then hg rebase --continue)
1837 unresolved conflicts (see hg resolve, then hg rebase --continue)
1838 [1]
1838 [1]
1839 $ hg rebase --stop
1839 $ hg rebase --stop
1840 1 new orphan changesets
1840 1 new orphan changesets
1841 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
1841 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
1842 o 7:7fffad344617 test
1842 o 7:7fffad344617 test
1843 | c
1843 | c
1844 |
1844 |
1845 o 6:b15528633407 test
1845 o 6:b15528633407 test
1846 | b
1846 | b
1847 |
1847 |
1848 o 5:00bfc9898aeb test
1848 o 5:00bfc9898aeb test
1849 | conflict with d
1849 | conflict with d
1850 |
1850 |
1851 o 4:dafd40200f93 test
1851 o 4:dafd40200f93 test
1852 | f
1852 | f
1853 |
1853 |
1854 | @ 3:055a42cdd887 test
1854 | @ 3:055a42cdd887 test
1855 | | d
1855 | | d
1856 | |
1856 | |
1857 | x 2:177f92b77385 test
1857 | x 2:177f92b77385 test
1858 | | c
1858 | | c
1859 | |
1859 | |
1860 | x 1:d2ae7f538514 test
1860 | x 1:d2ae7f538514 test
1861 |/ b
1861 |/ b
1862 |
1862 |
1863 o 0:cb9a9f314b8b test
1863 o 0:cb9a9f314b8b test
1864 a
1864 a
1865
1865
1866 Test it aborts if unstable csets is not allowed:
1866 Test it aborts if unstable csets is not allowed:
1867 ===============================================
1867 ===============================================
1868 $ cat >> $HGRCPATH << EOF
1868 $ cat >> $HGRCPATH << EOF
1869 > [experimental]
1869 > [experimental]
1870 > evolution.allowunstable=False
1870 > evolution.allowunstable=False
1871 > EOF
1871 > EOF
1872
1872
1873 $ hg strip 6 --no-backup -q
1873 $ hg strip 6 --no-backup -q
1874 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
1874 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
1875 o 5:00bfc9898aeb test
1875 o 5:00bfc9898aeb test
1876 | conflict with d
1876 | conflict with d
1877 |
1877 |
1878 o 4:dafd40200f93 test
1878 o 4:dafd40200f93 test
1879 | f
1879 | f
1880 |
1880 |
1881 | @ 3:055a42cdd887 test
1881 | @ 3:055a42cdd887 test
1882 | | d
1882 | | d
1883 | |
1883 | |
1884 | o 2:177f92b77385 test
1884 | o 2:177f92b77385 test
1885 | | c
1885 | | c
1886 | |
1886 | |
1887 | o 1:d2ae7f538514 test
1887 | o 1:d2ae7f538514 test
1888 |/ b
1888 |/ b
1889 |
1889 |
1890 o 0:cb9a9f314b8b test
1890 o 0:cb9a9f314b8b test
1891 a
1891 a
1892
1892
1893 $ hg rebase -s 1 -d 5
1893 $ hg rebase -s 1 -d 5
1894 rebasing 1:d2ae7f538514 "b"
1894 rebasing 1:d2ae7f538514 "b"
1895 rebasing 2:177f92b77385 "c"
1895 rebasing 2:177f92b77385 "c"
1896 rebasing 3:055a42cdd887 "d"
1896 rebasing 3:055a42cdd887 "d"
1897 merging d
1897 merging d
1898 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
1898 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
1899 unresolved conflicts (see hg resolve, then hg rebase --continue)
1899 unresolved conflicts (see hg resolve, then hg rebase --continue)
1900 [1]
1900 [1]
1901 $ hg rebase --stop
1901 $ hg rebase --stop
1902 abort: cannot remove original changesets with unrebased descendants
1902 abort: cannot remove original changesets with unrebased descendants
1903 (either enable obsmarkers to allow unstable revisions or use --keep to keep original changesets)
1903 (either enable obsmarkers to allow unstable revisions or use --keep to keep original changesets)
1904 [255]
1904 [255]
1905 $ hg rebase --abort
1905 $ hg rebase --abort
1906 saved backup bundle to $TESTTMP/rbstop/.hg/strip-backup/b15528633407-6eb72b6f-backup.hg
1906 saved backup bundle to $TESTTMP/rbstop/.hg/strip-backup/b15528633407-6eb72b6f-backup.hg
1907 rebase aborted
1907 rebase aborted
1908
1908
1909 Test --stop when --keep is passed:
1909 Test --stop when --keep is passed:
1910 ==================================
1910 ==================================
1911 $ hg rebase -s 1 -d 5 --keep
1911 $ hg rebase -s 1 -d 5 --keep
1912 rebasing 1:d2ae7f538514 "b"
1912 rebasing 1:d2ae7f538514 "b"
1913 rebasing 2:177f92b77385 "c"
1913 rebasing 2:177f92b77385 "c"
1914 rebasing 3:055a42cdd887 "d"
1914 rebasing 3:055a42cdd887 "d"
1915 merging d
1915 merging d
1916 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
1916 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
1917 unresolved conflicts (see hg resolve, then hg rebase --continue)
1917 unresolved conflicts (see hg resolve, then hg rebase --continue)
1918 [1]
1918 [1]
1919 $ hg rebase --stop
1919 $ hg rebase --stop
1920 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
1920 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
1921 o 7:7fffad344617 test
1921 o 7:7fffad344617 test
1922 | c
1922 | c
1923 |
1923 |
1924 o 6:b15528633407 test
1924 o 6:b15528633407 test
1925 | b
1925 | b
1926 |
1926 |
1927 o 5:00bfc9898aeb test
1927 o 5:00bfc9898aeb test
1928 | conflict with d
1928 | conflict with d
1929 |
1929 |
1930 o 4:dafd40200f93 test
1930 o 4:dafd40200f93 test
1931 | f
1931 | f
1932 |
1932 |
1933 | @ 3:055a42cdd887 test
1933 | @ 3:055a42cdd887 test
1934 | | d
1934 | | d
1935 | |
1935 | |
1936 | o 2:177f92b77385 test
1936 | o 2:177f92b77385 test
1937 | | c
1937 | | c
1938 | |
1938 | |
1939 | o 1:d2ae7f538514 test
1939 | o 1:d2ae7f538514 test
1940 |/ b
1940 |/ b
1941 |
1941 |
1942 o 0:cb9a9f314b8b test
1942 o 0:cb9a9f314b8b test
1943 a
1943 a
1944
1944
1945 Test --stop aborts when --collapse was passed:
1945 Test --stop aborts when --collapse was passed:
1946 =============================================
1946 =============================================
1947 $ cat >> $HGRCPATH << EOF
1947 $ cat >> $HGRCPATH << EOF
1948 > [experimental]
1948 > [experimental]
1949 > evolution.allowunstable=True
1949 > evolution.allowunstable=True
1950 > EOF
1950 > EOF
1951
1951
1952 $ hg strip 6
1952 $ hg strip 6
1953 saved backup bundle to $TESTTMP/rbstop/.hg/strip-backup/b15528633407-6eb72b6f-backup.hg
1953 saved backup bundle to $TESTTMP/rbstop/.hg/strip-backup/b15528633407-6eb72b6f-backup.hg
1954 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
1954 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
1955 o 5:00bfc9898aeb test
1955 o 5:00bfc9898aeb test
1956 | conflict with d
1956 | conflict with d
1957 |
1957 |
1958 o 4:dafd40200f93 test
1958 o 4:dafd40200f93 test
1959 | f
1959 | f
1960 |
1960 |
1961 | @ 3:055a42cdd887 test
1961 | @ 3:055a42cdd887 test
1962 | | d
1962 | | d
1963 | |
1963 | |
1964 | o 2:177f92b77385 test
1964 | o 2:177f92b77385 test
1965 | | c
1965 | | c
1966 | |
1966 | |
1967 | o 1:d2ae7f538514 test
1967 | o 1:d2ae7f538514 test
1968 |/ b
1968 |/ b
1969 |
1969 |
1970 o 0:cb9a9f314b8b test
1970 o 0:cb9a9f314b8b test
1971 a
1971 a
1972
1972
1973 $ hg rebase -s 1 -d 5 --collapse -m "collapsed b c d"
1973 $ hg rebase -s 1 -d 5 --collapse -m "collapsed b c d"
1974 rebasing 1:d2ae7f538514 "b"
1974 rebasing 1:d2ae7f538514 "b"
1975 rebasing 2:177f92b77385 "c"
1975 rebasing 2:177f92b77385 "c"
1976 rebasing 3:055a42cdd887 "d"
1976 rebasing 3:055a42cdd887 "d"
1977 merging d
1977 merging d
1978 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
1978 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
1979 unresolved conflicts (see hg resolve, then hg rebase --continue)
1979 unresolved conflicts (see hg resolve, then hg rebase --continue)
1980 [1]
1980 [1]
1981 $ hg rebase --stop
1981 $ hg rebase --stop
1982 abort: cannot stop in --collapse session
1982 abort: cannot stop in --collapse session
1983 [255]
1983 [255]
1984 $ hg rebase --abort
1984 $ hg rebase --abort
1985 rebase aborted
1985 rebase aborted
1986 $ hg diff
1986 $ hg diff
1987 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
1987 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
1988 o 5:00bfc9898aeb test
1988 o 5:00bfc9898aeb test
1989 | conflict with d
1989 | conflict with d
1990 |
1990 |
1991 o 4:dafd40200f93 test
1991 o 4:dafd40200f93 test
1992 | f
1992 | f
1993 |
1993 |
1994 | @ 3:055a42cdd887 test
1994 | @ 3:055a42cdd887 test
1995 | | d
1995 | | d
1996 | |
1996 | |
1997 | o 2:177f92b77385 test
1997 | o 2:177f92b77385 test
1998 | | c
1998 | | c
1999 | |
1999 | |
2000 | o 1:d2ae7f538514 test
2000 | o 1:d2ae7f538514 test
2001 |/ b
2001 |/ b
2002 |
2002 |
2003 o 0:cb9a9f314b8b test
2003 o 0:cb9a9f314b8b test
2004 a
2004 a
2005
2005
2006 Test --stop raise errors with conflicting options:
2006 Test --stop raise errors with conflicting options:
2007 =================================================
2007 =================================================
2008 $ hg rebase -s 3 -d 5
2008 $ hg rebase -s 3 -d 5
2009 rebasing 3:055a42cdd887 "d"
2009 rebasing 3:055a42cdd887 "d"
2010 merging d
2010 merging d
2011 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
2011 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
2012 unresolved conflicts (see hg resolve, then hg rebase --continue)
2012 unresolved conflicts (see hg resolve, then hg rebase --continue)
2013 [1]
2013 [1]
2014 $ hg rebase --stop --dry-run
2014 $ hg rebase --stop --dry-run
2015 abort: cannot use --stop with --dry-run or --confirm
2015 abort: cannot use --stop with --dry-run or --confirm
2016 [255]
2016 [255]
2017
2017
2018 $ hg rebase -s 3 -d 5
2018 $ hg rebase -s 3 -d 5
2019 abort: rebase in progress
2019 abort: rebase in progress
2020 (use 'hg rebase --continue' or 'hg rebase --abort')
2020 (use 'hg rebase --continue' or 'hg rebase --abort')
2021 [255]
2021 [255]
2022 $ hg rebase --stop --continue
2022 $ hg rebase --stop --continue
2023 abort: cannot use --stop with --abort or --continue
2023 abort: cannot use --stop with --abort or --continue
2024 [255]
2024 [255]
2025
2026 Test --stop moves bookmarks of original revisions to new rebased nodes:
2027 ======================================================================
2028 $ cd ..
2029 $ hg init repo
2030 $ cd repo
2031
2032 $ echo a > a
2033 $ hg ci -Am A
2034 adding a
2035
2036 $ echo b > b
2037 $ hg ci -Am B
2038 adding b
2039 $ hg book X
2040 $ hg book Y
2041
2042 $ echo c > c
2043 $ hg ci -Am C
2044 adding c
2045 $ hg book Z
2046
2047 $ echo d > d
2048 $ hg ci -Am D
2049 adding d
2050
2051 $ hg up 0 -q
2052 $ echo e > e
2053 $ hg ci -Am E
2054 adding e
2055 created new head
2056
2057 $ echo doubt > d
2058 $ hg ci -Am "conflict with d"
2059 adding d
2060
2061 $ hg log -GT "{rev}: {node|short} '{desc}' bookmarks: {bookmarks}\n"
2062 @ 5: 39adf30bc1be 'conflict with d' bookmarks:
2063 |
2064 o 4: 9c1e55f411b6 'E' bookmarks:
2065 |
2066 | o 3: 67a385d4e6f2 'D' bookmarks: Z
2067 | |
2068 | o 2: 49cb3485fa0c 'C' bookmarks: Y
2069 | |
2070 | o 1: 6c81ed0049f8 'B' bookmarks: X
2071 |/
2072 o 0: 1994f17a630e 'A' bookmarks:
2073
2074 $ hg rebase -s 1 -d 5
2075 rebasing 1:6c81ed0049f8 "B" (X)
2076 rebasing 2:49cb3485fa0c "C" (Y)
2077 rebasing 3:67a385d4e6f2 "D" (Z)
2078 merging d
2079 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
2080 unresolved conflicts (see hg resolve, then hg rebase --continue)
2081 [1]
2082 $ hg rebase --stop
2083 1 new orphan changesets
2084 $ hg log -GT "{rev}: {node|short} '{desc}' bookmarks: {bookmarks}\n"
2085 o 7: 9c86c650b686 'C' bookmarks: Y
2086 |
2087 o 6: 9b87b54e5fd8 'B' bookmarks: X
2088 |
2089 @ 5: 39adf30bc1be 'conflict with d' bookmarks:
2090 |
2091 o 4: 9c1e55f411b6 'E' bookmarks:
2092 |
2093 | * 3: 67a385d4e6f2 'D' bookmarks: Z
2094 | |
2095 | x 2: 49cb3485fa0c 'C' bookmarks:
2096 | |
2097 | x 1: 6c81ed0049f8 'B' bookmarks:
2098 |/
2099 o 0: 1994f17a630e 'A' bookmarks:
2100
General Comments 0
You need to be logged in to leave comments. Login now