Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 98771

Summary: (PatchAttached)[Decorations] Add variable for CVS repository label to CVS text decorations.
Product: [Eclipse Project] Platform Reporter: Eugene Kuleshov <ekuleshov>
Component: CVSAssignee: platform-cvs-inbox <platform-cvs-inbox>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 Keywords: helpwanted
Version: 3.1   
Target Milestone: 3.2 M1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
Patch implementing this functionality none

Description Eugene Kuleshov CLA 2005-06-07 14:06:16 EDT
There is a property in CVS repositort configuration where you can specify a
short name for CVS repository and it will be shown in CVS Repositories View
instead of default one.

Please add a new variable to CVS text label decorations that will allow to use
the same label value as confugured in the repository properties. In many cases
it will be better then using host name combinted with repository path, because
it could be made much shorter and better fit in the Navigator and Package
Explorer views.
Comment 1 Michael Valenta CLA 2005-06-07 14:17:55 EDT
Good idea.
Comment 2 Eugene Kuleshov CLA 2005-06-07 15:00:45 EDT
(In reply to comment #1)
> Good idea.

Michael, can you give me some hints to classes API, so maybe I can put a patch
together to make it to 3.1. Does it sound realistic?

Comment 3 Michael Valenta CLA 2005-06-07 15:50:16 EDT
3.1 ships in a few weeks so there is absolutly no hope of this making it into 
3.1. On the plus side, if you provide a patch it will be one of the first for 
3.2 and it will give people incentive to start using 3.2;-).

The classes you want to look at are CVSDecoratorConfiguration and 
CVSDecoratorPreferencesPage.
Comment 4 Eugene Kuleshov CLA 2005-06-07 16:23:06 EDT
(In reply to comment #3)
> 3.1 ships in a few weeks so there is absolutly no hope of this making it into 
> 3.1. On the plus side, if you provide a patch it will be one of the first for 
> 3.2 and it will give people incentive to start using 3.2;-).
> 
> The classes you want to look at are CVSDecoratorConfiguration and 
> CVSDecoratorPreferencesPage.

Thanks Michael. I'll take a look.
Comment 5 Eugene Kuleshov CLA 2005-06-09 00:29:37 EDT
Created attachment 22666 [details]
Patch implementing this functionality
Comment 6 Michael Valenta CLA 2005-06-09 09:01:53 EDT
Thanks, I'll have a look once 3.1. is out the door.
Comment 7 Eugene Kuleshov CLA 2005-06-09 10:36:46 EDT
(In reply to comment #6)
> Thanks, I'll have a look once 3.1. is out the door.

Heh. Patch was so simple to implement, that I thought it had a chance for 3.1...
Comment 8 Michael Valenta CLA 2005-06-09 10:51:24 EDT
Sorry, only critical defects are considered at this point.
Comment 9 Michael Valenta CLA 2005-06-30 15:40:49 EDT
I have released the patch. However, I found one flaw. If the label of a 
repository is changed, the label decoration for the project is not updated (in 
case you're looking for something else to do;-)
Comment 10 Eugene Kuleshov CLA 2005-06-30 16:12:16 EDT
I already noticed that when I was porting this patch for Subclipse and for some
reason I thought that it is not an issue in CVS plugin. Anyway, I'd appreciate
any suggestions/pointers where to look for this.

By the way, it would be a good idea to see default label somewhere. Now if you
are using custom label, the default one is gone. I probably should open an
issue/submit separate patch for this.
Comment 11 Michael Valenta CLA 2005-06-30 16:56:51 EDT
The whole idea behind having the label was so the user wouldn't need to see 
the long location string. You can still get all the information from the 
properties box.

As for the update, the problem is that there is no change event that triggers 
a redecoration. The simpliest thing is to add the follwoign code to the label 
change:

CVSUIPlugin.broadcastPropertyChange(new PropertyChangeEvent(this, 
CVSUIPlugin.P_DECORATORS_CHANGED, null, null));

It's not ideal though as all the decorators will be refreshed. ANother options 
would be to touch all the projects that are mapped to that repository 
(IProject#touch).
Comment 12 Eugene Kuleshov CLA 2005-06-30 17:15:37 EDT
(In reply to comment #11)
> The whole idea behind having the label was so the user wouldn't need to see 
> the long location string. You can still get all the information from the 
> properties box.

Right, but from time to time users may need to copy all repository parameters
(basically cvs url) and default label is a good way of doing this.

> As for the update, the problem is that there is no change event that triggers 
> a redecoration. The simpliest thing is to add the follwoign code to the label 
> change:
> 
> CVSUIPlugin.broadcastPropertyChange(new PropertyChangeEvent(this, 
> CVSUIPlugin.P_DECORATORS_CHANGED, null, null));
> 
> It's not ideal though as all the decorators will be refreshed. ANother options 
> would be to touch all the projects that are mapped to that repository 
> (IProject#touch).

I can look at the touch option. I guess just iterate trough projects, somehow
find sharing info and decide if it needs touch. From other hand label change not
expected to be very often action, so maybe broadcast is not as bad...
Comment 13 Bogdan Gheorghe CLA 2005-08-09 13:37:24 EDT
Verified in I20050808-2000.