]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Nicer merging.
authorRudolf Polzer <divverent@xonotic.org>
Fri, 13 Sep 2013 09:22:42 +0000 (11:22 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Fri, 13 Sep 2013 09:22:42 +0000 (11:22 +0200)
.tx/merge-base
tx.sh

index 0a00903ed69ad9be72c6923171615addb28d9779..1af935744d2eb1ca66a1ae19879788112dd826f0 100644 (file)
@@ -1 +1 @@
-Fri Sep 13 11:00:37 CEST 2013
+Fri Sep 13 11:09:31 CEST 2013
diff --git a/tx.sh b/tx.sh
index 212a036fcb08d459ba4db7eb5d1b251065d8e665..fb03700a42953d9c218e7c105bb1500531770d14 100644 (file)
--- a/tx.sh
+++ b/tx.sh
@@ -23,30 +23,27 @@ for f in common.*.po; do
        gnewfile=common.$lang.po
        if [ -f "$tcurfile" ]; then
                git show "$mergebase":"$gnewfile" > "$goldfile"
-               msgcat -s --no-location --strict "$tcurfile" | grep -v "^#" > "$tcurfile.sorted"
-               msgcat -s --no-location --strict "$goldfile" | grep -v "^#" > "$goldfile.sorted"
-               msgcat -s --no-location --strict "$gnewfile" | grep -v "^#" > "$gnewfile.sorted"
-               if diff -u "$goldfile.sorted" "$gnewfile.sorted" >/dev/null; then
+               msgmerge -F -U "$tcurfile" common.pot
+               msgmerge -F -U "$goldfile" common.pot
+               msgmerge -F -U "$gnewfile" common.pot
+               if diff -u "$goldfile" "$gnewfile" >/dev/null; then
                        # no change on git, changed on tx only
                        msgmerge -F -U "$tcurfile" common.pot
                        cp "$tcurfile" "$gnewfile"
                else
-                       if ! diff -u "$goldfile.sorted" "$gnewfile.sorted" | patch "$tcurfile.sorted"; then
+                       if ! diff -u "$goldfile" "$gnewfile" | patch "$tcurfile"; then
                                while :; do
-                                       vim -o "$tcurfile.sorted.rej" "$tcurfile.sorted"
+                                       vim -o "$tcurfile.rej" "$tcurfile"
                                        echo "OK?"
                                        read -r OK || exit 1
                                        [ x"$OK" != x"y" ] || break
                                done
-                               rm -f "$tcurfile.sorted.rej"
+                               rm -f "$tcurfile.rej"
                        fi
-                       mv "$tcurfile.sorted" "$tcurfile"
                        msgmerge -F -U "$tcurfile" common.pot
                        cp "$tcurfile" "$gnewfile"
-                       rm "$goldfile.sorted"
-                       rm "$gnewfile.sorted"
-                       rm "$goldfile"
                fi
+               rm "$goldfile"
        else
                msgmerge -F -U "$gnewfile" common.pot
                cp "$gnewfile" "$tcurfile"