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

Added repositories get lost after restarting eclipse

From: Jörg Eichhorn <eichhorn_at_ponton-consulting.de>
Date: 2005-02-03 12:49:09 CET

Hello,

we have several repositories which url starts with the url of another
repository. Like:

https://server/repos
https://server/repos1
https://server/repos2
...

When restarting eclipse only the first repository is shown in the 'SVN
Repository' view.

When loading the .svnProviderState file, all repositories are read, but
only the first one will be added as a new repository. The reason for
this is located in the method getRepository(String location) in the
class org.tigris.subversion.subclipse.core.repo.SVNRepositories.

The check [if(location.indexOf(url)!=-1)] results to true when the
second repository is loaded -> the instance of the first
SVNRepositoryLocation will be returned.
The only case i can think of why the existing instance should be
returned is when the url of the existing repository equals the url of
the given repository.

I think it would make sense to change the method to:
public ISVNRepositoryLocation getRepository(String location) throws
SVNException {

   if (repositories.containsKey(location))
   {
     return (ISVNRepositoryLocation) repositories.get(location);
   }//else we couldn't find it, fall through to adding new repo.
   ISVNRepositoryLocation repository =
SVNRepositoryLocation.fromString(location);
   addToRepositoriesCache(repository);

   return repository;
}

Cheers,
Jörg.
Received on Thu Feb 3 22:49:09 2005

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

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