#!/bin/sh
set -e
+xxx new theory, new metadata, not yet done here
+
fail () { echo >&2 "$0: $*"; exit 127; }
case "$1" in
---v1) how=tip ;;
---v1-base) how=base ;;
---v1-dep) how=dep ;;
+--v1) how=same ;; # merge into tip from another tip of this patch
+ # or into base from another base of this patch
+--v1-base) how=base ;; # merge into tip from a base of this patch
+--v1-dep) how=dep ;; # merge into base from a dep's tip
*) fail "bad usage" ;;
esac
whichfile=$1
ancestor=$2
-current=$3
-other=$4
+ours=$3
+theirs=$4
markersize=$5
+set -- "$ours" "$ancestor" "$theirs"
+
case $on.$whichfile in
-dep.msg|dep.deps|dep.flags)
- touch "$current"
- exit 0
+dep.msg|dep.deps|dep.props)
+ touch "$ours"
+ ;;
+base.msg)
+ echo '# not applicable' >"$ours"
+base.deps)
+ echo >"$ours"
+ touch >"$ours"
;;
-base.msg|base.deps)
- echo '# not applicable' >"$current"
- exit 0
+base.props)
+ exec topbloke-merge-lists -M$markersize -P -UDeleted "$@"
;;
-base.flags)
- exec topbloke-merge-lists -UDeleted "$current" "$ancestor" "$other"
+same.msg)
+ exec git-merge-file --marker-size=$markersize "$@"
;;
-tip.msg)
- exec git-merge-file --marker-size=$markersize \
- "$current" "$ancestor" "$other"
+same.deps|*.included)
+ exec topbloke-merge-lists -M$markersize "$@"
;;
-tip.deps|tip.flags|*.included|*.pflags)
- exec topbloke-merge-lists "$current" "$ancestor" "$other"
+same.props|*.pprops)
+ exec topbloke-merge-lists -M$markersize -P "$@"
;;
*)
fail "huh $on $whichfile ?"