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

RE: Re: Visual Studio.Net and Subversion - Will this make it into a release?

From: Leeuw van der, Tim <tim.leeuwvander_at_nl.unisys.com>
Date: 2004-03-08 15:29:21 CET

Hi,

Not that I have any code to contribute to solving the problem, but using a method-private static variable leaves you without any 'outside' control over the cached value. There's no way to invalidate the cached value, or to provide a non-default value *other* that by setting an environment variable (command-line parameter, stored preference). For long-running programs, there's no way to pick up changes to the environment variable.

I can't think of any non-ugly 'instant solution'; and of course this is just the first step -- nothing stopping anyone from adding more proper interfaces later. I do realize that for those who need some control, this is already miles better than 'only at compile time'! Better to make many small steps into the right direction then to get there in 1 big step. Just wanted to point out some limitations of this method.

-----Original Message-----
From: Ulrich Eckhardt [mailto:eckhardt@satorlaser.com]
Sent: maandag 8 maart 2004 15:04
To: users@subversion.tigris.org
Subject: Re: Visual Studio.Net and Subversion - Will this make it into a
release?

Garrett Rooney wrote:
> If it becomes a priority to someone, and
> they produce a patch that solves the problem in a way that the
> developers think is reasonable, I don't see why it wouldn't be
> committed, but so far that hasn't happened.

--- beware, untested code ahead ---

// svn_wc.h
#define SVN_WC_ADM_DIR_NAME svn_wc_adm_subdir()
char const* svn_wc_adm_subdir();

// adm_files.c
char const* svn_wc_adm_subdir()
{
  // default admin dir
  char const* dotsvn = ".svn";

  // cache value in a static to prevent multiple calls to getenv()
  static char const* adm_subdir = 0;
  if(!adm_subdir)
  {
    // check environment for an override of the admindir
    char const* env = getenv("SVN_WC_ADM_DIR_NAME");
    adm_subdir = env?env:dotsvn;
  }

  assert(adm_subdir);
  return adm_subdir;
}

Uli

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Mar 8 15:30:22 2004

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.