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

Re: A proposed solution for svn admin directory names

From: Branko Čibej <brane_at_xbc.nu>
Date: 2005-07-12 00:05:07 CEST

Jonathan Malek wrote:

>I know there is quite a bit of resistance to dealing with the issue of
>.svn vs. _svn (or really any other name) as admin directory names,
>especially given the presence of other work-arounds, but it still
>continues to present a roadblock to some of us (especially those who
>have to deal with contractors and developers while also maintaining a
>decent automated build environment).
>
>So while running my usual recompile to create modified executables
>that support "_svn", I decided to try something different. I am
>aiming for something that doesn't change the way the vast majority of
>SVN users work, but allows the poor fellow who really needs "_svn" to
>continue to work.
>
>Instead of changing svn_wc.h with the usual:
>
>#define SVN_WC_ADM_DIR_NAME ".svn"
>
>I decided to fetch the dirname from the environment:
>
>#define SVN_WC_ADM_DIR_NAME ( ( getenv( "SVN_ADM_DIR") ) ? ( getenv(
>"SVN_ADM_DIR") ) : (".svn") )
>
>This works just fine for anyone who hasn't set the environment
>variable, but allows the rest of us to change it without recompiling.
>I'm sure some other devs can come up with better suggestions, but--how
>about it?
>
>
I've finally figured out why this solution won't fly, and incidentally,
why patched Subversion binaries are evil. The reason lies in the comment
above that #define, which saith thusly:

/** Administrative subdir.
 *
 * Ideally, this would be completely private to wc internals (in fact,
 * it used to be that adm_subdir() in adm_files.c was the only function
 * who knew the adm subdir's name). However, import wants to protect
 * against importing administrative subdirs, so now the name is a
 * matter of public record.
 */

So: the only reason SVN_WC_ADM_DIR_NAME is public is because "svn
import" wants to avoid importing anything that's called ".svn". If we
change this definition, then suddenly "svn import" (and probably add,
and others) _could_ end up importing the ".svn" dir.

All of which convinced me that we should deprecate SVN_WC_ADM_DIR_NAME,
and replace all its uses outside libsvn_wc (which, not surprisingly, are
all string compares against this constant) with calls to a new function
in libsvn_wc, e.g., svn_wc_is_adm_dir(const char*).

Then we can deal with using different admin dir names privately inside
libsvn_wc, where such decisions belong.

-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jul 12 00:06:56 2005

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.