comparison tests/test-evolve-abort-phasediv.t @ 3843:f0096db2a7b1

evolve: improve error messages when conflicts occur This patch improves the error messages when conflicts occur. First, we drop the line 'evolution failed', that is not the best line we can show and evolution didn't failed, it's just interrupted by the conflicts and when user will run `hg evolve --continue`, things will be fine. I still remember when I first saw 'evolution failed', I got a bit scare as am I in a recoverable position or not. So let's drop this scary line. Second, we replace the error messages to say `resolve conflicts and see help-topic`. The help topic was added recently and documents all the three flags very well. Addition of tests also showed that all the three flags works fine with all the three instability type. So we should advertise them more. Third, we now raise the error with our error message rather than raising MergeFailure and having evolution related text in hint or stderr above. This increase the focus on the error message we want to show. After this patch, I think error messages by evolve in case of conflicts will be same in every case.
author Pulkit Goyal <7895pulkit@gmail.com>
date Tue, 12 Jun 2018 19:00:12 +0530
parents ac0717f23921
children 629558d09898
comparison
equal deleted inserted replaced
3842:b293cce4ff55 3843:f0096db2a7b1
85 recreate:[6] added d 85 recreate:[6] added d
86 atop:[4] added d 86 atop:[4] added d
87 rebasing to destination parent: ca1b80f7960a 87 rebasing to destination parent: ca1b80f7960a
88 merging c 88 merging c
89 warning: conflicts while merging c! (edit, then use 'hg resolve --mark') 89 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
90 evolution failed! 90 abort: fix conflicts and see `hg help evolve.interrupted`
91 fix conflict then run 'hg evolve --continue' or use `hg evolve --abort`
92 abort: unresolved merge conflicts (see hg help resolve)
93 [255] 91 [255]
94 92
95 testing that interrupted evolve shows up in morestatus 93 testing that interrupted evolve shows up in morestatus
96 $ hg status -v 94 $ hg status -v
97 M c 95 M c
199 recreate:[9] added c 197 recreate:[9] added c
200 atop:[3] added c 198 atop:[3] added c
201 rebasing to destination parent: b1661037fa25 199 rebasing to destination parent: b1661037fa25
202 merging b 200 merging b
203 warning: conflicts while merging b! (edit, then use 'hg resolve --mark') 201 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
204 evolution failed! 202 abort: fix conflicts and see `hg help evolve.interrupted`
205 fix conflict then run 'hg evolve --continue' or use `hg evolve --abort`
206 abort: unresolved merge conflicts (see hg help resolve)
207 [255] 203 [255]
208 204
209 $ hg evolve --abort 205 $ hg evolve --abort
210 1 new phase-divergent changesets 206 1 new phase-divergent changesets
211 evolve aborted 207 evolve aborted
270 recreate:[9] added c 266 recreate:[9] added c
271 atop:[3] added c 267 atop:[3] added c
272 rebasing to destination parent: b1661037fa25 268 rebasing to destination parent: b1661037fa25
273 merging b 269 merging b
274 warning: conflicts while merging b! (edit, then use 'hg resolve --mark') 270 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
275 evolution failed! 271 abort: fix conflicts and see `hg help evolve.interrupted`
276 fix conflict then run 'hg evolve --continue' or use `hg evolve --abort`
277 abort: unresolved merge conflicts (see hg help resolve)
278 [255] 272 [255]
279 273
280 $ echo watwat > c 274 $ echo watwat > c
281 $ hg resolve -m 275 $ hg resolve -m
282 (no more unresolved files) 276 (no more unresolved files)
288 recreate:[10] added d 282 recreate:[10] added d
289 atop:[4] added d 283 atop:[4] added d
290 rebasing to destination parent: ca1b80f7960a 284 rebasing to destination parent: ca1b80f7960a
291 merging c 285 merging c
292 warning: conflicts while merging c! (edit, then use 'hg resolve --mark') 286 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
293 evolution failed! 287 abort: fix conflicts and see `hg help evolve.interrupted`
294 fix conflict then run 'hg evolve --continue' or use `hg evolve --abort`
295 abort: unresolved merge conflicts (see hg help resolve)
296 [255] 288 [255]
297 289
298 $ hg evolve --abort 290 $ hg evolve --abort
299 1 new phase-divergent changesets 291 1 new phase-divergent changesets
300 evolve aborted 292 evolve aborted