Extending the VCS commit dialog

I would like to add a few options to the SVN and possibly other VCS commit dialog box. How would I add a few fields to the already existing svn commit directory dialog box for post commit execution?

18 comments
Comment actions Permalink

You should extend com.intellij.openapi.vcs.checkin.VcsCheckinHandlerFactory,
and put corresponding <extensionPoint> into plugin.xml.

Please have a look at, for instance, git plugin implementation

0
Comment actions Permalink

Hi, i want to do the same right now and started to look through the git4idea src, but i realy dont get it what it is doing.
Can you please give me some advice where to start?

0
Comment actions Permalink

Hello,

You can do the following:

  1. Configure IJ project;
  2. Run IJ under IJ;
  3. Configure git for a project open at IJ under IJ;
  4. Set a breakpoint at CheckinHandlersManagerImpl.getMatchingVcsFactories();
  5. Commit a file at the project open at IJ under IJ;
  6. The breakpoint is expected to be hit and you can debug further processing.

Denis

0
Comment actions Permalink

Thank you, but i want to create a Plugin that ships all necessary files, i dont want to override the API, is there any other possible solution?

0
Comment actions Permalink

Of course. git4idea is an example of such a plugin and it's completely open source.

Denis

0
Comment actions Permalink

Thanks, for your help.
But lets say i would add another button to the existing "Commit Changes" Frame from my Plugin. How should i do that? Is it even possible?

0
Comment actions Permalink

Am I right understanding that you're asking about ability to customize an existing plugin's (git4idea) commit message rather than specifying commit message for your custom vcs plugin?

Denis

0
Comment actions Permalink

Hi, yes i want to costumize the build in svn commit dialog.

0
Comment actions Permalink

Forwarded the question to our svn guy.

Denis

0
Comment actions Permalink

Hi, just a gentle remind that i'm still  developing.
I'm now able to modify the Commit Changes dialog by editing the platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java.
I also wanted some changes i the Set Property Dialog and edited the plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/SetPropertyDialog.java
My next question is, how can i deploy a plugin.


I tried the following to 'deploy' it:
1. I created a new Plugin Module and copied all contents of the idea4svn module to it.
    Complilation works fine, but then i try to run the Plugin Module it crashes:


[   3137]  ERROR - com.intellij.ide.IdeEventQueue - Error during dispatching of java.awt.event.InvocationEvent[INVOCATION_DEFAULT,runnable=com.intellij.idea.MainImpl$2@1c110d4,notifier=null,catchExceptions=false,when=1363175406817] on sun.awt.X11.XToolkit@38048a
java.lang.ArrayStoreException
 at java.lang.System.arraycopy(Native Method)
 at java.util.ArrayList.toArray(ArrayList.java:361)
 at com.intellij.openapi.extensions.impl.ExtensionPointImpl.getExtensions(ExtensionPointImpl.java:177)
 at com.intellij.openapi.application.impl.ApplicationImpl.loadComponentRoamingTypes(ApplicationImpl.java:580)
 at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:550)
 at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:199)
 at com.intellij.idea.MainImpl$2.run(MainImpl.java:97)
 at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
 at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:727)
 at java.awt.EventQueue.access$200(EventQueue.java:103)
 at java.awt.EventQueue$3.run(EventQueue.java:688)
 at java.awt.EventQueue$3.run(EventQueue.java:686)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
 at java.awt.EventQueue.dispatchEvent(EventQueue.java:697)
 at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:673)
 at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:498)
 at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:333)
 at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
 at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
 at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
[   3161]  ERROR - com.intellij.ide.IdeEventQueue - IntelliJ IDEA 12.0.4  Build #IC-123.169
[   3161]  ERROR - com.intellij.ide.IdeEventQueue - JDK: 1.7.0_15
[   3161]  ERROR - com.intellij.ide.IdeEventQueue - VM: Java HotSpot(TM) Server VM
[   3161]  ERROR - com.intellij.ide.IdeEventQueue - Vendor: Oracle Corporation
[   3161]  ERROR - com.intellij.ide.IdeEventQueue - OS: Linux


2.  I am building the IDEA IDE CE and moving all ingredients from lib/svn4idea to my PyCharm lib/sv4idea.
     But it crashes to with some error caused by none existing functions.

3. Because compilation and deploying just worked fine i tried to just copy the svn4idea.jar from the deployed plugin to my PyCharm lib/svn4idea, but this isn't working either:

     [   1323]  ERROR - com.intellij.ide.IdeEventQueue - Error during dispatching of java.awt.event.InvocationEvent[INVOCATION_DEFAULT,runnable=com.intellij.idea.MainImpl$3@7ffe9999,notifier=null,catchExceptions=false,when=1363093279555] on sun.awt.X11.XToolkit@24164d75
       java.lang.AssertionError: Expected: class com.intellij.openapi.components.impl.stores.RoamingTypeExtensionPointBean; Actual: class com.intellij.openapi.components.impl.stores.RoamingTypeExtensionPointBean
       at com.intellij.openapi.extensions.impl.ExtensionPointImpl.assertClass(ExtensionPointImpl.java:393)
       at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapters(ExtensionPointImpl.java:231)
       at com.intellij.openapi.extensions.impl.ExtensionPointImpl.getExtensions(ExtensionPointImpl.java:174)
       at com.intellij.openapi.application.impl.ApplicationImpl.e(ApplicationImpl.java:577)
       at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:547)
       at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:199)
       at com.intellij.idea.MainImpl$3.run(MainImpl.java:160)
       at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:226)
       at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:673)
       at java.awt.EventQueue.access$300(EventQueue.java:96)
       at java.awt.EventQueue$2.run(EventQueue.java:634)
       at java.awt.EventQueue$2.run(EventQueue.java:632)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
       at java.awt.EventQueue.dispatchEvent(EventQueue.java:643)
       at com.intellij.ide.IdeEventQueue.d(IdeEventQueue.java:685)
       at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:510)
       at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:333)
       at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
       at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
       at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
       at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
       at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
       at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
       [   1324]  ERROR - com.intellij.ide.IdeEventQueue - PyCharm 2.7.1  Build #PY-125.92
       [   1324]  ERROR - com.intellij.ide.IdeEventQueue - JDK: 1.6.0_27
       [   1324]  ERROR - com.intellij.ide.IdeEventQueue - VM: OpenJDK 64-Bit Server VM
       [   1324]  ERROR - com.intellij.ide.IdeEventQueue - Vendor: Sun Microsystems Inc.
       [   1324]  ERROR - com.intellij.ide.IdeEventQueue - OS: Linux

4.  This works, but it makes my life realy hard.
     I am building the IDEA IDE CE and just move the *class files which i have edited previously.
     I extract the pycharm.jar and the idea.jar moving the class files and compress it back to a jar and the same with the svn4idea.jar

My only question at the moment for you guys is:
How can i create a Plugin out of this svn4idea module?

Kind Regards syt

0
Comment actions Permalink

Hi syt,

Could you please clarify, what actually do you want to achieve at the end?

As I understood, you want to add some feature to the Subversion integration functionality. Suppose, you have implemented the feature by hacking in the IntelliJ-community repository.

What do you want next? Do you want this feature just for yourself, or you want it as a separate plugin available to all users, or you want this feature to be integrated into IntelliJ community repository?
There are different strategies depending on your intentions.

0
Comment actions Permalink

Hi thx for your quick response,
i want to add some functionality to your svn plugin for better integration with our TFS.
But i dont know how to deploy it.
I want to override the existing bundled plugin or create a new one called svn4idea+tfs or something else.
But nothing of these works for me.

Kind regards syt

0
Comment actions Permalink

Well, it depends on the nature of the features you make, but I see two ways for you to go:

1. Implement a separate plugin, providing this sort of integration. And by separate plugin I mean that it shouldn't include the code of original svn4idea. Of course, it can depend on it by using some APIs of svn4idea. If your feature is relatively big, it may be the best decision.
But in certain cases this approach may be not possible due to lack of open API in svn4idea or in intellij platform. You have to check it yourself.

2. Modify the code of svn4idea, and make a pull request to intellij-community. When (and if) your pull request is reviewed and accepted, the changes will be included to IntelliJ original repository and released.

Until then you can build your personal intellij instance from sources and check if everything works. Of course, you will be able to share jars with your colleagues. I suspect, this is what you're trying to do.

Here is a simple method how to deploy IDEA sources:
1. Make sure that Ant is enabled in Settings | Plugins.
2. Quit IDEA.
3. Run IDEA in internal mode. For this modify idea.exe.vmoptions by adding "-Didea.is.internal=true"
4. Start IDEA.
5. Once IDEA starts up and opens the IDEA community project, new action Build | Developers update | <default target> will appear in the menu (you may need to wait for the project to be fully initialized to see this action available).
6. Invoke the action.
7. Ant will start building jars. It will take several minutes to complete. You will be able to watch the progress, and see where jars are built into: to <idea>/out/deploy/plugins/svn4idea/lib/svn4idea.jar
8. Then you can quit IDEA, copy the jar you need to the working IDEA application folder (<idea installation>/plugins/svn4idea/lib) and start it.

Please tell if that works for you.

0
Comment actions Permalink

Hi, your first suggestion was my first idea too.
I created a Plugin Module an copied everthing from the svn4idea module in it.
But i cant run the plugin, it gives me the following exception:


[   1194]  ERROR - com.intellij.ide.IdeEventQueue - Error during dispatching of java.awt.event.InvocationEvent[INVOCATION_DEFAULT,runnable=com.intellij.idea.MainImpl$2@8a48f3,notifier=null,catchExceptions=false,when=1363180631239] on sun.awt.X11.XToolkit@bb6684
java.lang.ArrayStoreException
 at java.lang.System.arraycopy(Native Method)
 at java.util.ArrayList.toArray(ArrayList.java:361)
 at com.intellij.openapi.extensions.impl.ExtensionPointImpl.getExtensions(ExtensionPointImpl.java:177)
 at com.intellij.openapi.application.impl.ApplicationImpl.loadComponentRoamingTypes(ApplicationImpl.java:580)
 at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:550)
 at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:199)
 at com.intellij.idea.MainImpl$2.run(MainImpl.java:97)
 at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
 at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:727)
 at java.awt.EventQueue.access$200(EventQueue.java:103)
 at java.awt.EventQueue$3.run(EventQueue.java:688)
 at java.awt.EventQueue$3.run(EventQueue.java:686)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
 at java.awt.EventQueue.dispatchEvent(EventQueue.java:697)
 at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:673)
 at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:498)
 at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:333)
 at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
 at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
 at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
[   1196]  ERROR - com.intellij.ide.IdeEventQueue - IntelliJ IDEA 12.0.4  Build #IC-123.169
[   1196]  ERROR - com.intellij.ide.IdeEventQueue - JDK: 1.7.0_15
[   1196]  ERROR - com.intellij.ide.IdeEventQueue - VM: Java HotSpot(TM) Server VM
[   1196]  ERROR - com.intellij.ide.IdeEventQueue - Vendor: Oracle Corporation
[   1196]  ERROR - com.intellij.ide.IdeEventQueue - OS: Linux


I also build the jars like you mentioned an copied them to <pycharm installation>/plugins/svn4idea/lib but it gives me several error becouse of none existing functions an deactivates the plugin afterwards.
Besides it does not work with the platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java it is located in the pycharm.jar or the idea.jar after building. Therefore i extracted them and copied the classes by my own.
If i extract the jars an replace the changed *class files everythings works like i want.

0
Comment actions Permalink

I think you're mixing both approaches.
Why do you copy the existing svn4idea code into another module? Maybe this causes the exception since some extensions are defined twice.
You should either create a separate plugin, or hack over existing code.

0
Comment actions Permalink

I did, but if i replace the svn4idea.jar with the
new compiled one it gives me several errors during runtime.

Even if i just compile it without doing any changes it does not work.

http://pastebin.com/Ar3mets8


solved:
I got it working right now, problem was solved by using
intellij 117 insead of 120 now i can just deploy svn4idea with my changes and replace it with the one in the pycharm plugin/svn4idea/lib/svn4idea

0
Comment actions Permalink

Hi, I want to go back to the original topic from jostster.
Is there any way to add some options to the VCS commit dialog box which is originally created by the CommitChangeListDialog.java by an Plugin.

Kind regards
syt

0
Comment actions Permalink

Please try to define a CheckinHandler with getBeforeCheckinConfigurationPanel or getAfterCheckinConfigurationPanel.
You may also override CheckinEnvironment#createAdditionalOptionsPanel, but it would require you to implement your own CheckinEnvironment.

0

Please sign in to leave a comment.