# HG changeset patch # User Chris Cannam # Date 1299866902 0 # Node ID ea62eb083ed41a86c531e33fc9b06b42b7986e97 # Parent f166f70c64f97ae783d99fdd531db5df78fb651b Merge fixes: primarily, handle failed merges better diff -r f166f70c64f9 -r ea62eb083ed4 easyhg-extdiff.sh --- a/easyhg-extdiff.sh Fri Mar 11 17:42:12 2011 +0000 +++ b/easyhg-extdiff.sh Fri Mar 11 18:08:22 2011 +0000 @@ -7,24 +7,17 @@ while [ $# -gt 2 ]; do shift done -found="" for d in kdiff3 kdiff3.exe; do if [ -x "$p/$d" ]; then - found=true - "$p/$d" "$1" "$2" - break + exec "$p/$d" "$1" "$2" elif [ -x "$(type -path $d)" ]; then - found=true - "$d" "$1" "$2" - break; + exec "$d" "$1" "$2" fi done -if [ -z "$found" ]; then - od=/usr/bin/opendiff - if [ -x "$od" ]; then - found=true - "$od" "$1" "$2" | cat - fi +od=/usr/bin/opendiff +if [ -x "$od" ]; then + "$od" "$1" "$2" | cat + exit 0 fi -[ -n "$found" ] +exit 1 diff -r f166f70c64f9 -r ea62eb083ed4 easyhg-merge.sh --- a/easyhg-merge.sh Fri Mar 11 17:42:12 2011 +0000 +++ b/easyhg-merge.sh Fri Mar 11 18:08:22 2011 +0000 @@ -12,23 +12,15 @@ left="$1" ancestor="$2" right="$3" -found="" for d in kdiff3 kdiff3.exe; do if [ -x "$p/$d" ]; then - found=true - "$p/$d" "$ancestor" "$left" "$right" -o "$out" - break + exec "$p/$d" "$ancestor" "$left" "$right" -o "$out" elif [ -x "$(type -path $d)" ]; then - found=true - "$d" "$ancestor" "$left" "$right" -o "$out" - break; + exec "$d" "$ancestor" "$left" "$right" -o "$out" fi done -if [ -z "$found" ]; then - fm=/Developer/Applications/Utilities/FileMerge.app/Contents/MacOS/FileMerge - if [ -x "$fm" ]; then - found=true - "$fm" -left "$left" -merge "$out" -ancestor "$ancestor" -right "$right" - fi +fm=/Developer/Applications/Utilities/FileMerge.app/Contents/MacOS/FileMerge +if [ -x "$fm" ]; then + exec "$fm" -left "$left" -merge "$out" -ancestor "$ancestor" -right "$right" fi -[ -n "$found" ] +exit 1 diff -r f166f70c64f9 -r ea62eb083ed4 filestates.cpp --- a/filestates.cpp Fri Mar 11 17:42:12 2011 +0000 +++ b/filestates.cpp Fri Mar 11 18:08:22 2011 +0000 @@ -156,7 +156,7 @@ break; case InConflict: - a << Annotate << Diff << RedoMerge << Revert << MarkResolved; + a << Annotate << Diff << RedoMerge << MarkResolved << Revert; break; case Missing: @@ -168,7 +168,7 @@ break; case Clean: - a << Remove << Annotate; + a << Annotate << Remove; break; case Ignored: diff -r f166f70c64f9 -r ea62eb083ed4 filestatuswidget.cpp --- a/filestatuswidget.cpp Fri Mar 11 17:42:12 2011 +0000 +++ b/filestatuswidget.cpp Fri Mar 11 18:08:22 2011 +0000 @@ -60,11 +60,11 @@ m_actionLabels[FileStates::Annotate] = tr("Show annotated version"); m_actionLabels[FileStates::Diff] = tr("Diff to parent"); m_actionLabels[FileStates::Commit] = tr("Commit..."); - m_actionLabels[FileStates::Revert] = tr("Revert to last commit"); + m_actionLabels[FileStates::Revert] = tr("Revert to last committed state"); m_actionLabels[FileStates::Add] = tr("Add to version control"); m_actionLabels[FileStates::Remove] = tr("Remove from version control"); m_actionLabels[FileStates::RedoMerge] = tr("Redo merge"); - m_actionLabels[FileStates::MarkResolved] = tr("Mark resolved"); + m_actionLabels[FileStates::MarkResolved] = tr("Mark conflict as resolved"); m_actionLabels[FileStates::Ignore] = tr("Ignore"); m_actionLabels[FileStates::UnIgnore] = tr("Stop ignoring"); diff -r f166f70c64f9 -r ea62eb083ed4 mainwindow.cpp --- a/mainwindow.cpp Fri Mar 11 17:42:12 2011 +0000 +++ b/mainwindow.cpp Fri Mar 11 18:08:22 2011 +0000 @@ -1845,6 +1845,13 @@ reportNewRemoteHeads(output); return; } + case ACT_MERGE: + case ACT_RETRY_MERGE: + MoreInformationDialog::information + (this, tr("Merge"), tr("Merge failed"), + tr("Some files were not merged successfully.

You can Merge again to repeat the interactive merge; use Revert to abandon the merge entirely; or edit the files that are in conflict in an editor and, when you are happy with them, choose Mark Resolved in each file's right-button menu."), + output); + return; case ACT_STAT: break; // go on and report default: