SCR43762 fixed

This commit is contained in:
Olesya Smirnova
2005-02-25 13:09:04 +03:00
parent 627d82609e
commit 73bed043e3
2 changed files with 13 additions and 12 deletions
@@ -98,20 +98,10 @@ public class CvsStandardOperationsProvider implements StandardOperationsProvider
public void commit(Object parameters) throws VcsException {
getCurrentTransaction().setMessage(parameters);
executeOperation("Commit Transaction", getCurrentTransaction());
CvsVcs2.executeOperation("Commit Transaction", getCurrentTransaction(), myProject);
myCurrentTransaction = null;
}
private void executeOperation(String title, CvsOperation operation) throws VcsException {
CvsOperationExecutor executor = new CvsOperationExecutor(myProject);
executor.performActionSync(new CommandCvsHandler(title, operation),
CvsOperationExecutorCallback.EMPTY);
CvsResult result = executor.getResult();
if (!result.hasNoErrors()){
throw result.composeError();
}
}
public void rollback() {
myCurrentTransaction = null;
}
@@ -119,7 +109,7 @@ public class CvsStandardOperationsProvider implements StandardOperationsProvider
public byte[] getFileContent(String path) throws VcsException {
try {
GetFileContentOperation command = GetFileContentOperation.createForFile(CvsVfsUtil.findFileByIoFile(new File(path)));
executeOperation("Get File Content", command);
CvsVcs2.executeOperation("Get File Content", command, myProject);
return command.getFileBytes();
}
catch (CannotFindCvsRootException cannotFindCvsRootException) {
@@ -33,6 +33,7 @@ import com.intellij.openapi.vcs.fileView.FileViewEnvironment;
import com.intellij.openapi.vcs.history.VcsHistoryProvider;
import com.intellij.openapi.vcs.update.UpdateEnvironment;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.cvsIntegration.CvsResult;
import java.io.File;
@@ -157,6 +158,16 @@ public class CvsVcs2 extends AbstractVcs implements ProjectComponent,
return myCvsStandardOperationsProvider.getFilesToProcessCount();
}
public static void executeOperation(String title, CvsOperation operation, final Project project) throws VcsException {
CvsOperationExecutor executor = new CvsOperationExecutor(project);
executor.performActionSync(new CommandCvsHandler(title, operation),
CvsOperationExecutorCallback.EMPTY);
CvsResult result = executor.getResult();
if (!result.hasNoErrors()){
throw result.composeError();
}
}
private static class MyFileStatusProvider implements FileStatusProvider {
public FileStatus getStatus(VirtualFile virtualFile) {
return CvsStatusProvider.getStatus(virtualFile);