您的位置:首页 > 其它

用p4 获得大于 50000个文件的 目录

2014-04-23 15:13 162 查看
由于单位管理员限制,perforce 只能取回不大于50000个文件的文件夹

Request too large (over 50000); see 'p4 help maxresults'

偏偏有些项目的文件数大于这个限制

于是写了一段脚本来遍历perforce文件夹来取回文件

<pre style="padding: 0px; margin-top: 10px; margin-bottom: 10px; overflow: visible; font-size: 13.3333330154419px; line-height: 17.3333339691162px; background-color: rgb(255, 255, 255);">#!/bin/bash

function syncdir(){

fullpath=$1/...$2
filepath=$1/*$2

#Encounter maxresults error?
if ! p4 sync $fullpath 2>&1 | sed ''/maxresults/' {q1} '
then
#sync files only
p4 sync $filepath

#go to sub directory
for d in `p4 dirs $1/*`
do
syncdir $d $2
done
fi
}

echo 'depot path'=$1
echo 'revision/lable/CL'=$2

#$1 depot path, without /...
#$2 change list/revision/label

syncdir $1 $2



                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐