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