AbstractVCS docs?


Hi,

Are there any docs for AbstractVCS yet? The Javadocs are no help (nothing
there) and the Starteam example source isn't that much help.

I really need to know what the -contract-is for the AbstractVCS. Without
this it is going to be almost impossible to write a VCS plugin.

For example: Some VCS systems need a "Checkout" before any files can be
modified. This doesn't appear to be part of AbstractVCS. Doing a large
refactoring of many files would require my plugin to be called so all the
files could be checked out BEFORE the changes can be made and checked in
later.

Also it is unclear what getFileContent() really wants. i.e. should this
always be the head revision, should it always be a repeatable action with
no side effects, etc. or can I check out in that call for example. I doubt
it.

Please fill me in! I've read the few notes on IntelliJ about the current
design problems with VCS plugins.

I'm working on a plugin for SourceJammer, which uses a similar pattern to
Perforce in that checked in files are read only, and you must check out
(make writable) files before you can edit.
--
Marc Palmer
http://www.wangjammers.org
Java Consultants

3 comments


"Marc Palmer" <marc@anyware.co.uk> wrote in message news:oprjc6hmfpfiqlg6@news.intellij.net...


Hi,

Are there any docs for AbstractVCS yet? The Javadocs are no help (nothing
there) and the Starteam example source isn't that much help.

I really need to know what the -contract-is for the AbstractVCS. Without
this it is going to be almost impossible to write a VCS plugin.

Bird's eye view of the required steps:
Create a Configuration class to store your settings
Create a Configurable class to register a gui panel to edit your settings
Create a AbstractVcs class that implements the methods that correspond to its AbstractVcsCapabilities
Create a set of AnAction to launch your VCS operations
Register actions and plugin class to your plugin.xml



For example: Some VCS systems need a "Checkout" before any files can be
modified. This doesn't appear to be part of AbstractVCS. Doing a large
refactoring of many files would require my plugin to be called so all the
files could be checked out BEFORE the changes can be made and checked in
later.

Any actions registered by a VCS Plugin are available in the refactoring preview pane. There you can select the top level node and invoke a VCS action (checkout) to apply it to all sub-nodes.
As far as "checking out file to make them writable" it is not part of the VCS interface. The VCS API only deals with buffering VCS related changes until the developer considers them safe to commit in one transaction to the underlying VCS. If you want to impact the VCS right away (i.e. checkout a file) the VCS API won't help. The VCS API will
1.. Maintain status of the project files (created, modified, moved, deleted)
2.. Using the Local VCS maintain history of modifications
3.. Provide an automated way to reapply all changes to the underlying VCS (create, check in, move, rename, delete) in the action "Commit Project". This is the cornerstone of the VCS philosoply.
If you do something right away that modify the content of a file you will have to let the VCS API know so it can have an up-to-date status (1. ) with respect to your VCS (check in file => file should be mark as uptodate in IDEA since it is in the VCS)
To implement your checkout, just invoke your underlying VCS checkout commands from an IDEA action. The VCS API won't care until you modify the file. At that point it will pick up the modification automatically as long as it is done within IDEA.
If you want to have automatic checkout on modification you can listen to com.intellij.openapi.vfs.ModificationAttemptEvent and checkout the target file in your listener.


Also it is unclear what getFileContent() really wants. i.e. should this
always be the head revision, should it always be a repeatable action with
no side effects, etc. or can I check out in that call for example. I doubt
it.

I do not use getFileContent() so I cannot help you.

Please fill me in! I've read the few notes on IntelliJ about the current
design problems with VCS plugins.

I'm working on a plugin for SourceJammer, which uses a similar pattern to
Perforce in that checked in files are read only, and you must check out
(make writable) files before you can edit.
--

Sorry I cannot be more helpfull but there should be enough VCS plugin sources available from www.intellij.org for you to get a good feel of what needs to be done. To give credit to the JetBrains team you will find writing a VCS plugin rather easy. Testing it might be another issue though (It should be fixed in the next release).

Marc Palmer
http://www.wangjammers.org
Java Consultants

0

On Wed, 22 Jan 2003 00:32:48 -0600, Jacques Morel <jacmorel@yahoo.com>
wrote:


>> I really need to know what the -contract-is for the AbstractVCS. Without
>> this it is going to be almost impossible to write a VCS plugin.

Bird's eye view of the required steps:
Create a Configuration class to store your settings
Create a Configurable class to register a gui panel to edit your settings
Create a AbstractVcs class that implements the methods that correspond to
its AbstractVcsCapabilities
Create a set of AnAction to launch your VCS operations
Register actions and plugin class to your plugin.xml


Yes thanks I know the above. What I was specifically asking for was the
CONTRACT for AbstractVCS. It is unclear in some cases exactly what the
method implementations of AbstractVCS should do, and there is no mention of
"check out" which some VCS systems require.

I don't have time to code this blind... docs are required!

Marc
http://www.wangjammers.org

0

While I agree docs would be really really nice. I wrote my Accurev Plugin without to much trouble. What I did is striped the StarTeam plugin of any real content and just added debug printouts instead. Then played around with it. It was fairly obvious from that what needs be done in the plugin. Feel free to ask any specific questions I may know the answers to.
I didn't need a Checkout action but I think Jacques answered that. As to getFileContent() I don't seem to use it either where did you come across it?
Joey

0

Please sign in to leave a comment.