How to hook into post commit phase?

I'd like to make something after successful commit of files to VCS. Would be great to know also revision number of commited files (subversion specific).
Is it possible?

0
3 comments
Avatar
Permanently deleted user

Hello Marek,

I'd like to make something after successful commit of files to VCS.
Would be great to know also revision number of commited files
(subversion specific).

Is it possible?


The CheckinHandler interface lets you perform custom processing in the checkinSuccessful()
method. Revision numbers of committed files are specific to a particular
VCS and are not passed to the handler; you'll need to fetch that information
yourself.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Avatar
Permanently deleted user

Marek Went wrote:

I'd like to make something after successful commit of files to VCS. Would be great to know also revision number of commited files (subversion specific).
Is it possible?

Implement a CheckinHandlerFactory and register it using
VCSManager.registerCheckinHandlerFactory().

You can get the files selected for checkin from the CheckinProjectPanel
passed to you in the CheckinHandlerFactory. To get the new version
number of a file, get the DiffProvider from the VCS and call
getCurrentRevision().

HTH,
N.

0
Avatar
Permanently deleted user

Hi,
  I'm porting Atlassian Connector for IntelliJ IDE. Since IDEA 10.3 no problem with registering    
<checkinHandlerFactory implementation="com.atlassian.theplugin.idea.jira.LogTimeCheckinHandlerFactory"/>
in plugin.xml

Recently (Idea 10.5) something has changed and cannot initialize LogTimeCheckinHandlerFactory from plugin.xml. I get pico error:
[  78846]  ERROR - tartup.impl.StartupManagerImpl - com.atlassian.theplugin.idea.jira.LogTimeCheckinHandlerFactory has unsatisfied dependency: class com.atlassian.theplugin.configuration.JiraWorkspaceConfiguration among unsatisfiable dependencies: [[class com.atlassian.theplugin.configuration.JiraWorkspaceConfiguration, interface com.atlassian.connector.cfg.ProjectCfgManager]] where AreaPicoContainer[null] was the leaf container being asked for dependencies.
org.picocontainer.defaults.UnsatisfiableDependenciesException: com.atlassian.theplugin.idea.jira.LogTimeCheckinHandlerFactory has unsatisfied dependency: class com.atlassian.theplugin.configuration.JiraWorkspaceConfiguration among unsatisfiable dependencies: [[class com.atlassian.theplugin.configuration.JiraWorkspaceConfiguration, interface com.atlassian.connector.cfg.ProjectCfgManager]] where AreaPicoContainer[null] was the leaf container being asked for dependencies.
    at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getGreediestSatisfiableConstructor(ConstructorInjectionComponentAdapter.java:191)
    at org.picocontainer.defaults.ConstructorInjectionComponentAdapter$1.run(ConstructorInjectionComponentAdapter.java:210)
    at org.picocontainer.defaults.ThreadLocalCyclicDependencyGuard.observe(ThreadLocalCyclicDependencyGuard.java:53)
    at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getComponentInstance(ConstructorInjectionComponentAdapter.java:248)
    at org.picocontainer.defaults.DecoratingComponentAdapter.getComponentInstance(DecoratingComponentAdapter.java:60)
    at org.picocontainer.defaults.CachingComponentAdapter.getComponentInstance(CachingComponentAdapter.java:58)
    at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.getComponentInstance(ExtensionComponentAdapter.java:71)
    at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.getExtension(ExtensionComponentAdapter.java:106)
    at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapters(ExtensionPointImpl.java:217)
    at com.intellij.openapi.extensions.impl.ExtensionPointImpl.getExtensions(ExtensionPointImpl.java:164)
    at com.intellij.openapi.extensions.Extensions.getExtensions(Extensions.java:101)
    at com.intellij.openapi.extensions.Extensions.getExtensions(Extensions.java:89)
    at com.intellij.openapi.vcs.impl.CheckinHandlersManagerImpl$1.run(CheckinHandlersManagerImpl.java:55)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:841)
    at com.intellij.ide.startup.impl.StartupManagerImpl$4.run(StartupManagerImpl.java:209)
    at com.intellij.ide.startup.impl.StartupManagerImpl.a(StartupManagerImpl.java:191)
    at com.intellij.ide.startup.impl.StartupManagerImpl.runPostStartupActivities(StartupManagerImpl.java:135)
    at com.intellij.openapi.project.impl.ProjectManagerImpl.openProject(ProjectManagerImpl.java:397)
    at com.intellij.openapi.project.impl.ProjectManagerImpl.loadAndOpenProject(ProjectManagerImpl.java:437)
    at com.intellij.openapi.project.impl.ProjectManagerImpl.loadAndOpenProject(ProjectManagerImpl.java:420)
    at com.intellij.ide.impl.ProjectUtil.openProject(ProjectUtil.java:163)
    at com.intellij.ide.impl.ProjectUtil.openOrImport(ProjectUtil.java:108)
    at com.intellij.ide.actions.OpenProjectAction$1.consume(OpenProjectAction.java:75)
    at com.intellij.ide.actions.OpenProjectAction$1.consume(OpenProjectAction.java:70)
    at com.intellij.openapi.fileChooser.FileChooser.chooseFilesWithSlideEffect(FileChooser.java:79)
    at com.intellij.ide.actions.OpenProjectAction.actionPerformed(OpenProjectAction.java:70)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter$1.run(ActionMenuItem.java:242)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:662)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:228)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:92)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.a(BegMenuItemUI.java:512)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:44)
    at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:532)
    at java.awt.Component.processMouseEvent(Component.java:6289)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
    at java.awt.Component.processEvent(Component.java:6054)
    at java.awt.Container.processEvent(Container.java:2041)
    at java.awt.Component.dispatchEventImpl(Component.java:4652)
    at java.awt.Container.dispatchEventImpl(Container.java:2099)
    at java.awt.Component.dispatchEvent(Component.java:4482)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
    at java.awt.Container.dispatchEventImpl(Container.java:2085)
    at java.awt.Window.dispatchEventImpl(Window.java:2478)
    at java.awt.Component.dispatchEvent(Component.java:4482)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
    at java.awt.EventQueue.access$000(EventQueue.java:85)
    at java.awt.EventQueue$1.run(EventQueue.java:603)
    at java.awt.EventQueue$1.run(EventQueue.java:601)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
    at java.awt.EventQueue$2.run(EventQueue.java:617)
    at java.awt.EventQueue$2.run(EventQueue.java:615)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
    at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:661)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:510)
    at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:410)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:368)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
[  78848]  ERROR - tartup.impl.StartupManagerImpl - IntelliJ IDEA 10.5  Build

if class constructorlooks like that:
            public LogTimeCheckinHandlerFactory(@NotNull final JiraWorkspaceConfiguration jiraWorkspaceConfiguration,
            @NotNull final ProjectCfgManager projectCfgManager)
error occuress

but if constructor looks like this (no params):
    public LogTimeCheckinHandlerFactory()
no exception is thrown


My question is has something changed in code that initializes checkinHandlers?
Thanks

0

Please sign in to leave a comment.