vcs api

Few api questions I have regarding the api

1. Is there some sample code or documentation as to show how custom
fileviews are implemented ?

2. In Cvs when you check in the panel has options to optimize import etc..
What is the api for those options ?

3. Is there anyway we can use the AbstractVcs.getVcsHistoryProvider to show
the file history ? If not, what is the purpose of that class ?

-Dash.


7 comments

Debabrata Dash wrote:

3. Is there anyway we can use the AbstractVcs.getVcsHistoryProvider to show
the file history ? If not, what is the purpose of that class ?


Looks to me like that API is not opened yet.

--

Erb

==============================================================
"Most of you are familiar with the virtues of a programmer.
There are three, of course: laziness, impatience, and hubris."
- Larry Wall
==============================================================

0

1. Is there some sample code or documentation as to show how custom
fileviews are implemented ?


Not yet... I'll implement a sample (based on local history)

2. In Cvs when you check in the panel has options to optimize import etc..
What is the api for those options ?


This options are stored in VcsConfiguration

public boolean OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT = false;
public boolean OPTIMIZE_IMPORTS_BEFORE_FILE_COMMIT = false;

public boolean REFORMAT_BEFORE_PROJECT_COMMIT = false;
public boolean REFORMAT_BEFORE_FILE_COMMIT = false;

AbstractVCSHelper performs import and reformat with method
optimizeImportsAndReformatCode

3. Is there anyway we can use the AbstractVcs.getVcsHistoryProvider to

show

the file history ? If not, what is the purpose of that class ?


Include action with id="Vcs.ShowHistory" to some action group and (if VCS
returns VcsHistoryProvider) the action will be enabled

--
Best regards,
Olesya Smirnova
JetBrains, Inc / IntelliJ Software
http://www.intellij.com
"Develop with pleasure!"


"Debabrata Dash" <dash@arcsightnospam.com> wrote in message
news:bp9ho4$8pf$1@is.intellij.net...

Few api questions I have regarding the api

>

1. Is there some sample code or documentation as to show how custom
fileviews are implemented ?

>

2. In Cvs when you check in the panel has options to optimize import etc..
What is the api for those options ?

>

3. Is there anyway we can use the AbstractVcs.getVcsHistoryProvider to

show

the file history ? If not, what is the purpose of that class ?

>

-Dash.

>
>


0

I won't bother opening a bug for this:
You're going to open openapi.vcs.history in the next build, right?

Olesya Smirnova (JetBrains) wrote:
>>1. Is there some sample code or documentation as to show how custom
>>fileviews are implemented ?


Not yet... I'll implement a sample (based on local history)

>>2. In Cvs when you check in the panel has options to optimize import etc..
>>What is the api for those options ?


This options are stored in VcsConfiguration

public boolean OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT = false;
public boolean OPTIMIZE_IMPORTS_BEFORE_FILE_COMMIT = false;

public boolean REFORMAT_BEFORE_PROJECT_COMMIT = false;
public boolean REFORMAT_BEFORE_FILE_COMMIT = false;

AbstractVCSHelper performs import and reformat with method
optimizeImportsAndReformatCode

>>3. Is there anyway we can use the AbstractVcs.getVcsHistoryProvider to


show

>>the file history ? If not, what is the purpose of that class ?


Include action with id="Vcs.ShowHistory" to some action group and (if VCS
returns VcsHistoryProvider) the action will be enabled


--

Erb

==============================================================
"Most of you are familiar with the virtues of a programmer.
There are three, of course: laziness, impatience, and hubris."
- Larry Wall
==============================================================

0

It should be in open api, of course. Thanks

--
Best regards,
Olesya Smirnova
JetBrains, Inc / IntelliJ Software
http://www.intellij.com
"Develop with pleasure!"


"Erb" <dont@evenbother.com> wrote in message
news:bpdg6g$22b$1@is.intellij.net...

I won't bother opening a bug for this:
You're going to open openapi.vcs.history in the next build, right?

>

Olesya Smirnova (JetBrains) wrote:
>>1. Is there some sample code or documentation as to show how custom
>>fileviews are implemented ?
>
>

Not yet... I'll implement a sample (based on local history)

>
>
>>2. In Cvs when you check in the panel has options to optimize import

etc..

>>What is the api for those options ?
>
>

This options are stored in VcsConfiguration

>

public boolean OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT = false;
public boolean OPTIMIZE_IMPORTS_BEFORE_FILE_COMMIT = false;

>

public boolean REFORMAT_BEFORE_PROJECT_COMMIT = false;
public boolean REFORMAT_BEFORE_FILE_COMMIT = false;

>

AbstractVCSHelper performs import and reformat with method
optimizeImportsAndReformatCode

>
>
>>3. Is there anyway we can use the AbstractVcs.getVcsHistoryProvider to
>

show

>
>>the file history ? If not, what is the purpose of that class ?
>
>

Include action with id="Vcs.ShowHistory" to some action group and (if

VCS

returns VcsHistoryProvider) the action will be enabled

>

>

--

>

Erb

>

==============================================================
"Most of you are familiar with the virtues of a programmer.
There are three, of course: laziness, impatience, and hubris."
- Larry Wall
==============================================================



0

Here is my code snippet for this.

Runnable runnable = new Runnable() {
public void run() {
}
};

final AbstractVcsHelper vcsHelper = AbstractVcsHelper.getInstance(myProject);
vcsHelper.optimizeImportsAndReformatCode(
((CheckinProjectPanel) d.getCheckinProjectPanel()).getVirtualFiles(), vcs.getConfiguration(), runnable, true);
vcsHelper.doCheckinProject(d.getCheckinProjectPanel(), d.getComment());


This code doesn't do any formatting or optimizing the import of the files before checking in. Also I get the attached error message. The suspect seems to be the runnable. What does the vcs system expect the runnable to do ?

Thanks,
Dash.

2. In Cvs when you check in the panel has options

to optimize import etc..

What is the api for those options ?


This options are stored in VcsConfiguration

public boolean
n OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT = false;
public boolean OPTIMIZE_IMPORTS_BEFORE_FILE_COMMIT
T = false;

public boolean REFORMAT_BEFORE_PROJECT_COMMIT =
= false;
public boolean REFORMAT_BEFORE_FILE_COMMIT = false;

AbstractVCSHelper performs import and reformat with
method
optimizeImportsAndReformatCode



Attachment(s):
cache.PNG
0

Reformating and optimazing imports are anisochronous actions so you should
perform checking in after they will be finished (in the runnable)

Try this:


final AbstractVcsHelper vcsHelper =
AbstractVcsHelper.getInstance(myProject);

Runnable runnable = new Runnable() {
public void run() {
vcsHelper.doCheckinProject(d.getCheckinProjectPanel(),
d.getComment());
}
};


vcsHelper.optimizeImportsAndReformatCode(
((CheckinProjectPanel)
d.getCheckinProjectPanel()).getVirtualFiles(), vcs.getConfiguration(),
runnable, true);


--
Best regards,
Olesya Smirnova
JetBrains, Inc / IntelliJ Software
http://www.intellij.com
"Develop with pleasure!"


"Debabrata Dash" <dash@arcsight.com> wrote in message
news:25334253.1070443068916.JavaMail.javamailuser@localhost...

Here is my code snippet for this.

>

Runnable runnable = new Runnable() {
public void run() {
}
};

>

final AbstractVcsHelper vcsHelper =

AbstractVcsHelper.getInstance(myProject);

vcsHelper.optimizeImportsAndReformatCode(
((CheckinProjectPanel)

d.getCheckinProjectPanel()).getVirtualFiles(), vcs.getConfiguration(),
runnable, true);

vcsHelper.doCheckinProject(d.getCheckinProjectPanel(),

d.getComment());
>
>

This code doesn't do any formatting or optimizing the import of the files

before checking in. Also I get the attached error message. The suspect seems
to be the runnable. What does the vcs system expect the runnable to do ?
>

Thanks,
Dash.

>

2. In Cvs when you check in the panel has options

to optimize import etc..

What is the api for those options ?

>

This options are stored in VcsConfiguration

>

public boolean
n OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT = false;
public boolean OPTIMIZE_IMPORTS_BEFORE_FILE_COMMIT
T = false;

>

public boolean REFORMAT_BEFORE_PROJECT_COMMIT =
= false;
public boolean REFORMAT_BEFORE_FILE_COMMIT = false;

>

AbstractVCSHelper performs import and reformat with
method
optimizeImportsAndReformatCode

>


0

Thanks Olesya! that fixed it.

-Dash.

"Olesya Smirnova (JetBrains)" <lesya@intellij.com> wrote in message
news:bqkrtj$3nj$1@is.intellij.net...

Reformating and optimazing imports are anisochronous actions so you should
perform checking in after they will be finished (in the runnable)

>

Try this:

>
>

final AbstractVcsHelper vcsHelper =
AbstractVcsHelper.getInstance(myProject);

>

Runnable runnable = new Runnable() {
public void run() {
vcsHelper.doCheckinProject(d.getCheckinProjectPanel(),
d.getComment());
}
};

>
>

vcsHelper.optimizeImportsAndReformatCode(
((CheckinProjectPanel)
d.getCheckinProjectPanel()).getVirtualFiles(), vcs.getConfiguration(),
runnable, true);

>
>

--
Best regards,
Olesya Smirnova
JetBrains, Inc / IntelliJ Software
http://www.intellij.com
"Develop with pleasure!"

>
>

"Debabrata Dash" <dash@arcsight.com> wrote in message
news:25334253.1070443068916.JavaMail.javamailuser@localhost...

Here is my code snippet for this.

>

Runnable runnable = new Runnable() {
public void run() {
}
};

>

final AbstractVcsHelper vcsHelper =

AbstractVcsHelper.getInstance(myProject);

vcsHelper.optimizeImportsAndReformatCode(
((CheckinProjectPanel)

d.getCheckinProjectPanel()).getVirtualFiles(), vcs.getConfiguration(),
runnable, true);

vcsHelper.doCheckinProject(d.getCheckinProjectPanel(),

d.getComment());
>
>

This code doesn't do any formatting or optimizing the import of the

files

before checking in. Also I get the attached error message. The suspect

seems

to be the runnable. What does the vcs system expect the runnable to do ?
>

Thanks,
Dash.

>

2. In Cvs when you check in the panel has options

to optimize import etc..

What is the api for those options ?

>

This options are stored in VcsConfiguration

>

public boolean
n OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT = false;
public boolean OPTIMIZE_IMPORTS_BEFORE_FILE_COMMIT
T = false;

>

public boolean REFORMAT_BEFORE_PROJECT_COMMIT =
= false;
public boolean REFORMAT_BEFORE_FILE_COMMIT = false;

>

AbstractVCSHelper performs import and reformat with
method
optimizeImportsAndReformatCode

>

>
>


0

Please sign in to leave a comment.