opnsense-src/tools/tools/perforce/p4diffbranch
John-Mark Gurney d1522a3ba7 add scripts for generating a diff from p4...
awkdiff is the script from scottl that he got from ken a long time
ago...  It no longer lives in his home dir, so give it a new home...
This does simple massaging of p4 output to create a useful diff...

The script p4diffbranch will create a diff that includes new and
deleted files unlike the normal diff2 -b command...  So will be useful
for extracting patches from p4...  It does take a changeset that will
be used to diff against...
2014-08-27 18:56:12 +00:00

19 lines
410 B
Bash
Executable file

#!/bin/sh -
#
# $FreeBSD$
#
if [ x"$#" != x"2" ]; then
echo "Usage: $0 <branch> <changesetnum>"
exit 1
fi
basescript="$(realpath "$0")"
awkdiff="${basescript%/*}/awkdiff"
branch="$1"
changenum="$2"
p4 branch -o "$branch" |
awk ' /^View:/ { doview = 1; next; } /^[^ ]/ {doview = 0; next; } $1 && $2 && doview == 1 { system("p4 diff2 -du " $1 "@" changenum " " $2) }' changenum="$changenum" |
"$awkdiff"