[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: cvs2svn.py fails converting repository with the attached file

From: mark benedetto king <mbk_at_lowlatency.com>
Date: 2003-06-27 16:48:13 CEST

On Thu, Jun 26, 2003 at 06:23:26PM -0700, Greg Stein wrote:
> On Thu, Jun 26, 2003 at 01:15:49PM -0400, mark benedetto king wrote:
> >...
> > +++ tools/cvs2svn/rcsparse/common.py Thu Jun 26 13:10:43 2003
> > @@ -153,11 +153,16 @@
> > timestamp = compat.timegm(tuple(date_fields))
> >
> > # Parse author
> > - semi, author, sym = self.ts.mget(3)
> > + sym = self.ts.get()
>
> We can optimistically grab all three tokens. If 'semi' is not a semicolon,
> then we can assume it is a second part for the author, append them, and grab
> another token looking for the semicolon.
>

But my name is Mark Benedetto King. :-)

> > if sym != 'author':
> > raise RCSExpected(sym, 'author')
> > - if semi != ';':
> > - raise RCSExpected(semi, ';')
> > + author = ''
> > + while 1:
> > + token = self.ts.get()
> > + if token == ';':
> > + break
> > + author = author + token + ' '
> > + author = author[:-1]
>
> I would favor an assumption of a single extra token for the author, rather
> than an unbounded loop. Note that these loops are quite sensitive to
> performance, too. That was the whole purpose for introducing .mget() :-)
>

I thought about that too; error messages like "unexpected EOF" aren't
very useful, when the real problem was corruption 10% into the file.
However, I noticed that the next few lines to parse the 'state' had
an unbounded loop of their own, so I figured, "when in Rome..."

--ben

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jun 27 16:48:17 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.