changeset 5172:f53d97d651f4

Use smerge minor mode in emacs to resolve conflicts. The condition-case is used to suppress errors with emacs versions before 21.
author Sascha Wilde <wilde@sha-bang.de>
date Wed, 15 Aug 2007 17:27:51 +0200
parents de7c772751b4
children 6b4c332f241b
files hgmerge
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgmerge	Wed Aug 15 16:43:40 2007 +0200
+++ b/hgmerge	Wed Aug 15 17:27:51 2007 +0200
@@ -169,7 +169,14 @@
 if [ -n "$MERGE" -o -n "$DIFF3" ]; then
     echo "conflicts detected in $LOCAL"
     cp "$BACKUP" "$CHGTEST"
-    $EDITOR "$LOCAL" || failure
+    case "$EDITOR" in
+        "emacs")
+            $EDITOR "$LOCAL" --eval '(condition-case nil (smerge-mode 1) (error nil))' || failure
+            ;;
+        *)
+            $EDITOR "$LOCAL" || failure
+            ;;
+    esac
     # Some editors do not return meaningful error codes
     # Do not take any chances
     $TEST "$LOCAL" -nt "$CHGTEST" && conflicts_or_success || ask_if_merged