Subject: Re: git-p4 fails when cloning a p4 depo.

From: Han-Wen Nienhuys <[email-masked]>
Date: Mon, 11 Jun 2007 22:13:17 -0300

Benjamin Sergeant escreveu:
> A perforce command with all the files in the repo is generated to get
> all the file content.
> Here is a patch to break it into multiple successive perforce command
> who uses 4K of parameter max, and collect the output for later.
> 
> It works, but not for big depos, because the whole perforce depo
> content is stored in memory in P4Sync.run(), and it looks like mine is
> bigger than 2 Gigs, so I had to kill the process.

General idea of the patch is ok.  some nits:

> +        chunk = ''
> +        filedata = []
> +        for i in xrange(len(files)):

why not 

  for f in files:

?

> +            f = files[i]
> +            chunk += '"%s#%s" ' % (f['path'], f['rev'])
> +            if len(chunk) > 4000 or i == len(files)-1:

4k seems reasonable enough, but can you take the min() with
os.sysconf('SC_ARG_MAX') ?

Can you address this and resend so we can apply the patch? 
Thanks.

-- 
 Han-Wen Nienhuys - [email-masked] - http://www.xs4all.nl/~hanwen