changeset 318:124a3ea9fafb easyhg_v0.4

Merge, and add a helpful warning when you try to push before committing your merge (I just did this and the ensuing warning was misleading)
author Chris Cannam
date Wed, 02 Mar 2011 12:38:17 +0000
parents 5144926b715e (current diff) 806e9cb9ce61 (diff)
children 1aba0914dcfc 67feb05754ee
files mainwindow.cpp
diffstat 2 files changed, 18 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/deploy/osx/deploy.sh	Wed Mar 02 12:32:50 2011 +0000
+++ b/deploy/osx/deploy.sh	Wed Mar 02 12:38:17 2011 +0000
@@ -33,20 +33,17 @@
 install_name_tool -id QtGui "$app.app/Contents/Frameworks/QtGui"
 install_name_tool -id QtNetwork "$app.app/Contents/Frameworks/QtNetwork"
 
-install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore "$app.app/Contents/MacOS/$app"
-install_name_tool -change QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui "$app.app/Contents/MacOS/$app"
-install_name_tool -change QtNetwork.framework/Versions/4/QtNetwork @executable_path/../Frameworks/QtNetwork "$app.app/Contents/MacOS/$app"
-
-install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore "$app.app/Contents/MacOS/kdiff3"
-install_name_tool -change QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui "$app.app/Contents/MacOS/kdiff3"
-install_name_tool -change QtNetwork.framework/Versions/4/QtNetwork @executable_path/../Frameworks/QtNetwork "$app.app/Contents/MacOS/kdiff3"
-
-install_name_tool -change QtCore.framework/Versions/4/QtCore @loader_path/QtCore "$app.app/Contents/Frameworks/QtGui"
-install_name_tool -change QtCore.framework/Versions/4/QtCore @loader_path/QtCore "$app.app/Contents/Frameworks/QtNetwork"
-
-install_name_tool -change QtCore.framework/Versions/4/QtCore @loader_path/../../Frameworks/QtCore "$app.app/Contents/MacOS/PyQt4/QtCore.so"
-install_name_tool -change QtCore.framework/Versions/4/QtCore @loader_path/../../Frameworks/QtCore "$app.app/Contents/MacOS/PyQt4/QtGui.so"
-install_name_tool -change QtCore.framework/Versions/4/QtCore @loader_path/../../Frameworks/QtGui "$app.app/Contents/MacOS/PyQt4/QtGui.so"
+for fwk in QtCore QtGui QtNetwork; do
+	find "$app.app" -type f -print | while read x; do
+		current=$(otool -L "$x" | grep "$fwk.framework/" | awk '{ print $1; }')
+		[ -z "$current" ] && continue
+		echo "$x has $current"
+		relative=$(echo "$x" | sed -e "s,$app.app/Contents/,," \
+			-e 's,[^/]*/,../,g' -e 's,/[^/]*$,/Frameworks/'"$fwk"',' )
+		echo "replacing with relative path $relative"
+		install_name_tool -change "$current" "@loader_path/$relative" "$x"
+	done
+done
 
 echo "Done: be sure to run the app and see that it works!"
 
--- a/mainwindow.cpp	Wed Mar 02 12:32:50 2011 +0000
+++ b/mainwindow.cpp	Wed Mar 02 12:38:17 2011 +0000
@@ -1708,6 +1708,13 @@
              tr("Push failed"),
              tr("Your local repository could not be pushed to the remote repository.<br><br>You may need to merge the changes locally first."),
              output);
+    } else if (m_hgTabs->canCommit() && m_currentParents.size() > 1) {
+        MoreInformationDialog::warning
+            (this,
+             tr("Push failed"),
+             tr("Push failed"),
+             tr("Your local repository could not be pushed to the remote repository.<br><br>You have an uncommitted merge in your local folder.  You probably need to commit it before you push."),
+             output);
     } else {
         MoreInformationDialog::warning
             (this,