Use smerge minor mode in emacs to resolve conflicts.
authorSascha Wilde <wilde@sha-bang.de>
Wed, 15 Aug 2007 17:27:51 +0200
changeset 5172 f53d97d651f4
parent 5171 de7c772751b4
child 5173 6b4c332f241b
Use smerge minor mode in emacs to resolve conflicts. The condition-case is used to suppress errors with emacs versions before 21.
hgmerge
--- 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