3 messages in com.perforce.perforce-userscript which walks an integration des...
FromSent OnAttachments
Davi...@home.chat.net21 Jan 1998 16:22 
Davi...@home.chat.net21 Jan 1998 20:05 
Davi...@home.chat.net22 Jan 1998 11:05 
Subject:script which walks an integration description
From:Davi...@home.chat.net (Davi@home.chat.net)
Date:01/21/1998 04:22:24 PM
List:com.perforce.perforce-user

When you perform an integration by changenumber, the changenumbers that you integrated are not preserved in the change description. Instead of only records
your description and the target file revisions.

I often want to know what the source changenumbers were for an integration. So I wrote this script, I call it p4desc. It does the following:

1) find out if any integrations were performed in the given changenumber 2) foreach integration : find out the source file and revision for the
integration 3) foreach source file/rev: find out what changenumber applied that revision 4) sort and make unique that list of source changenumbers 5) show the descriptions for those changenumbers (i.e. p4 describe -s)

Limitations/Problems: - it stores intermediate output in ~/.tmp.xxx files, sorry, if I were a shell programming wizard I could no doubt fit all the datatransfer into pipes. I could also write it in perl, but the perl on the machine I use it on is broken. :( - it really should be recursive, because the source changes could be
integrations themselves. However, I didn't do this. It only goes one level "deep".

Here is a sample session, the script follows:

====== gemini:/home/djeske$ p4desc 771 Change 771 by msundius at msundius_sparc on 1998/01/20 11:10:26

@770 to reggaeos_magic

Affected files ...

... //depot/epidemic/typhoid/reggaeos/magicos/cfg/init_board.c#2 integrate ... //depot/epidemic/typhoid/reggaeos/magicos/sys/include/board_mac.h#2
integrate ... //depot/epidemic/typhoid/reggaeos/magicos/sys/include/board_map.h#2
integrate ... //depot/epidemic/typhoid/reggaeos/magicos/sys/libsys/nvram.c#2 integrate ... //depot/epidemic/typhoid/reggaeos/magicos/sys/libsys/watchdog.c#2 integrate

Integrated Changelist(s)...770 Change 770 by msundius at msundius_sparc on 1998/01/20 10:58:30

Take care of some odds and ends before release of test/show version.

- Changed init board so that it will list all problems found durring init.

- Added lock feature for nvram driver. note that the hardware has not be implemented so the lock register is now assigned to the serial scratch register. this needs to be changed when Darrell implements the "real" lock register.

- Added a Heart Beat LED on the typhoid board. it is flashed when ever the watch dog is toggeled.

- Finally I changed the MILESTONE macro so that it does not swap nibbles anymore. this will make it hard to read on development boards but easier to read on production boards.

Affected files ...

... //depot/epidemic/typhoid/reggaeos/main/cfg/init_board.c#12 edit ... //depot/epidemic/typhoid/reggaeos/main/sys/include/board_mac.h#8 edit ... //depot/epidemic/typhoid/reggaeos/main/sys/include/board_map.h#13 edit ... //depot/epidemic/typhoid/reggaeos/main/sys/libsys/nvram.c#6 edit ... //depot/epidemic/typhoid/reggaeos/main/sys/libsys/watchdog.c#3 edit

gemini:/home/djeske$

======

#!/bin/ksh if [[ $1 != "" ]]; then p4 describe -s $1 | tee ~/.tmp.p4desc1

# show the prompt so they know why they are waiting...

set foundsome foundsome='false' printf "Integrated Changelist(s)...";

# find the target file revisions for the integrations in this changenumber

egrep "integrate$" ~/.tmp.p4desc1 | cut -d' ' -f2 > ~/.tmp.p4desc2;

# now compile a list of the source files and revisions for those integrations

rm -f ~/.tmp.p4desc3 for i in `cat ~/.tmp.p4desc2`; do set file rev rev=${i##*\#} file=${i%%\#*}

p4 filelog $file >> ~/.tmp.p4desc3 foundsome='true'

done

if [[ $foundsome == 'false' ]]; then printf "(none)\n\n"; exit 0; fi

# now find the changenumbers which appled those original changes

rm -f ~/.tmp.p4desc4 for i in `cat ~/.tmp.p4desc3 | awk '/... #2/ { getline ; \ if ($splitct = split($0, b, " ")) { print b[5] ; } }'`; do set rev file file=${i%%\#*} rev=${i##*\#}

p4 filelog $file | grep "... #${rev}" | cut -d' ' -f4 >> ~/.tmp.p4desc4 done

# for each unique changenumber, print out the description

for i in `cat ~/.tmp.p4desc4 | sort -t ' ' -u -k 1`; do

printf "$i " done

printf "\n"

for i in `cat ~/.tmp.p4desc4 | sort -t ' ' -u -k 1`; do p4 describe -s $i done

else echo echo "Usage: p4desc <changenumber>" echo fi

==========================

--- David Jeske (N9LCA) + http://www.chat.net/~jeske/ + jeske at chat.net