[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [buckminster-dev] Making Buckminster understand SVN branching
|
Hi Mikhail,
You need to use the URI properties moduleBeforeBranch/moduleAfterBranch.
Consider this URI declaration:
<uri
format="svn://localhost/repo/{0}/trunk/{0}?moduleAfterTag&moduleAfterBranch">
<bc:propertyRef key="buckminster.component"/>
</uri>
Buckminster will treat everything after 'trunk' in the URI as the module
name so it will map your component name to it's notion of the module
name. When searching branches it will expand the above URI to:
svn://localhost/repo/{0}/branches/<your branch>/{0}
The branches should not be visible in your rmap. Instead, you use an
advisory node in the CQUERY that has a branch/tag path. This is a
comma-separated path of tokens. A token starting with a '/' is a tag and
all other tokens are branches.
There's a special token 'main' that translates to the trunk so if you
want Buckminster to search your R1.0.x branch first and then, if it
doesn't find the component there, continue with trunk, you can use a
branch/tag path like 'R1.0.x,main'
Regards,
Thomas Hallgren
Mikhail Kadan wrote:
Hi.
Let me describe the situation I have.
1) I've installed SVN repo on svn://localhost/repo/
2) In repository I've created such structure:
-- plA
-- branches
-- tags
-- trunk (here will be my plugin plA code)
-- plB
-- branches
-- tags
-- trunk (here will be my plugin plB code)
3) Then I create plugins in Eclipse and commit them to repository. I
also set that plB depends on plA with version range [1,0,0; 2,0,0]
(default versions for plugins on creation are 1.0.0)
4) I create RMAP:
<?xml version="1.0" encoding="UTF-8"?>
<rmap
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.eclipse.org/buckminster/RMap-1.0"
xmlns:bc="http://www.eclipse.org/buckminster/Common-1.0"
xmlns:mp="http://www.eclipse.org/buckminster/MavenProvider-1.0"
xmlns:pp="http://www.eclipse.org/buckminster/PDEMapProvider-1.0">
<searchPath name="default">
<provider readerType="svn"
componentTypes="eclipse.feature,osgi.bundle,buckminster">
<uri format="svn://localhost/repo/{0}/trunk/">
<bc:propertyRef key="buckminster.component" />
</uri>
</provider>
</searchPath>
<locator searchPathRef="default" pattern="^.*" />
</rmap>
5) I create CQUERY:
<?xml version="1.0" encoding="UTF-8"?>
<cq:componentQuery
xmlns:cq="http://www.eclipse.org/buckminster/CQuery-1.0"
resourceMap="<PATH TO MY RMAP>">
<cq:rootRequest name="plB" componentType="osgi.bundle"/>
</cq:componentQuery>
6) When I execute this query, everything is OK, I get plA and plB in my
workspace.
7) I decide to make some major changes in plA, so I follow Eclipse
versioning conceptions:
a) I create new branch under svn://localhost/repo/plA/branches/ with
name "R1.0.x"
b) Copy all plA trunk to this new branch
c) Change plA in trunk and modify it's version to 2.0.0
So the situations for now - I have two working copies of plA, one is
R1.0.x branch, other is trunk. Branch is 1.0.0 version, trunk is 2.0.0
version.
===== And now the problem occurs! =====
When i try to execute my CQUERY, I have an error (it's dumb SAX parser
error, but I understand it is because of not all dependencies can be
resolved - by the way, can anybody fix this issue to show READABLE
error-string? :) ). I understand the case of this error - my bundle plB
requieres plA of versions [1.0.0, 2.0.0), but only available plA in
trunk is 2.0.0 version, which is not acceptable. So I understand, that
Buckminster cannot automatically search branches to seek for appropriate
version?
I have found two workarounds for this issue:
1) I can create advisor node in my CQUERY named "plA" and set it's
"Selection Criteria -> Branch/Tag path" to "R1.0.x". This will make
Buckminster look for plA component only in this branch. This will fix
the issue, but I think is not proper solution for the problem.
2) I can add additional provider to my RMAP for each branch I want
Buckminster to include in component search:
<provider readerType="svn"
componentTypes="eclipse.feature,osgi.bundle,buckminster">
<uri format="svn://localhost/repo/{0}/branches/R1.0.x/">
<bc:propertyRef key="buckminster.component" />
</uri>
</provider>
This works fine, and I think this is even logically fine (I tell
Buckminster what branches to search, and what to ignore), but it
requires some handwork to put this provider in RMAP after each release
of plugin (assuming release involves creating branch). This also has a
problem: let's assume I've added this provider to RMAP, knowing that plA
has branch "R1.0.x". But this provider will also work for all other
components, trying to look at their's branch "R1.0.x", which can even
not exist. Of course I can fix this by replacing "{0}" in URI with "plA"
but... isn't it the same as listing all available pairs
component/branch in provider? Which I think is not a very good practice.
So I wanted to know, is there any naming convention for branches to make
Buckminster automatically search components inside them without
handwriting them in RMAP?
Thanks.