Mercurial > hg
comparison tests/test-resolve.t @ 38793:6c8e3c847977
resolve: add option to warn/abort on -m with unresolved conflict markers
When a user is dropped out of Mercurial to a terminal to resolve files, we emit
messages like:
conflicts while merging file1! (edit, then use 'hg resolve --mark')
conflicts while merging file2! (edit, then use 'hg resolve --mark')
We don't mention a file name in the hint, so some users might do something like
`$EDITOR file1; hg resolve --mark`, see that it says "(no more unresolved
files)" and forget to deal with file2 before running the next command.
Even if we did mention a file name in the hint, it's too easy to forget it
(maybe the merge spans a couple days or something). This option lets us inform
the user that they might have missed something.
In the scenario above, the output would be something like:
warning: the following files still have conflict markers:
file2
(no more unresolved files)
Differential Revision: https://phab.mercurial-scm.org/D4035
author | Kyle Lippincott <spectral@google.com> |
---|---|
date | Thu, 26 Jul 2018 17:11:03 -0700 |
parents | e8c33e27ee9b |
children | f8732e33bcbc |
comparison
equal
deleted
inserted
replaced
38792:afb442f58cbf | 38793:6c8e3c847977 |
---|---|
371 | 371 |
372 resolve -l should be empty | 372 resolve -l should be empty |
373 | 373 |
374 $ hg resolve -l | 374 $ hg resolve -l |
375 | 375 |
376 resolve -m can be configured to look for remaining conflict markers | |
377 $ hg up -qC 2 | |
378 $ hg merge -q --tool=internal:merge 1 | |
379 warning: conflicts while merging file1! (edit, then use 'hg resolve --mark') | |
380 warning: conflicts while merging file2! (edit, then use 'hg resolve --mark') | |
381 [1] | |
382 $ hg resolve -l | |
383 U file1 | |
384 U file2 | |
385 $ echo 'remove markers' > file1 | |
386 $ hg --config experimental.resolve.mark-check=abort resolve -m | |
387 warning: the following files still have conflict markers: | |
388 file2 | |
389 abort: conflict markers detected | |
390 (use --all to mark anyway) | |
391 [255] | |
392 $ hg resolve -l | |
393 U file1 | |
394 U file2 | |
395 Try with --all from the hint | |
396 $ hg --config experimental.resolve.mark-check=abort resolve -m --all | |
397 warning: the following files still have conflict markers: | |
398 file2 | |
399 (no more unresolved files) | |
400 $ hg resolve -l | |
401 R file1 | |
402 R file2 | |
403 $ hg resolve --unmark | |
404 $ hg resolve -l | |
405 U file1 | |
406 U file2 | |
407 $ hg --config experimental.resolve.mark-check=warn resolve -m | |
408 warning: the following files still have conflict markers: | |
409 file2 | |
410 (no more unresolved files) | |
411 $ hg resolve -l | |
412 R file1 | |
413 R file2 | |
414 If the file is already marked as resolved, we don't warn about it | |
415 $ hg resolve --unmark file1 | |
416 $ hg resolve -l | |
417 U file1 | |
418 R file2 | |
419 $ hg --config experimental.resolve.mark-check=warn resolve -m | |
420 (no more unresolved files) | |
421 $ hg resolve -l | |
422 R file1 | |
423 R file2 | |
424 | |
376 $ cd .. | 425 $ cd .. |