Integrating moved files in perforce

前端 未结 5 2272
太阳男子
太阳男子 2021-02-19 06:35

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,

5条回答
  •  情书的邮戳
    2021-02-19 07:12

    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.

提交回复
热议问题