changeset 530:2262f753b19e

Add more useful message for merge with working directory ancestor
author Chris Cannam
date Wed, 23 Nov 2011 11:24:23 +0000
parents 4276c7923d65
children f56e5c39aad1
files src/mainwindow.cpp
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/mainwindow.cpp	Thu Nov 17 17:49:05 2011 +0000
+++ b/src/mainwindow.cpp	Wed Nov 23 11:24:23 2011 +0000
@@ -2210,6 +2210,16 @@
         // as the user closing the window via the wm happens
         return;
     case ACT_MERGE:
+        if (output.contains("working directory ancestor")) {
+            // arguably we should prevent this upfront, but that's
+            // trickier!
+            MoreInformationDialog::information
+                (this, tr("Merge"), tr("Merge has no effect"),
+                 tr("You asked to merge a revision with one of its ancestors.<p>This has no effect, because the ancestor's changes already exist in both revisions."),
+                 output);
+            return;
+        }
+        // else fall through
     case ACT_RETRY_MERGE:
         MoreInformationDialog::information
             (this, tr("Merge"), tr("Merge failed"),