Skip to content

Commit

Permalink
Support rollback through the VCS interface and add some stubs for P4 …
Browse files Browse the repository at this point in the history
…checkin, checkout, and history.
  • Loading branch information
robinverduijn committed Aug 6, 2013
1 parent 9d36815 commit 1859efb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
3 changes: 2 additions & 1 deletion META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<idea-plugin version="2">
<id>net.rvd.idea.p4idea</id>
<name>Perforce VCS Integration</name>
<version>1.0.1</version>
<version>1.1</version>
<vendor email="robinverduijn.github@gmail.com" url="http://www.github.com">RVD</vendor>

<description><![CDATA[
Expand All @@ -23,6 +23,7 @@
<li>0.9: Rudimentary caching support, use "P4 have" list for smarter operation, better logging.
<li>1.0: Initial support for P4 actions other than just add/edit/delete.
<li>1.0.1: Properly handle unversioned files and refresh of the "Changes" view.
<li>1.1: Support rollback through the VCS interface and add some stubs for P4 checkin, checkout, and history.
</ul>
]]>
</change-notes>
Expand Down
30 changes: 26 additions & 4 deletions src/p4idea/vcs/PerforceVcs.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.intellij.openapi.vcs.changes.ChangeListEditHandler;
import com.intellij.openapi.vcs.changes.ChangeProvider;
import com.intellij.openapi.vcs.checkin.CheckinEnvironment;
import com.intellij.openapi.vcs.rollback.RollbackEnvironment;
import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList;
import com.intellij.openapi.vfs.VirtualFile;
import com.perforce.p4java.exception.AccessException;
Expand All @@ -26,6 +27,10 @@ public class PerforceVcs extends AbstractVcs<CommittedChangeList>
private final P4RootChecker _rootChecker;
private final P4EditFileProvider _editFileProvider;
private final P4SettingsValidator _validator;
private final P4CheckinEnvironment _checkinEnvironment;
private final P4CheckoutProvider _checkoutProvider;
private final P4CommittedChangesProvider _committedChangesProvider;
private final P4RollbackEnvironment _rollbackEnvironment;

public PerforceVcs( @NotNull Project project )
{
Expand All @@ -36,6 +41,11 @@ public PerforceVcs( @NotNull Project project )
_rootChecker = new P4RootChecker();
_editFileProvider = new P4EditFileProvider();
_validator = new P4SettingsValidator( project );
_checkinEnvironment = new P4CheckinEnvironment();
_checkoutProvider = new P4CheckoutProvider();
_committedChangesProvider = new P4CommittedChangesProvider();
_rollbackEnvironment = new P4RollbackEnvironment();

Instance = this;
}

Expand Down Expand Up @@ -164,14 +174,26 @@ public void enableIntegration()
@Override
public CheckinEnvironment getCheckinEnvironment()
{
log( "getCheckinEnvironment()" );
return super.getCheckinEnvironment();
return _checkinEnvironment;
}

@Override
public CheckoutProvider getCheckoutProvider()
{
log( "getCheckoutProvider()" );
return super.getCheckoutProvider();
return _checkoutProvider;
}

@Nullable
@Override
public CommittedChangesProvider getCommittedChangesProvider()
{
return _committedChangesProvider;
}

@Nullable
@Override
public RollbackEnvironment getRollbackEnvironment()
{
return _rollbackEnvironment;
}
}

0 comments on commit 1859efb

Please sign in to comment.