由于单位管理员限制,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