#! /bin/sh #p4 diff2 -q //depot/vendor/freebsd/sys/...@ia64_base //depot/projects/ia64/sys/... # 1 2 3 4 5 6 7 8 # ==== //depot/vendor/freebsd/sys/boot/efi/include/efiapi.h#1 (text+ko) - //depot/projects/ia64/sys/boot/efi/include/efiapi.h#2 (text+ko) ==== content # 1 2 3 4 5 6 7 # ==== < none > - //depot/projects/ia64/sys/boot/efi/include/efifpswa.h#2 ==== # -u # --- /etc/passwd Sat Nov 3 03:38:39 2001 # +++ /etc/motd Thu Nov 15 23:53:16 2001 # -c # *** /etc/passwd Sat Nov 3 03:38:39 2001 # --- /etc/motd Thu Nov 15 23:53:16 2001 p4 diff2 -q //depot/vendor/freebsd/...@ia64_base //depot/projects/ia64/... | sed -e 's/([^)]*)//g' -e 's/< none >/none/g' -e 's/ content$//' | awk '{ print $2, $4 }' | awk '{ "date" | getline date; if ($1 != "none") { cmd=sprintf("p4 print -q %s > /tmp/file1", $1); system(cmd); file1="/tmp/file1" rf=$1; rf=substr(rf, 24); i=index(rf, "#"); rf=substr(rf, 0, i-1); header1=sprintf("--- %s %s", rf, date); idx=sprintf("Index: %s", rf); } else { file1="/dev/null" header1=sprintf("--- /dev/null %s", date); idx=""; } if ($2 != "none") { cmd=sprintf("p4 print -q %s > /tmp/file2", $2); system(cmd); file2="/tmp/file2" rf=$2; rf=substr(rf, 23); i=index(rf, "#"); rf=substr(rf, 0, i-1); header2=sprintf("+++ %s %s", rf, date); idx=sprintf("Index: %s", rf); } else { file2="/dev/null" header2=sprintf("+++ /dev/null %s", date); } if (idx != "") { print idx; } print header1; print header2; cmd=sprintf("diff -u2 %s %s | tail +3", file1, file2); system(cmd); print ""; }'