comparison tests/test-evolve-orphan-split.t @ 3541:bc47c09c9782

evolve: prompt user to select destination for stabilization in case of split This patch adds functionality to prompt user to select a revision when there exists multiple stabilization destination because of split on multiple branches. Test are also added for the feature. I am not sure whether this is the best message which we can show, if people have suggestions I will like to improve the messages shown in prompt.
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 14 Mar 2018 18:24:22 +0530
parents 8b5093f333dc
children 7bd516e0a929
comparison
equal deleted inserted replaced
3540:0624732c92f7 3541:bc47c09c9782
179 | x 6:f89e4764f2ed added a b c 179 | x 6:f89e4764f2ed added a b c
180 |/ () draft 180 |/ () draft
181 o 0:8fa14d15e168 added hgignore 181 o 0:8fa14d15e168 added hgignore
182 () draft 182 () draft
183 183
184 $ hg evolve --dry-run 184 $ hg evolve --dry-run <<EOF
185 cannot solve split across two branches 185 > 0
186 186 > EOF
187 XXX: this sounds like a good thing, maybe we should suggest using commands like 187 ancestor 'd48a30875f01' split over multiple topological branches.
188 grab or rebase to resolve this. Moreover showing the branch heads or list of 188 choose an evolve destination:
189 successors on different branches will be good. 189 0: [f2632392aefe] added a b c
190 190 1: [7f87764e5b64] added a b c
191 $ hg evolve --all 191 q: quit the prompt
192 cannot solve split across two branches 192 enter the index of the revision you want to select: 0
193 move:[7] added d
194 atop:[8] added a b c
195 hg rebase -r d48a30875f01 -d f2632392aefe
196
197 $ hg evolve --dry-run <<EOF
198 > 1
199 > EOF
200 ancestor 'd48a30875f01' split over multiple topological branches.
201 choose an evolve destination:
202 0: [f2632392aefe] added a b c
203 1: [7f87764e5b64] added a b c
204 q: quit the prompt
205 enter the index of the revision you want to select: 1
206 move:[7] added d
207 atop:[10] added a b c
208 hg rebase -r d48a30875f01 -d 7f87764e5b64
209
210 Testing the interactive prompt with invalid values first
211 (this should move its own test file when we use it at multiple places)
212
213 $ hg evolve --all <<EOF
214 > foo
215 > EOF
216 ancestor 'd48a30875f01' split over multiple topological branches.
217 choose an evolve destination:
218 0: [f2632392aefe] added a b c
219 1: [7f87764e5b64] added a b c
220 q: quit the prompt
221 enter the index of the revision you want to select: foo
222 invalid value 'foo' entered for index
223 cannot solve split across two branches
224
225 $ hg evolve --all <<EOF
226 > 4
227 > EOF
228 ancestor 'd48a30875f01' split over multiple topological branches.
229 choose an evolve destination:
230 0: [f2632392aefe] added a b c
231 1: [7f87764e5b64] added a b c
232 q: quit the prompt
233 enter the index of the revision you want to select: 4
234 invalid value '4' entered for index
235 cannot solve split across two branches
236
237 $ hg evolve --all <<EOF
238 > -1
239 > EOF
240 ancestor 'd48a30875f01' split over multiple topological branches.
241 choose an evolve destination:
242 0: [f2632392aefe] added a b c
243 1: [7f87764e5b64] added a b c
244 q: quit the prompt
245 enter the index of the revision you want to select: -1
246 invalid value '-1' entered for index
247 cannot solve split across two branches
248
249 $ hg evolve --all <<EOF
250 > q
251 > EOF
252 ancestor 'd48a30875f01' split over multiple topological branches.
253 choose an evolve destination:
254 0: [f2632392aefe] added a b c
255 1: [7f87764e5b64] added a b c
256 q: quit the prompt
257 enter the index of the revision you want to select: q
258 cannot solve split across two branches
259
260 Doing the evolve with the interactive prompt
261
262 $ hg evolve --all <<EOF
263 > 1
264 > EOF
265 ancestor 'd48a30875f01' split over multiple topological branches.
266 choose an evolve destination:
267 0: [f2632392aefe] added a b c
268 1: [7f87764e5b64] added a b c
269 q: quit the prompt
270 enter the index of the revision you want to select: 1
271 move:[7] added d
272 atop:[10] added a b c
273 working directory is now at 1c6caa7c902a