Add file to perforce

Hi,

I am trying to find the API for adding a newly created file to the VCS repository (to be committed later by the user).

We use perforce as the VCS and it can be assumed as a given.

I tried to do the following but get a null on a call to getStandardOperationsProvider():

+AbstractVcs allActiveVcss[] =
ProjectLevelVcsManager.getInstance(project).getAllActiveVcss();
AbstractVcs activeVcs = allActiveVcss[0];+
//Here I get null!!!
activeVcs.getStandardOperationsProvider();

Your help would be appreciated,

Thanks, Baruch.

5 comments

Hello Baruch,

I am trying to find the API for adding a newly created file to the VCS
repository (to be committed later by the user).

We use perforce as the VCS and it can be assumed as a given.

I tried to do the following but get a null on a call to
getStandardOperationsProvider():

+AbstractVcs allActiveVcss[] =

ProjectLevelVcsManager.getInstance(project).getAllActiveVcss();
AbstractVcs activeVcs = allActiveVcss[0];+
//Here I get null!!!
activeVcs.getStandardOperationsProvider();
Your help would be appreciated,


AbstractVcs.getCheckinEnvironment().scheduleUnversionedFilesForAddition()

StandardOperationsProvider is an obsolete API which has been dropped in 7.0.

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


0

Hello Baruch,

+AbstractVcs allActiveVcss[] =

ProjectLevelVcsManager.getInstance(project).getAllActiveVcss();
AbstractVcs activeVcs = allActiveVcss[0];+


This is incorrect, by the way. You should use ProjectLevelVcsManager.getVcsFor()
instead.

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


0

Hello Dmitry,

Thanks very much for your prompt reply. I foolishly neglected to mention that my plugin needs to support Intellij versions starting with 5.0.

What are the option in 5.0 APIs?

Thanks in advance, Baruch.

0

Hello Baruch,

Thanks very much for your prompt reply. I foolishly neglected to
mention that my plugin needs to support Intellij versions starting
with 5.0.

What are the option in 5.0 APIs?


Since the VCS API has been rewritten between 5.0 and 7.0, there is no single
API call that will work in both 5.0 and 7.0.

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


0

What will be the correct call for version 5?

Tnx.

0

Please sign in to leave a comment.