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

Re: [Subclipse-dev] Mylar repository configuration for Subclipse projects

From: Mark Phippard <markphip_at_gmail.com>
Date: 2007-05-25 17:31:56 CEST

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().trim(),
> 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.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subclipse.tigris.org
For additional commands, e-mail: dev-help@subclipse.tigris.org
Received on Fri May 25 17:32:06 2007

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