Difference in Abstract VCS and Checkout provider

Hi,

I want to add support for a new version control in IDEA. There is a little
conufsion regrading how to do this.
One way is to extend "com.intellij.openapi.vcs AbstractVcs" which provides
interfaces for integrating IDEA with version control systems.
And other way to do this use implement CheckoutProvider interface and
register it as ApplicationComponent in order to provide checkout
functionality.

Can anyone suggest which is right way to do add a support new version
control in IDEA.

~Priya


5 comments

Hello Priya,

P> I want to add support for a new version control in IDEA. There is a
P> little
P> conufsion regrading how to do this.
P> One way is to extend "com.intellij.openapi.vcs AbstractVcs" which
P> provides
P> interfaces for integrating IDEA with version control systems.
P> And other way to do this use implement CheckoutProvider interface and
P> register it as ApplicationComponent in order to provide checkout
P> functionality.
P> Can anyone suggest which is right way to do add a support new version
P> control in IDEA.

The CheckoutProvider interface is responsible only for the action in the
"Checkout" menu. All other VCS functionality (update, commit and so on) is
based on the AbstractVcs interface. So, most likely, you need to implement
both of these interfaces.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0

If I implement both the interfaces, how do I co-relate these two?
CheckoutProvider interface is used at application component level and
AbtractVcs is used at project component level.

Also what if I have my own api's of the version control system to perform
the update,commit..etc?


~Priya

"Dmitry Jemerov (JetBrains)" <yole@jetbrains.com> wrote in message
news:83ca25fd260a3e8c7f9ffdc39d8d0@news.intellij.net...

Hello Priya,

>

P> I want to add support for a new version control in IDEA. There is a
P> little
P> conufsion regrading how to do this.
P> One way is to extend "com.intellij.openapi.vcs AbstractVcs" which
P> provides
P> interfaces for integrating IDEA with version control systems.
P> And other way to do this use implement CheckoutProvider interface and
P> register it as ApplicationComponent in order to provide checkout
P> functionality.
P> Can anyone suggest which is right way to do add a support new version
P> control in IDEA.

>

The CheckoutProvider interface is responsible only for the action in the
"Checkout" menu. All other VCS functionality (update, commit and so on) is
based on the AbstractVcs interface. So, most likely, you need to implement
both of these interfaces.

>

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"

>
>


0

Hello Priya,

P> If I implement both the interfaces, how do I co-relate these two?
P> CheckoutProvider interface is used at application component level and
P> AbtractVcs is used at project component level.

You can use the following code to retrieve the AbstractVcs instance from
your CheckoutProvider:
Project project = ProjectManager.getInstance().getDefaultProject();
ProjectLevelVcsManager.getInstance(project).findVcsByName(myVcsName);

The components are separated for a reason - checking out is possible when
you do not have any project open, and all other actions require a project.

P> Also what if I have my own api's of the version control system to
P> perform the update,commit..etc?

What do you mean by "what if"? You need to implement IDEA's integration interfaces,
and use the APIs of your VCS in your implementation of the interfaces.

P>
P> ~Priya
P>
P> "Dmitry Jemerov (JetBrains)" <yole@jetbrains.com> wrote in message
P> news:83ca25fd260a3e8c7f9ffdc39d8d0@news.intellij.net...
P>
>> Hello Priya,
>>
>> P> I want to add support for a new version control in IDEA. There is
>> a
>> P> little
>> P> conufsion regrading how to do this.
>> P> One way is to extend "com.intellij.openapi.vcs AbstractVcs" which
>> P> provides
>> P> interfaces for integrating IDEA with version control systems.
>> P> And other way to do this use implement CheckoutProvider interface
>> and
>> P> register it as ApplicationComponent in order to provide checkout
>> P> functionality.
>> P> Can anyone suggest which is right way to do add a support new
>> version
>> P> control in IDEA.
>> The CheckoutProvider interface is responsible only for the action in
>> the "Checkout" menu. All other VCS functionality (update, commit and
>> so on) is based on the AbstractVcs interface. So, most likely, you
>> need to implement both of these interfaces.
>>
>> --
>> Dmitry Jemerov
>> Software Developer
>> JetBrains, Inc.
>> http://www.jetbrains.com
>> "Develop with pleasure!"
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0

Thanks a lot.
I thought there is some kind of support from IDEA to do update n commit, so
that question of what if.

Now my doubts are more clear


"Dmitry Jemerov (JetBrains)" <yole@jetbrains.com> wrote in message
news:83ca25fd260a538c7fa0172e8bb90@news.intellij.net...

Hello Priya,

>

P> If I implement both the interfaces, how do I co-relate these two?
P> CheckoutProvider interface is used at application component level and
P> AbtractVcs is used at project component level.

>

You can use the following code to retrieve the AbstractVcs instance from
your CheckoutProvider:
Project project = ProjectManager.getInstance().getDefaultProject();
ProjectLevelVcsManager.getInstance(project).findVcsByName(myVcsName);

>

The components are separated for a reason - checking out is possible when
you do not have any project open, and all other actions require a project.

>

P> Also what if I have my own api's of the version control system to
P> perform the update,commit..etc?

>

What do you mean by "what if"? You need to implement IDEA's integration

interfaces,

and use the APIs of your VCS in your implementation of the interfaces.

>

P>
P> ~Priya
P>
P> "Dmitry Jemerov (JetBrains)" <yole@jetbrains.com> wrote in message
P> news:83ca25fd260a3e8c7f9ffdc39d8d0@news.intellij.net...
P>
>> Hello Priya,
>>
>> P> I want to add support for a new version control in IDEA. There is
>> a
>> P> little
>> P> conufsion regrading how to do this.
>> P> One way is to extend "com.intellij.openapi.vcs AbstractVcs" which
>> P> provides
>> P> interfaces for integrating IDEA with version control systems.
>> P> And other way to do this use implement CheckoutProvider interface
>> and
>> P> register it as ApplicationComponent in order to provide checkout
>> P> functionality.
>> P> Can anyone suggest which is right way to do add a support new
>> version
>> P> control in IDEA.
>> The CheckoutProvider interface is responsible only for the action in
>> the "Checkout" menu. All other VCS functionality (update, commit and
>> so on) is based on the AbstractVcs interface. So, most likely, you
>> need to implement both of these interfaces.
>>
>> --
>> Dmitry Jemerov
>> Software Developer
>> JetBrains, Inc.
>> http://www.jetbrains.com
>> "Develop with pleasure!"
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"

>
>


0

Hello Priya,

In general, there is a lot of code provided by IDEA that you can reuse in
your VCS plugin. You should study the source code of the Perforce and Subversion
plugins included in the Plugin Development Package to get a good understanding
of the API.

P> Thanks a lot.
P> I thought there is some kind of support from IDEA to do update n
P> commit, so
P> that question of what if.
P> Now my doubts are more clear
P>
P> "Dmitry Jemerov (JetBrains)" <yole@jetbrains.com> wrote in message
P> news:83ca25fd260a538c7fa0172e8bb90@news.intellij.net...
P>
>> Hello Priya,
>>
>> P> If I implement both the interfaces, how do I co-relate these two?
>> P> CheckoutProvider interface is used at application component level
>> and
>> P> AbtractVcs is used at project component level.
>> You can use the following code to retrieve the AbstractVcs instance
>> from
>> your CheckoutProvider:
>> Project project = ProjectManager.getInstance().getDefaultProject();
>> ProjectLevelVcsManager.getInstance(project).findVcsByName(myVcsName);
>> The components are separated for a reason - checking out is possible
>> when you do not have any project open, and all other actions require
>> a project.
>>
>> P> Also what if I have my own api's of the version control system to
>> P> perform the update,commit..etc?
>>
>> What do you mean by "what if"? You need to implement IDEA's
>> integration
>>
P> interfaces,
P>
>> and use the APIs of your VCS in your implementation of the
>> interfaces.
>>
>> P>
>> P> ~Priya
>> P>
>> P> "Dmitry Jemerov (JetBrains)" <yole@jetbrains.com> wrote in message
>> P> news:83ca25fd260a3e8c7f9ffdc39d8d0@news.intellij.net...
>> P>
>>>> Hello Priya,
>>>>
>>>> P> I want to add support for a new version control in IDEA. There
>>>> is
>>>> a
>>>> P> little
>>>> P> conufsion regrading how to do this.
>>>> P> One way is to extend "com.intellij.openapi.vcs AbstractVcs"
>>>> which
>>>> P> provides
>>>> P> interfaces for integrating IDEA with version control systems.
>>>> P> And other way to do this use implement CheckoutProvider
>>>> interface
>>>> and
>>>> P> register it as ApplicationComponent in order to provide checkout
>>>> P> functionality.
>>>> P> Can anyone suggest which is right way to do add a support new
>>>> version
>>>> P> control in IDEA.
>>>> The CheckoutProvider interface is responsible only for the action
>>>> in
>>>> the "Checkout" menu. All other VCS functionality (update, commit
>>>> and
>>>> so on) is based on the AbstractVcs interface. So, most likely, you
>>>> need to implement both of these interfaces.
>>>> --
>>>> Dmitry Jemerov
>>>> Software Developer
>>>> JetBrains, Inc.
>>>> http://www.jetbrains.com
>>>> "Develop with pleasure!"
>> --
>> Dmitry Jemerov
>> Software Developer
>> JetBrains, Inc.
>> http://www.jetbrains.com
>> "Develop with pleasure!"
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0

Please sign in to leave a comment.