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

Re: [PATCH] Don't remove empty directories when creating repositories (in some cases)

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Wed, 1 Apr 2015 10:11:21 +0000

Sergey Raevskiy wrote on Tue, Mar 31, 2015 at 16:31:55 +0300:
> > Wouldn't it be easier, and a smaller patch, to add a check in
> > svn_repos_create that the FS type is valid /before/ creating the
> > repository structure? This would also avoid adding yet another public API.
>
> As I understand there is no public API for checking if FS-type is valid and
> corresponding FS module is available (for DSO-enabled builds).
>
> Even if we do a preliminary check like that, there are a number of other
> errors that could occur during module loading and filesystem creation.
> I used 'invalid-fs-type' in test just as simple and predictable way to fail
> the filesystem creation.
>

I don't think it's a very robust way to cause svn_repos_create() to
fail, precisely for the reason brane mention: the implementation might
trip on the invalid FS value (DSO support notwithstanding) regardless of
the disk status.

If you want to force fail because of the existing directory, I suggest
you create a directory and then do the equivalent of 'chmod -w' on it.

Cheers,

Daniel

> I agree that it would be better to avoid adding yet another public API, but
> svn_io_remove_dir_contents() function might be useful for both Subversion
> and third-party public API clients.
Received on 2015-04-01 12:11:54 CEST

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.