From d2a871d0d97444b27d1e0bd124d4d7c2bbf04e22 Mon Sep 17 00:00:00 2001 From: crs Date: Wed, 25 Dec 2002 19:20:12 +0000 Subject: [PATCH] Added ability to filter out filespec prefixes and removed @... from user on each change. --- nodist/p4tolog | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/nodist/p4tolog b/nodist/p4tolog index 476dffaa..561a25a3 100755 --- a/nodist/p4tolog +++ b/nodist/p4tolog @@ -8,6 +8,21 @@ # location of perforce client P4=/home/perforce/bin/p4 +prefix="" +while [ -n "$1" ]; do + case "$1" in + -p) + # get depot filespec prefix to strip and escape slashes + prefix=`echo $2 | sed -e 's#/#\\\\/#g'` + shift + ;; + *) + break + ;; + esac + shift +done + # get relevant changes changes=`$P4 changes $* | sed -e 's/Change \([0-9]*\).*/\1/'` if test -z "$changes"; then @@ -18,10 +33,10 @@ fi # convert each change for change in $changes; do $P4 describe -s $change | head -1 | \ - sed -e 's/.*by \([^ ]*\) on \([^ ]*\) \([^ ]*\)/\2 \3 \1/' + sed -e 's/.*by \([^ @]*\)[^ ]* on \([^ ]*\) \([^ ]*\)/\2 \3 \1/' $P4 describe -s $change | \ awk 'p==1 && !/^$/;/^Affected/{p=1}' | \ - sed -e 's/^[^ ]* \([^#]*\)#.*$/\1/' + sed -e 's/^[^ ]* \([^#]*\)#.*$/\1/' | sed -e "s/^$prefix//" echo $P4 describe -s $change | \ awk 'p==1 && !/$^/;/^$/{if (p==1) exit; else p=1}' | \