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

Re: svn commit: rev 5750 - branches/cvs2svn-kfogel/tools/cvs2svn

From: Karl Fogel <kfogel_at_newton.ch.collab.net>
Date: 2003-04-29 02:06:26 CEST

Greg Stein <gstein@lyra.org> writes:
> ah!
>
> for component in components[:-1]:
>
> That'll create a new slice of the list, excluding the last component.

/me sits stunned at the elegance of it all

> anydbm should be fine. 'marshal' is just fine and very fast, if you stick
> with native Python datatypes (list, dict, string, integer, etc). You only
> need Pickle if you need to serialize class instances. My understanding is
> that cPickle is nearly as fast as marshal, but I doubt you'll need much
> beyond a "dictionary" that looks like:
>
> { "path1": None, "path2": None }
>
> And you just test with .has_key(path). (I used None in the example cuz you
> don't need a value(?); just the key)

Thanks!

It's gonna be a little more complicated than that, of course, since in
the Subversion filesystem, deleting a path is just a single call to
delete(PATH), yet means that everything under PATH goes away in head.
Since our mini-database has to represent the head tree at all times,
it needs to make all the paths underneath PATH go away when PATH goes
away -- which was the beauty of the current Node implementation, ah
well, easy come easy go :-).

> Be wary of anydbm. If that defaults to dumbdbm, then you're going to end up
> with the index in memory. Kaboom! Suggestion:
>
> import anydbm
>
> if anydbm._defaultmod.__name__ == 'dumbdbm':
> print 'ERROR: your installation of Python does not contain a proper'
> print ' DBM module. This script cannot continue.'
> print ' to solve: see blah blah blah'
> sys.exit(1)
>
> On my RH 7.2 installation, Python has a BDB module. I'd expect that you'll
> be fine with the DBM restriction.

Oh! I thought dumbdbm was more along the lines of CSV text files or
something. Yes, let's insist on a real DBM then :-).

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Apr 29 02:53:14 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.