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

Re: 'svnadmin create' can blow away your repository

From: Michael Wood <mwood_at_its.uct.ac.za>
Date: 2003-02-12 13:06:32 CET

On Tue, Feb 11, 2003 at 03:53:13PM -0800, Greg Stein wrote:
> On Mon, Feb 10, 2003 at 12:56:01PM -0600, Karl Fogel wrote:
> > "B. W. Fitzpatrick" <fitz@red-bean.com> writes:
> > > If you pass the path of an existing repository to 'svnadmin
> > > create', svnadmin quietly blows away the repository. Shouldn't
> > > this throw an error or require a --force flag or something?
> >
> > Yes, absolutely. (shiver)
> >
> > Want to fix it?
>
> Hunh? I don't understand. svn_fs_create_berkeley() creates a directory
> right off the bat. If the directory exists, then it just bails.
>
> What is the actual symptom here? Is it the db/ part that gets blown,
> or other parts of the repos area?

It seems "svnadmin create" ignores the fact that the top level
repository directory exists, but dies when it tries to create the
"db" subdirectory.

$ svn --version
svn, version 0.17.1 (r4503)
   compiled Jan 26 2003, 14:09:21

Copyright (C) 2000-2003 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/

The following repository access (RA) modules are available:

* ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
  - handles 'http' schema
  - handles 'https' schema
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' schema
* ra_svn : Module for accessing a repository using the svn network protocol.
  - handles 'svn' schema

$ svnadmin create repo
$ svnadmin mkdir -m blah file://`pwd`/repo/blah
$ svn ls file://`pwd`/repo
blah/
$ svnadmin create repo
svn: File exists
svn: creating Berkeley DB environment dir `repo/db'
$ svn ls file://`pwd`/repo
blah/
$ strace svnadmin create repo
[...]
mkdir("repo", 0777) = -1 EEXIST (File exists)
[...]
open("repo", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
[...]
mkdir("repo/db", 0777) = -1 EEXIST (File exists)
[...]
write(2, "svn: File exists\n", 17) = 17
[...]
write(2, "svn: creating Berkeley DB enviro"..., 52) = 52
[...]

Why shouldn't it fail when the first mkdir() fails?

-- 
Michael Wood <mwood@its.uct.ac.za>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Feb 12 13:07:56 2003

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