Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Subversive » How to setup a default SVN repository for a product
How to setup a default SVN repository for a product [message #36023] Sat, 18 October 2008 11:15 Go to next message
Kaloyan Raev is currently offline Kaloyan RaevFriend
Messages: 189
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
I am building an Eclipse product. For this product it is important to have
a certain SVN repository - let's say http://svn.example.com - already
preset in the workspace. This way the developers, that are targeted by
this product, would not need to create it by their own.

Is there a way - extension point, API or preference - the enables me to
preset a repository in a workspace?
Re: How to setup a default SVN repository for a product [message #36158 is a reply to message #36023] Mon, 20 October 2008 08:34 Go to previous messageGo to next message
Alexei Goncharov is currently offline Alexei GoncharovFriend
Messages: 35
Registered: July 2009
Member
Kaloyan Raev wrote:

> I am building an Eclipse product. For this product it is important to have
> a certain SVN repository - let's say http://svn.example.com - already
> preset in the workspace. This way the developers, that are targeted by
> this product, would not need to create it by their own.

> Is there a way - extension point, API or preference - the enables me to
> preset a repository in a workspace?

Hello, Kaloyan.
As far as I can understand, you want to share the repo with all your team
mates, am I right?

Here is the way to reach the target:
Export repository to the *.epf file so that each your team mate can import
it afterwards. To do so, click "File->Export" than choose
"General->Preferences", press "Next", choose "Choose specific preferences
to export", check "SVN Repositories" and select a path to export the
repositories to. Than each person from your team can import it from the
saved file (using "File->Import" and then the consecution is the same).

Best regards, Alexei Goncharov.
Subversive Team.
Re: How to setup a default SVN repository for a product [message #36191 is a reply to message #36158] Mon, 20 October 2008 10:08 Go to previous messageGo to next message
Kaloyan Raev is currently offline Kaloyan RaevFriend
Messages: 189
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Alexei Goncharov wrote:

> Kaloyan Raev wrote:

>> I am building an Eclipse product. For this product it is important to have
>> a certain SVN repository - let's say http://svn.example.com - already
>> preset in the workspace. This way the developers, that are targeted by
>> this product, would not need to create it by their own.

>> Is there a way - extension point, API or preference - the enables me to
>> preset a repository in a workspace?

> Hello, Kaloyan.
> As far as I can understand, you want to share the repo with all your team
> mates, am I right?

> Here is the way to reach the target:
> Export repository to the *.epf file so that each your team mate can import
> it afterwards. To do so, click "File->Export" than choose
> "General->Preferences", press "Next", choose "Choose specific preferences
> to export", check "SVN Repositories" and select a path to export the
> repositories to. Than each person from your team can import it from the
> saved file (using "File->Import" and then the consecution is the same).

> Best regards, Alexei Goncharov.
> Subversive Team.

Yes, this what I want to achieve, but even one step further.

These developers have their own Eclipse-based IDE and they want to skip
the step of manually importing *.epf files.

So, I am implementing a product plug-in that pre-configures the Eclipse
IDE. I succeeded with similar things like Code Formatter and Code
Templates.

The use case is:
1. User downloads and extracts the customized IDE.
2. User starts the customized IDE. The SVN repo is already configured
for him.

How to achieve this without manual steps?
Re: How to setup a default SVN repository for a product [message #36225 is a reply to message #36191] Mon, 20 October 2008 13:13 Go to previous messageGo to next message
Alexei Goncharov is currently offline Alexei GoncharovFriend
Messages: 35
Registered: July 2009
Member
Kaloyan Raev wrote:

> Yes, this what I want to achieve, but even one step further.

> These developers have their own Eclipse-based IDE and they want to skip
> the step of manually importing *.epf files.

> So, I am implementing a product plug-in that pre-configures the Eclipse
> IDE. I succeeded with similar things like Code Formatter and Code
> Templates.

> The use case is:
> 1. User downloads and extracts the customized IDE.
> 2. User starts the customized IDE. The SVN repo is already configured
> for him.

> How to achieve this without manual steps?

Correct me, if I am wrong, but as far as I know these preferences (even
code templates) are stored in workspace metadata... I really do not
understand how do you manage to apply them for your developers'
workspaces:).
Of course if you tell me how it is done, so I could understand it, I'll be
able to understand if it can be done with Subversive:).

I can tell you where the repositories info is stored, if it can help.

<workspace
path> \.metadata\.plugins\org.eclipse.core.runtime\.settings\org.e clipse.team.svn.core.prefs
All "repositories" nodes are the SVN Repositories.
They contain all the repositories' info except authentification one. The
last is stored deeply in equinox (I do not know where, really):).

So I see of course another way to do the thing you are talking about.
You can always check for presence of the repository location you want to
see in the developers workspace (by URL, maybe), and if there is no such,
add it by your code. If so, this is more a dev-list question;).

The described can be done like this (code depends on
org.eclipse.team.svn.core):
protected void checkLocationAndCreate() {
IRepositoryLocation [] locations =
SVNRemoteStorage.instance().getRepositoryLocations();
for (IRepositoryLocation location : locations) {
if (location.getUrl().equals("http://repo_url")) {
return;
}
}
IRepositoryLocation location =
SVNRemoteStorage.instance().newRepositoryLocation();
location.setUrl("http://repo_url");
location.setLabel("The text to display in repo tree");
//other setters for other properties
AddRepositoryLocationOperation mainOp = new
AddRepositoryLocationOperation(location);
CompositeOperation op = new
CompositeOperation(mainOp.getOperationName());
op.add(mainOp);
op.add(new SaveRepositoryLocationsOperation());
ProgressMonitorUtility.doTaskScheduled(op);
}

Best regards, Alexei Goncharov.
Subversive Team.
Re: How to setup a default SVN repository for a product [message #36259 is a reply to message #36225] Mon, 20 October 2008 14:55 Go to previous message
Kaloyan Raev is currently offline Kaloyan RaevFriend
Messages: 189
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Alexei Goncharov wrote:
> Correct me, if I am wrong, but as far as I know these preferences (even
> code templates) are stored in workspace metadata... I really do not
> understand how do you manage to apply them for your developers'
> workspaces:).
> Of course if you tell me how it is done, so I could understand it, I'll be
> able to understand if it can be done with Subversive:).

Yes, this is correct. I have a plugin_customization.ini file in my product
plug-in where I override default preferences. Typically this is done using
the following pattern:

<plugin_id>/<preference_id>=<preference_value>

Unfortunately, this seems to not be the way to add a default SVN
repository. I do the following (example with Subversive's SVN repository):

1. Start the self-hosted Eclipse instance in a fresh workspace.

2. Create a new repository to
https://dev.eclipse.org/svnroot/technology/org.eclipse.subve rsive

3. Now I can see what stored in
metadata.pluginsorg.eclipse.core.runtime.settingsorg.eclipse .team.svn.core.prefs
and use it in my plugin_customization.ini.

4. Add the following in plugin_customization.ini:

org.eclipse.team.svn.core/repositories/b002a269b49e001d1d7ac 25265ddcd9c=b002a269b49e001d1d7ac25265ddcd9c; https\://dev.eclipse.org/svnroot/technology/org.eclipse.subv ersive; https\://dev.eclipse.org/svnroot/technology/org.eclipse.subv ersive ;branches;tags;trunk;true;ee007c2a-0a25-0410-9ab9-bf26898092 8c; https\://dev.eclipse.org/svnroot/technology/org.eclipse.subv ersive;;false;;;22

5. Stop the self-hosted Eclipse instance and start it again in fresh
workspace.

I would expect now to see the SVN repository already configured, but this
is not the case.

It must be something wrong to what I add in my plugin_customization.ini,
but I cannot find what it is. I thought it would be that the ":" char is
escaped as "\:" in the url, but it was unescaping it did not help.
Previous Topic:Checkout data does not replace the local resources by the ones of the repository
Next Topic:move - SVN really Move
Goto Forum:
  


Current Time: Fri Dec 19 04:50:53 GMT 2014

Powered by FUDForum. Page generated in 0.02873 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software