Skip to content

Instantly share code, notes, and snippets.

@vmiheer
Last active August 29, 2015 14:15
Show Gist options
  • Save vmiheer/50ee4dc07bb4b46b0084 to your computer and use it in GitHub Desktop.
Save vmiheer/50ee4dc07bb4b46b0084 to your computer and use it in GitHub Desktop.
sync p4 recursively
# 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/
@vmiheer
Copy link
Author

vmiheer commented Mar 25, 2015

doesn't work for zsh 😠

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment