Priority
Normal
Type
Bug 
State
Fixed 
Assignee
Dmitry Jemerov 
Subsystem
Version Control. Perforce 
Affected versions
Fixed in
Fixed in build
Next build 
Build
7318
Fixed in build
7653
Severity
0
  • Submitted by   Chuck Canning
    2 years ago (03 Oct 2007 22:38)
  • Updated by   root
    3 weeks ago (17 Jan 2010 19:53)
  • Jira: IDEA-41331
    (history, comments)

IDEA-41331

p4v does not start when doing revision graph or time-lapse...

0
This appears to be a regression because when the ability to configure p4v was added, this feature worked for me (this bug was also assigned by me). Now, I get no errors, but p4v does not run. The menu options appear to do nothing.

Environment: Linux

Issue was resolved
Comments (5)
 
History (1)
 
Links
 
Serge Baranov
  Serge Baranov
26 Dec 2007 22:20
(2 years ago)
#permalink
Customer's comment:

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.
Chuck Canning
  Chuck Canning
16 Jan 2008 08:11
(2 years ago)
#permalink
The arguments to exec are parsed using a StringTokenizer using " " so the command is being split.
Chuck Canning
  Chuck Canning
16 Jan 2008 08:12
(2 years ago)
#permalink
This should fix the issue:

/*
* 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 = null;
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 StringUtil.isEmpty(fStat.depotFile)) {
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
virtualFile == null
= FileStatus.ADDED && fileStatus = FileStatus.IGNORED);
}
}
Chuck Canning
  Chuck Canning
29 Jan 2008 05:16
(2 years ago)
#permalink
Can you re-open this issue. The command.append("\""); needs to be removed. Problem with copying code from one class to another. It adds an extra " to the end which it doesn't like.
Zak Jacobson
  Zak Jacobson
23 May 2008 00:57
(20 months ago)
#permalink
I second that, the issue is not resolved.