|
List Info
Thread: Mylar repository configuration for Subclipse projects
|
|
| Mylar repository configuration for
Subclipse projects |

|
2007-05-24 20:00:32 |
Mark,
I noticed you've added Mylar repository configuration to
all Subclipse
projects and your configuration is using property-based
repository link
provider (the default one in Mylar).
However we have repository link provider in Subclipse
module for Mylar
that is using svn's own properties (bugtraq:url etc) to
discover those
links. Unfortunately there is a limitation. Current
implementation of
SubclipseTaskRepositoryLinkProvider don't work too well for
properties
that are defined above project folder, so existing
bugtraq:url property
for Subclipse project isn't picked up.
I've tried to fix that by falling to remote properties if
local
properties can't be retrieved. See updated code below. It
works, but as
you would expect it is extremely slow to go trough all
parent folders.
So, I wonder if there is a better way to collect
properties from all
parent folders, or at least somehow cache them locally?
regards,
Eugene
public class SubclipseTaskRepositoryLinkProvider extends
AbstractTaskRepositoryLinkProvider {
public TaskRepository getTaskRepository(IResource
resource,
TaskRepositoryManager repositoryManager) {
try {
ProjectProperties props =
ProjectProperties.getProjectProperties(resource);
if(props!=null && props.getUrl()!=null) {
return
SubclipseTeamPlugin.getRepository(props.getUrl(),
repositoryManager);
}
// TODO need to cache or somehow speedup this
ISVNLocalResource svnResource =
SVNWorkspaceRoot.getSVNResourceFor(resource);
ISVNClientAdapter svnClient =
SVNProviderPlugin.getPlugin().createSVNClient();
SVNUrl svnUrl = svnResource.getUrl();
while(svnUrl!=null) {
ISVNProperty[] properties =
svnClient.getProperties(svnUrl);
ISVNProperty urlProperty = getProperty(properties,
"bugtraq:url");
if(urlProperty!=null &&
urlProperty.getValue()!=null &&
urlProperty.getValue().trim().length()>0) {
return
SubclipseTeamPlugin.getRepository(urlProperty.getValue().tri
m(),
repositoryManager);
}
svnUrl = svnUrl.getParent();
}
} catch (SVNException ex) {
// ignore
} catch (SVNClientException ex) {
// ignore
}
return null;
}
private ISVNProperty getProperty(ISVNProperty[]
properties, String name) {
for (int i = 0; i < properties.length; i++) {
ISVNProperty property = properties[i];
if(name.equals(property.getName())) {
return property;
}
}
return null;
}
}
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe subclipse.tigris.org
For additional commands, e-mail: dev-help subclipse.tigris.org
|
|
| Re: Mylar repository configuration for
Subclipse projects |

|
2007-05-25 10:31:56 |
The "policy" for this feature as defined by
TortoiseSVN and Subclipse
was essentially that it is up to the user to make sure the
properties
are available locally. I'd suggest you assume the
properties do not
exist if you navigate up to the checked out project folder
and have
still not found them.
I'd like to see us consider dropping these properties in our
own
projects once the IZ Mylar connector is released. I played
around
with that idea, and it seemed to work OK except I noticed
that issues
in log messages are not hyperlinked. Is this because the IZ
connector
does not support that yet?
Mark
On 5/24/07, Eugene Kuleshov <eu md.pp.ru> wrote:
> Mark,
>
> I noticed you've added Mylar repository configuration
to all Subclipse
> projects and your configuration is using property-based
repository link
> provider (the default one in Mylar).
>
> However we have repository link provider in Subclipse
module for Mylar
> that is using svn's own properties (bugtraq:url etc) to
discover those
> links. Unfortunately there is a limitation. Current
implementation of
> SubclipseTaskRepositoryLinkProvider don't work too well
for properties
> that are defined above project folder, so existing
bugtraq:url property
> for Subclipse project isn't picked up.
>
> I've tried to fix that by falling to remote
properties if local
> properties can't be retrieved. See updated code below.
It works, but as
> you would expect it is extremely slow to go trough all
parent folders.
>
> So, I wonder if there is a better way to collect
properties from all
> parent folders, or at least somehow cache them
locally?
>
> regards,
> Eugene
>
>
> public class SubclipseTaskRepositoryLinkProvider
extends
> AbstractTaskRepositoryLinkProvider {
>
> public TaskRepository getTaskRepository(IResource
resource,
> TaskRepositoryManager repositoryManager) {
> try {
> ProjectProperties props =
> ProjectProperties.getProjectProperties(resource);
> if(props!=null && props.getUrl()!=null)
{
> return
SubclipseTeamPlugin.getRepository(props.getUrl(),
> repositoryManager);
> }
>
> // TODO need to cache or somehow speedup this
>
> ISVNLocalResource svnResource =
> SVNWorkspaceRoot.getSVNResourceFor(resource);
> ISVNClientAdapter svnClient =
> SVNProviderPlugin.getPlugin().createSVNClient();
>
> SVNUrl svnUrl = svnResource.getUrl();
> while(svnUrl!=null) {
> ISVNProperty[] properties =
svnClient.getProperties(svnUrl);
> ISVNProperty urlProperty =
getProperty(properties, "bugtraq:url");
> if(urlProperty!=null &&
urlProperty.getValue()!=null &&
> urlProperty.getValue().trim().length()>0) {
> return
>
SubclipseTeamPlugin.getRepository(urlProperty.getValue().tri
m(),
> repositoryManager);
> }
>
> svnUrl = svnUrl.getParent();
> }
>
> } catch (SVNException ex) {
> // ignore
> } catch (SVNClientException ex) {
> // ignore
> }
> return null;
> }
>
> private ISVNProperty getProperty(ISVNProperty[]
properties, String name) {
> for (int i = 0; i < properties.length; i++) {
> ISVNProperty property = properties[i];
> if(name.equals(property.getName())) {
> return property;
> }
> }
> return null;
> }
>
> }
>
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: dev-unsubscribe subclipse.tigris.org
> For additional commands, e-mail: dev-help subclipse.tigris.org
>
>
--
Thanks
Mark Phippard
http://markphip.blogspo
t.com/
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe subclipse.tigris.org
For additional commands, e-mail: dev-help subclipse.tigris.org
|
|
| Re: Mylar repository configuration for
Subclipse projects |

|
2007-05-25 12:41:10 |
Mark Phippard wrote:
> The "policy" for this feature as defined by
TortoiseSVN and Subclipse
> was essentially that it is up to the user to make sure
the properties
> are available locally. I'd suggest you assume the
properties do not
> exist if you navigate up to the checked out project
folder and have
> still not found them.
Hmm. For some reason I thought that Subclipse does pickup
bugtraq
properties from above the checked out project in commit
dialog and
history view and for Subclipse those properties are declared
at the top
of the repository.
> I'd like to see us consider dropping these properties
in our own
> projects once the IZ Mylar connector is released. I
played around
> with that idea, and it seemed to work OK except I
noticed that issues
> in log messages are not hyperlinked. Is this because
the IZ connector
> does not support that yet?
There are several factors. First of all IZ connector don't
have bug
hyperlink detector (yet), it has to be Eclipse 3.3 (that
introduced
hyperlink support) and may also require Mylar 2.0M3 (there
was some
fixes for matching projects with SVN resources).
Another reason to keep bugtraq properties
is that they would allow
to match repository for non-local resources, for example
when History
view is opened for something from the Repositories view. I
wonder if svn
client could provide a faster one call API to get properties
from up to
the root of the repository.
regards,
Eugene
> On 5/24/07, Eugene Kuleshov <eu md.pp.ru> wrote:
>> Mark,
>>
>> I noticed you've added Mylar repository
configuration to all Subclipse
>> projects and your configuration is using
property-based repository link
>> provider (the default one in Mylar).
>>
>> However we have repository link provider in
Subclipse module for Mylar
>> that is using svn's own properties (bugtraq:url
etc) to discover those
>> links. Unfortunately there is a limitation. Current
implementation of
>> SubclipseTaskRepositoryLinkProvider don't work too
well for properties
>> that are defined above project folder, so existing
bugtraq:url property
>> for Subclipse project isn't picked up.
>>
>> I've tried to fix that by falling to remote
properties if local
>> properties can't be retrieved. See updated code
below. It works, but as
>> you would expect it is extremely slow to go trough
all parent folders.
>>
>> So, I wonder if there is a better way to collect
properties from all
>> parent folders, or at least somehow cache them
locally?
>>
>> regards,
>> Eugene
>>
>>
>> public class SubclipseTaskRepositoryLinkProvider
extends
>> AbstractTaskRepositoryLinkProvider {
>>
>> public TaskRepository getTaskRepository(IResource
resource,
>> TaskRepositoryManager repositoryManager) {
>> try {
>> ProjectProperties props =
>> ProjectProperties.getProjectProperties(resource);
>> if(props!=null &&
props.getUrl()!=null) {
>> return
SubclipseTeamPlugin.getRepository(props.getUrl(),
>> repositoryManager);
>> }
>>
>> // TODO need to cache or somehow speedup
this
>>
>> ISVNLocalResource svnResource =
>> SVNWorkspaceRoot.getSVNResourceFor(resource);
>> ISVNClientAdapter svnClient =
>> SVNProviderPlugin.getPlugin().createSVNClient();
>>
>> SVNUrl svnUrl = svnResource.getUrl();
>> while(svnUrl!=null) {
>> ISVNProperty[] properties =
svnClient.getProperties(svnUrl);
>> ISVNProperty urlProperty =
getProperty(properties,
>> "bugtraq:url");
>> if(urlProperty!=null &&
urlProperty.getValue()!=null &&
>> urlProperty.getValue().trim().length()>0) {
>> return
>>
SubclipseTeamPlugin.getRepository(urlProperty.getValue().tri
m(),
>> repositoryManager);
>> }
>>
>> svnUrl = svnUrl.getParent();
>> }
>>
>> } catch (SVNException ex) {
>> // ignore
>> } catch (SVNClientException ex) {
>> // ignore
>> }
>> return null;
>> }
>>
>> private ISVNProperty getProperty(ISVNProperty[]
properties, String
>> name) {
>> for (int i = 0; i < properties.length; i++)
{
>> ISVNProperty property = properties[i];
>> if(name.equals(property.getName())) {
>> return property;
>> }
>> }
>> return null;
>> }
>>
>> }
>>
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe subclipse.tigris.org
For additional commands, e-mail: dev-help subclipse.tigris.org
|
|
| Re: Mylar repository configuration for
Subclipse projects |

|
2007-05-25 12:47:59 |
On 5/25/07, Eugene Kuleshov <eu md.pp.ru> wrote:
> Mark Phippard wrote:
> > The "policy" for this feature as defined
by TortoiseSVN and Subclipse
> > was essentially that it is up to the user to make
sure the properties
> > are available locally. I'd suggest you assume the
properties do not
> > exist if you navigate up to the checked out
project folder and have
> > still not found them.
> Hmm. For some reason I thought that Subclipse does
pickup bugtraq
> properties from above the checked out project in commit
dialog and
> history view and for Subclipse those properties are
declared at the top
> of the repository.
We have a preference to do it for the history view when
browsing
remote history. We never do it on anything local
(history/commit).
TortoiseSVN only offers it for local.
> > I'd like to see us consider dropping these
properties in our own
> > projects once the IZ Mylar connector is released.
I played around
> > with that idea, and it seemed to work OK except I
noticed that issues
> > in log messages are not hyperlinked. Is this
because the IZ connector
> > does not support that yet?
> There are several factors. First of all IZ connector
don't have bug
> hyperlink detector (yet), it has to be Eclipse 3.3
(that introduced
> hyperlink support) and may also require Mylar 2.0M3
(there was some
> fixes for matching projects with SVN resources).
>
> Another reason to keep bugtraq properties
is that they would allow
> to match repository for non-local resources, for
example when History
> view is opened for something from the Repositories
view. I wonder if svn
> client could provide a faster one call API to get
properties from up to
> the root of the repository.
There is a roadmap item to add something called
"Inherited
Properties", which would do this sort of thing. It is
a hard problem
and has not gone far. They are struggling with this issue a
bit with
the merge tracking feature because it has a need like this.
Most likely it is not a feature we will see anytime soon.
--
Thanks
Mark Phippard
http://markphip.blogspo
t.com/
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe subclipse.tigris.org
For additional commands, e-mail: dev-help subclipse.tigris.org
|
|
[1-4]
|
|