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

Re: cvs2svn crash

From: Marcus Comstedt <marcus_at_mc.pp.se>
Date: 2003-08-22 17:45:00 CEST

kfogel@collab.net writes:

> There's code near the beginning of cvs2svn that's supposed to make
> sure we get the right db:
>
> -----------------------------------------------------------------------------
> # Don't settle for less.
> 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 http://python.org/doc/current/lib/module-anydbm.html'
> print ' for details.'
> sys.exit(1)
> -----------------------------------------------------------------------------
>
> But it only makes sure we don't get 'dumbdbm'. Maybe it needs to do
> more? I don't have time to write/test a patch, but I would be happy
> to review/apply one...

The one I get is apparently called 'dbm', so I suppose this would fix
the problem at hand:

Index: cvs2svn.py
===================================================================
--- cvs2svn.py (revision 6820)
+++ cvs2svn.py (working copy)
@@ -26,7 +26,7 @@
   sys.exit(1)
 
 # Don't settle for less.
-if anydbm._defaultmod.__name__ == 'dumbdbm':
+if anydbm._defaultmod.__name__ == 'dumbdbm' or anydbm._defaultmod.__name__ == 'dbm':
   print 'ERROR: your installation of Python does not contain a proper'
   print ' DBM module. This script cannot continue.'
   print ' to solve: see http://python.org/doc/current/lib/module-anydbm.html'

However, rather than trying to list all the DBM:s that _don't_ work,
shouldn't it just list one that works? In fact, why use anydbm at all
if any DBM isn't good enough?

I think this patch would make more sense:

Index: cvs2svn.py
===================================================================
--- cvs2svn.py (revision 6820)
+++ cvs2svn.py (working copy)
@@ -16,7 +16,7 @@
 import getopt
 import stat
 import md5
-import anydbm
+import dbhash
 import marshal
 
 # Make sure this Python is recent enough.
@@ -25,14 +25,6 @@
   sys.stderr.write('Python 2.0 or higher is required; see www.python.org.\n')
   sys.exit(1)
 
-# Don't settle for less.
-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 http://python.org/doc/current/lib/module-anydbm.html'
- print ' for details.'
- sys.exit(1)
-
 trunk_rev = re.compile('^[0-9]+\\.[0-9]+$')
 branch_tag = re.compile('^[0-9.]+\\.0\\.[0-9]+$')
 vendor_tag = re.compile('^[0-9]+\\.[0-9]+\\.[0-9]+$')

  // Marcus

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Aug 22 17:49:13 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.