From: "Benjamin Sergeant" <bsergean@gmail.com>
To: "Simon Hausmann" <simon@lst.de>
Cc: git@vger.kernel.org
Subject: Re: git-p4 fails when cloning a p4 depo.
Date: Sun, 17 Jun 2007 09:09:00 -0700 [thread overview]
Message-ID: <1621f9fa0706170909s779b471fl872c027b8e7b446c@mail.gmail.com> (raw)
In-Reply-To: <200706171011.52492.simon@lst.de>
[-- Attachment #1: Type: text/plain, Size: 1812 bytes --]
On 6/17/07, Simon Hausmann <simon@lst.de> wrote:
> On Tuesday 12 June 2007 03:13:17 Han-Wen Nienhuys wrote:
> > 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:
> >
> > ?
>
> It seems 'i' is used a bit later. Is there a nicer way to express this in
> python?
>
> > > + 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.
>
> Since I ran into the very problem of a too long commandline myself yesterday I
> took the liberty of adding the SC_ARG_MAX bit to Benjamin's patch and
> comitting it then.
>
Cool.
(probably useless but)
For what it's worth ; Here is a tar file with 2 patchs:
- The original one
- The second one that adds the SC_ARG_MAX
BTW, doing a += on a string is not supposed to be fast, appending elem
to a sequence and then using ' '.join on them to build the big string
is said to be faster (I did not timed it thought). (in the second
patch also)
Thanks,
Benjamin.
>
> Simon
>
>
[-- Attachment #2: p4-sync-chunks.tar --]
[-- Type: application/x-tar, Size: 10240 bytes --]
prev parent reply other threads:[~2007-06-17 16:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-08 16:41 git-p4 fails when cloning a p4 depo Benjamin Sergeant
2007-06-08 18:13 ` Benjamin Sergeant
2007-06-08 21:31 ` Scott Lamb
2007-06-08 21:34 ` Scott Lamb
2007-06-08 22:04 ` Benjamin Sergeant
2007-06-08 22:25 ` Benjamin Sergeant
2007-06-08 23:33 ` Han-Wen Nienhuys
2007-06-09 0:32 ` Benjamin Sergeant
2007-06-08 22:38 ` Simon Hausmann
2007-06-12 1:07 ` Han-Wen Nienhuys
2007-06-12 1:08 ` Han-Wen Nienhuys
2007-06-12 1:13 ` Han-Wen Nienhuys
2007-06-17 8:11 ` Simon Hausmann
2007-06-17 16:09 ` Benjamin Sergeant [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1621f9fa0706170909s779b471fl872c027b8e7b446c@mail.gmail.com \
--to=bsergean@gmail.com \
--cc=git@vger.kernel.org \
--cc=simon@lst.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).