Commits

Éric Araujo  committed f35e644

Add my translation branches merge tool

  • Participants
  • Parent commits d8ad23b

Comments (0)

Files changed (3)

 #!/bin/sh
 #
 # This is an example of using HGEDITOR to create of diff to review the
-# changes while commiting.
+# changes while commiting.  Written by Matt Mackall and others under GPLv2+.
 
 # set envvar that can be useful in the editor
 REPO="$PWD"; export REPO
+#!/bin/sh
+# This script is a merge tool for Mercurial repositories using translation
+# branches (see README).  Written by Éric Araujo under GPLv2+.
+# Some lines taken from Mercurial's hgeditor script, by Matt Mackall and
+# others, GPLv2+.
+
+# set envvar that can be useful in the editor
+REPO="$PWD"; export REPO
+HGTMP=""
+
+cleanup_exit() {
+    rm -rf "$HGTMP"
+}
+
+# Remove temporary files even if we get interrupted
+trap "cleanup_exit" 0 # normal exit
+trap "exit 255" HUP INT QUIT ABRT TERM
+
+HGTMP=$(mktemp -d ${TMPDIR-/tmp}/hgeditor.XXXXXX)
+[ x$HGTMP != x -a -d $HGTMP ] || {
+  echo "$0: could not create temporary directory, exiting" 1>&2
+  exit 1
+}
+
+# Create the diff between other and base
+diff -u $2 $3 > "$HGTMP/diff"
+
+# Display the output file and the diff in a split window
+# (the buftype setting makes vim quit when the output file is closed, even if
+# the diff buffer is not)
+vim -f "$HGTMP/diff" +"set buftype=help" +"vsplit $1" || exit $?
+
+exit $?
+# Basic Mercurial configuration
+
+[ui]
+# username = Full Name <mail@example.org>
+editor = path/to/scripts-hg/hgeditor
+
+[merge-tools]
+l10nmerge.executable = path/to/scripts-hg/hgl10nmerge
+
+[diff]
+git = on
+showfunc = on
+
+[extensions]
+color =
+graphlog =