From 75f9ffa7c3c03d75b0c2db70e940415cc3ce91c3 Mon Sep 17 00:00:00 2001 From: hefee <me@hefee.de> Date: Thu, 22 Mar 2018 16:13:50 +0100 Subject: [PATCH] some small changes to run tests with it. --- git-merge-po.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/git-merge-po.sh b/git-merge-po.sh index b1804e8..fdf5160 100755 --- a/git-merge-po.sh +++ b/git-merge-po.sh @@ -54,17 +54,20 @@ function extract_changes() { | strip_graveyard } - BASE=$1 LOCAL=$2 REMOTE=$3 OUTPUT=$LOCAL +POT=`dirname ${LOCAL}`/pot TEMP=`mktemp /tmp/merge-po.XXXX` #echo "Using custom PO merge driver (`show_file ${LOCAL}`; $TEMP)" +echo "Using custom PO merge driver (`basename ${LOCAL}`; $TEMP)" + +cp $POT ${TEMP}.pot # Extract the PO header from the current branch (top of file until first empty line) -sed -e '/^$/q' < $LOCAL > ${TEMP}.header +sed -e '/^$/q' < $POT > ${TEMP}.header # clean input files msguniq --force-po -o ${TEMP}.base --unique ${BASE} @@ -95,8 +98,9 @@ m_msgcat -o ${TEMP}.remote-only --unique ${TEMP}.remote-changes ${TEMP}.conflict m_msgcat -o ${TEMP}.merge1 ${TEMP}.unchanged ${TEMP}.conflicts ${TEMP}.local-only ${TEMP}.remote-only # create a template to filter messages actually needed (those on local and remote) -m_msgcat -o - ${TEMP}.local ${TEMP}.remote \ - | m_msgmerge -o ${TEMP}.merge2 ${TEMP}.merge1 - +#m_msgcat -o - ${TEMP}.local ${TEMP}.remote \ +# | m_msgmerge -o ${TEMP}.merge2 ${TEMP}.merge1 - +m_msgmerge -o ${TEMP}.merge2 ${TEMP}.merge1 ${TEMP}.pot # final merge, adds saved header m_msgcat -o ${TEMP}.merge3 --use-first ${TEMP}.header ${TEMP}.merge2 @@ -110,6 +114,6 @@ if grep -q '#-#-#-#-#' $OUTPUT ; then echo " between ${TEMP}.local and ${TEMP}.remote" exit 1 fi -rm -f ${TEMP}* +#rm -f ${TEMP}* exit 0 -- GitLab