[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: Eugene Kuleshov <eu_at_md.pp.ru>
Date: 2007-05-25 19:41:10 CEST

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().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
Received on Fri May 25 19:41:29 2007

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.