Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[buckminster-dev] Making Buckminster understand SVN branching

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.

Back to the top