procedure(CDS_P4BulkCheckin(libname description)
let( (client cmd libid liblist)
if(libname == "all"
then
liblist=ddGetLibList()
else
liblist=list(ddGetObj(libname))
)
foreach(lib liblist
when(ddGetObjDMSys(lib) == "p4" && lib~>p4CheckinType == "Bulk"
printf("Working on %s\n" lib~>name)
libid=lib
client = CDS_P4GetClient(libid)
;; add any files that may be hanging about
;; since we have disabled p4 add and edit for bulk mode
tmpfile = sprintf(nil "/tmp/bulkadd.%d" ipcGetPid())
cmd2 = "grep -v cd% | grep -v cd- | grep -v cd? | grep -v cdslck"
sprintf(cmd "find %s -type f | %s > %s ; p4 -x %s -c %s add > /dev/null; rm %s"
CDS_NFSSimplify(libid~>writePath) cmd2 tmpfile tmpfile client tmpfile)
println("Adding new files, please wait, this will take time...")
println(cmd)
CDS_IPCCommand(cmd)
;; now do the diff
sprintf(cmd "p4 -c %s diff -se > /tmp/p4diffse.%d ; p4 -x /tmp/p4diffse.%d -c %s edit " client ipcGetPid() ipcGetPid() client)
println("Diffing objects, please wait, this will take time...")
println(cmd)
CDS_IPCCommand(cmd)
;; now find the deleted files
sprintf(cmd "p4 -c %s diff -sd > /tmp/p4diffsd.%d ; p4 -x /tmp/p4diffsd.%d -c %s delete " client ipcGetPid() ipcGetPid() client)
println("Looking for deleted files...")
println(cmd)
CDS_IPCCommand(cmd)
;; now do the submit
sprintf(cmd "p4 -c %s change -o | sed 's/<enter description here>/cds:Bulk %s/g' | p4 -c %s submit -i > /dev/null" client description client)
println(cmd)
CDS_IPCCommand(cmd)
)
)
)
)