Last active
August 29, 2015 14:15
-
-
Save vmiheer/50ee4dc07bb4b46b0084 to your computer and use it in GitHub Desktop.
sync p4 recursively
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# we have software depot in perforce //sw/... | |
# problem is while syncing we get: | |
# Request too large (over 750000); see 'p4 help maxresults'. | |
# here is simple function to resolve this: | |
# if you are using zsh | |
# $ setopts interactivecomments | |
sync_p4 () | |
{ | |
p4 -r 1 sync $1...$2; # sync $1 at $2 ; possible $2's can be #0 ;) or @my-cl-number | |
# retry only once | |
if [ $? -ne 0 ]; then # if not successful in syncing $1 recurse | |
while read p; do | |
sync_p4 $p; | |
done < <(p4 dirs -C $1\*); # tailor here if you *have* different than in client ;) | |
fi # http://www.perforce.com/perforce/r14.2/manuals/cmdref/p4_dirs.html | |
} | |
# use: $ sync_p4 //depot/subset/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
doesn't work for zsh 😠