Say I created a branch in perforce of our codebase. Here is the branch spec:
//depot/code/main/... //depot/code/branch/...
Then, in the branch,
You could script the creation of a branch spec for handling moved files using the output of p4 fstat.
Use the following as a starting point:
ROOT_PATH="//depot/books/..."
FIRST_CHANGE=91212
p4 fstat -Os -T headChange -F "headAction=move/* headChange>$FIRST_CHANGE" $ROOT_PATH|grep headChange | sort -u|while read DUMMY1 DUMMY2 change; do p4 describe $change; done|grep "moved from"|sed 's/\.\.\./\t/g; s/\#[0-9]*//g; s/ moved from//g;'
This will find all files in //depot/books/... that were moved in change 91212 or later
For us, the output of this looks like
//depot/books/bar.txt //depot/books/foo.txt
Use it for crafting a branch spec.