Mercurial > hg
changeset 27164:88d5db4b155c
filemerge: default regular prompts to 'leave unresolved' (BC)
It makes far more sense to leave these conflicts unresolved and kick back to
the user than to just assume that the local version be chosen. There are almost
certainly buggy scripts and applications using Mercurial in the wild that do
merges or rebases non-interactively, and then assume that if the operation
succeeded there's nothing the user needs to pay attention to.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Tue, 01 Dec 2015 09:48:38 -0800 |
parents | 27b89a0957ec |
children | 70884715725e |
files | mercurial/filemerge.py tests/test-merge-changedelete.t tests/test-merge-tools.t tests/test-merge-types.t |
diffstat | 4 files changed, 19 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/filemerge.py Mon Nov 30 13:43:55 2015 -0800 +++ b/mercurial/filemerge.py Tue Dec 01 09:48:38 2015 -0800 @@ -253,7 +253,7 @@ index = ui.promptchoice( _("no tool found to merge %s\n" "keep (l)ocal, take (o)ther, or leave (u)nresolved?" - "$$ &Local $$ &Other $$ &Unresolved") % fd, 0) + "$$ &Local $$ &Other $$ &Unresolved") % fd, 2) choice = ['local', 'other', 'unresolved'][index] if choice == 'other':
--- a/tests/test-merge-changedelete.t Mon Nov 30 13:43:55 2015 -0800 +++ b/tests/test-merge-changedelete.t Tue Dec 01 09:48:38 2015 -0800 @@ -474,9 +474,10 @@ remote changed file2 which local deleted use (c)hanged version, leave (d)eleted, or leave (u)nresolved? c no tool found to merge file3 - keep (l)ocal, take (o)ther, or leave (u)nresolved? l - 0 files updated, 3 files merged, 0 files removed, 0 files unresolved - (branch merge, don't forget to commit) + keep (l)ocal, take (o)ther, or leave (u)nresolved? u + 0 files updated, 2 files merged, 0 files removed, 1 files unresolved + use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon + [1] $ status --- status --- M file2 @@ -485,7 +486,7 @@ --- resolve --list --- R file1 R file2 - R file3 + U file3 --- debugmergestate --- * version 2 records local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4 @@ -498,7 +499,7 @@ local path: file2 (flags "") ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) - file: file3 (record type "F", state "r", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) + file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) local path: file3 (flags "") ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4) other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
--- a/tests/test-merge-tools.t Mon Nov 30 13:43:55 2015 -0800 +++ b/tests/test-merge-tools.t Tue Dec 01 09:48:38 2015 -0800 @@ -532,9 +532,10 @@ # hg update -C 1 $ hg merge -r 2 --config ui.merge=internal:prompt no tool found to merge f - keep (l)ocal, take (o)ther, or leave (u)nresolved? l - 0 files updated, 1 files merged, 0 files removed, 0 files unresolved - (branch merge, don't forget to commit) + keep (l)ocal, take (o)ther, or leave (u)nresolved? u + 0 files updated, 0 files merged, 0 files removed, 1 files unresolved + use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon + [1] $ aftermerge # cat f revision 1 @@ -542,7 +543,7 @@ # hg stat M f # hg resolve --list - R f + U f ui.merge specifies :prompt, with 'leave unresolved' chosen @@ -619,8 +620,8 @@ U f $ hg resolve --all --config ui.merge=internal:prompt no tool found to merge f - keep (l)ocal, take (o)ther, or leave (u)nresolved? l - (no more unresolved files) + keep (l)ocal, take (o)ther, or leave (u)nresolved? u + [1] $ aftermerge # cat f revision 1 @@ -629,7 +630,7 @@ M f ? f.orig # hg resolve --list - R f + U f ui.merge specifies internal:dump:
--- a/tests/test-merge-types.t Mon Nov 30 13:43:55 2015 -0800 +++ b/tests/test-merge-types.t Tue Dec 01 09:48:38 2015 -0800 @@ -172,8 +172,10 @@ (couldn't find merge tool hgmerge|tool hgmerge can't handle symlinks) (re) picked tool ':prompt' for a (binary False symlink True changedelete False) no tool found to merge a - keep (l)ocal, take (o)ther, or leave (u)nresolved? l - 0 files updated, 1 files merged, 0 files removed, 0 files unresolved + keep (l)ocal, take (o)ther, or leave (u)nresolved? u + 0 files updated, 0 files merged, 0 files removed, 1 files unresolved + use 'hg resolve' to retry unresolved file merges + [1] $ hg diff --git diff --git a/a b/a old mode 120000