summaryrefslogtreecommitdiff
path: root/mergetools/p4merge
blob: 295361a8aa7d075bbb9fdb8173858e37f9a43211 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
diff_cmd () {
	# p4merge does not like /dev/null
	rm_local=
	rm_remote=
	if test "/dev/null" = "$LOCAL"
	then
		LOCAL="./p4merge-dev-null.LOCAL.$$"
		>"$LOCAL"
		rm_local=true
	fi
	if test "/dev/null" = "$REMOTE"
	then
		REMOTE="./p4merge-dev-null.REMOTE.$$"
		>"$REMOTE"
		rm_remote=true
	fi

	"$merge_tool_path" "$LOCAL" "$REMOTE"

	if test -n "$rm_local"
	then
		rm -f "$LOCAL"
	fi
	if test -n "$rm_remote"
	then
		rm -f "$REMOTE"
	fi
}

merge_cmd () {
	touch "$BACKUP"
	$base_present || >"$BASE"
	"$merge_tool_path" "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
	check_unchanged
}