Extension of Subversive-Plug-In [message #557924] |
Thu, 09 September 2010 08:40  |
Eclipse User |
|
|
|
Hi @ all,
I'm using the Subversive-plugIn for Eclipse to check in/out code to and from my subversion-repository.
Beside the subversive-history I have got an own historyfile on a server (System i) which I have to edit everytime I commit a java-source. To improve the usability of the plugIn I've started to implemet a data-interchange into that plugIn, using the "commit" exit point.
Therefore I had to extend some classes and manipulate them. I don't like that solution because it is very rude. And finally I stuck at the point where I can retrieve information about comitted resources.
So here are my questions:
- I use the extension-point "commit". How can I write my own (initial) text into the comment-text-box?
- After hitting the OK-button to commit my sources to the repository I need to know which java-files were commited and wheather they were added/deleted/changed/... The version of the source is important too. How can I get this information?
The methods where I want to perform some "actions" are the implemented methods getCommitDialog and performAfterCommitTasks of the interface ICommitActionFactory (inside an own new class).
I've found out that the commit-panel (the text is transfered as parameter into the commit-panels constructor) is already created when the exit is called. And therefore it's to late to write an individual text into the comment-text-box.
Are there some other exits which I can use to continue my implementation?
Thank you!
|
|
|
|
|
|
|
|
|
|
|
Re: Extension of Subversive-Plug-In [message #1705665 is a reply to message #1701017] |
Tue, 18 August 2015 05:01   |
Eclipse User |
|
|
|
Hello !
There is the ICommitActionFactory interface which provides the following method:
/**
* The method allows customizing of the Commit Operation
* @param operation prepared Commit operation
* @param revisionProvider committed revision provider
* @param dependsOn dependencies which can prevent commit operation execution in case of failure
* @param part workbench part which will be used to interact with user
*/
public void performAfterCommitTasks(CompositeOperation operation, IRevisionProvider revisionProvider,
IActionOperation[] dependsOn, IWorkbenchPart part);
So, in general case you should do the following:
1) implement your own operation and add it into the common execution context (since commit itself is asynchronous)
2) in the run method of the implemented operation you should ask IRevisionProvider for committed revisions.
3) if you need to proceed only if commit is succeeded, then please use the dependsOn parameter while adding your own operation in order to prevent its execution if commit wasn't performed either.
There is a sample method from tests you may use as a reference:
public void performAfterCommitTasks(CompositeOperation operation, final IRevisionProvider revisionProvider, IActionOperation[] dependsOn, IWorkbenchPart part) {
// very simple way to get after-commit revisions, if it's not enough then intercepting calls will do (see above)
operation.add(new AbstractActionOperation("SomeOp" /*the key for NLS message from the second parameter*/, SVNMessages.class /* I don't like this parameter very much, so I'll think of what to do with it later on*/) {
protected void runImpl(IProgressMonitor monitor) throws Exception {
// process post commit revisions here....
revisionProvider.getRevisions();
}
}, dependsOn);
}
Please feel free to ask if there is still questions you want to clarify.
P.S.
I have a complete test project, so I'll just share it here (that is where the method implementation sample comes from).
Best regards,
Alexander Gurov,
Subversive Team.
[Updated on: Tue, 18 August 2015 05:04] by Moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03931 seconds