| Priority |
Normal |
| Type | Bug |
| State | Fixed |
| Assignee | Dmitry Jemerov |
| Subsystem | Version Control. Perforce |
| Affected versions |
No affected versions
|
| Fixed in |
No fix versions
|
| Fixed in build |
Next build |
| Build |
7318
|
| Fixed in build |
7653
|
| Severity |
0
|
IDEA-41331 |
p4v does not start when doing revision graph or time-lapse... |
|
|
In version, 723x, you had fixed the p4v support (but only for a few
updates). In the latest, it doesn't work (but it does fail correctly if
the path is not set. Is there a way for me to see the commands that it
is executing to try to debug the issue. There is nothing in the idea.log
(was tailing it) and their is nothing specific in the p4.output file.
The p4 integration works great until you need to look at the revision
graph and it needs to start the external p4v client. None of our idea
users here can get it to work. I had filed a bug early in the EA process
and it was fixed (version 7234 maybe??). I tested and it worked. Shortly
thereafter, it stopped working. I was trying to find out how the call is
being made to start the external p4v client so I can trey to debug why
it is not starting (idea thinks it was started successfully). I tested
by using an incorrect path and idea reported errors in a dialogue.
/*
* Copyright 2000-2007 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.idea.perforce.actions;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.DataKeys;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.vcs.FileStatus;
import com.intellij.openapi.vcs.FileStatusManager;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.EnvironmentUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.idea.perforce.PerforceBundle;
import org.jetbrains.idea.perforce.application.PerforceClient;
import org.jetbrains.idea.perforce.application.PerforceManager;
import org.jetbrains.idea.perforce.perforce.FStat;
import org.jetbrains.idea.perforce.perforce.P4File;
import org.jetbrains.idea.perforce.perforce.PerforceSettings;
import org.jetbrains.idea.perforce.perforce.connections.P4Connection;
import org.jetbrains.idea.perforce.perforce.connections.PerforceConnectionManager;
import java.io.IOException;
import java.util.List;
import java.util.ArrayList;
/**
* @author yole
*/
public class RevisionGraphAction extends AnAction {
private static final Logger LOG = Logger.getInstance("#org.jetbrains.idea.perforce.actions.RevisionGraphAction");
public void actionPerformed(AnActionEvent e) {
final Project project = e.getData(DataKeys.PROJECT);
final VirtualFile virtualFile = e.getData(DataKeys.VIRTUAL_FILE);
assert project
final P4Connection connection = PerforceConnectionManager.getInstance(project).getConnectionForFile(virtualFile);
final PerforceClient client = PerforceManager.getInstance(project).getClient(connection);
final PerforceSettings settings = PerforceSettings.getSettings(project);
List<String> cmd = new ArrayList<String>();
//create the command
cmd.add(settings.PATH_TO_P4V);
cmd.add("-p");
cmd.add(client.getServerPort());
cmd.add("-u");
cmd.add(client.getUserName());
cmd.add("-c");
cmd.add(client.getName());
if (SystemInfo.isWindows) {
cmd.add("-win");
cmd.add("0");
}
cmd.add("-cmd");
@NonNls StringBuilder command = new StringBuilder(getCommandName()).append(" ");
FStat fStat = null;
if (settings.ENABLED) {
final P4File p4File = P4File.create(virtualFile);
try {
fStat = p4File.getFstat(project, false);
}
catch (VcsException ex) {
Messages.showErrorDialog(project, PerforceBundle.message("failed.to.retrieve.p4.status.information",
FileUtil.toSystemDependentName(virtualFile.getPath()),
ex.getMessage()),
"Perforce");
return;
}
}
if (fStat
command.append(fStat.depotFile);
}
else {
command.append(FileUtil.toSystemDependentName(virtualFile.getPath()));
}
command.append("\"");
cmd.add(command.toString());
try {
Runtime.getRuntime().exec(cmd.toArray(new String[cmd.size()]), EnvironmentUtil.getEnvironment());
}
catch (IOException ex) {
Messages.showErrorDialog(project, PerforceBundle.message("p4v.run.failed", ex.getMessage()), "P4V");
}
}
@NonNls
protected String getCommandName() {
return "tree";
}
@Override
public void update(final AnActionEvent e) {
final Project project = e.getData(DataKeys.PROJECT);
final VirtualFile virtualFile = e.getData(DataKeys.VIRTUAL_FILE);
if (project == null
}
}