|
|
|
|
|
|
|
|
|
Re: Extension of Subversive-Plug-In [message #1705665 is a reply to message #1701017] |
Tue, 18 August 2015 09:01 |
Alexander Gurov Messages: 148 Registered: July 2009 |
Senior Member |
|
|
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 09:04] Report message to a moderator
|
|
|
Re: Extension of Subversive-Plug-In [message #1736108 is a reply to message #1705665] |
Sun, 26 June 2016 10:00 |
Alex Lars Messages: 1 Registered: June 2016 |
Junior Member |
|
|
Dear Alexander Gurov,
I read source from your complete test project but still not clear all about process flow of this project. I have a small requirement such as below:
1/ User will commit source.
2/ Plugin will check in time that user can commit or not. It depends on system time, if not right time as expectation then will warning to user and stop commit. Otherwise do commit normally.
So after read your project source code i still could not get the logic. Any advise for me in this case, the best is explain for me the logic so I can archive my goal. An example is perfect if you can.
Thanks and best regards,
Lars.
[Updated on: Sat, 02 July 2016 20:09] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.04759 seconds