Perforce p4 - IJ not taking credentials from preference settings?

I'm setting up IDEA 7.0.3 under Mac OS X 10.5.4 in a shop with both Mac and Windows versions already in place. I've configured Perforce with the same credentials that p4v uses. Test connection succeeds. Whenever I right-click on any file and Perforce > Edit the following error appears:

Error: Access for use 'mickey' has not been enabled by 'p4 protect'.

With p4v I can Check Out the same file.

mickey is my Mac OS X login username, the Perforce client workspace credentials are different, like MICK_DEV.

What am I not understanding here? Help gratefully accepted.

4 comments

Hello Mickey,

How exactly did you configure Perforce? If the "Use P4CONFIG or default connection"
checkbox is unchecked and the "User" field is fiiled, that user name will
be used for all Perforce operations.

I'm setting up IDEA 7.0.3 under Mac OS X 10.5.4 in a shop with both
Mac and Windows versions already in place. I've configured Perforce
with the same credentials that p4v uses. Test connection succeeds.
Whenever I right-click on any file and Perforce > Edit the following
error appears:

Error: Access for use 'mickey' has not been enabled by 'p4 protect'.

With p4v I can Check Out the same file.

mickey is my Mac OS X login username, the Perforce client workspace
credentials are different, like MICK_DEV.

What am I not understanding here? Help gratefully accepted.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Good day, Dmitry.

I have it checked because unchecked the Test Connection fails (although I've copied the FQDN string into my terminal and I can ping the machine, so I know there's no typos). Checked, T. C. succeeds. Does that help?

/off to read up on p4config...

0

Well, one step forward: I've created a foo.p4env file and pointed $P4CONFIG to it. I can now check "Use P4CONFIG..." and Test Connection works.

However, when I try to Perforce > Edit a file I still get the "Perforce is unavailable" error, which is what started me down this path.

0

It turns out that the last remaining hurdle seemed to be a typo in the pointer to my p4env file. This is what I noted in our company wiki:

-


There seem to be several ways of configuring the Perforce CMS (content management system), some of which won't share information with cooperating applications.

The canonical way of setting up Perforce environment variables (on UN*X, including Mac OS X) is to edit the run-commands (rc) file for the login shell you've chosen to use. For example, since I use tcsh I edit the ~/.tcshrc, and include the lines

setenv P4PORT perforce.foo.com:1666
setenv P4USER username
setenv P4PASSWD password
setenv P4CLIENT previously_created_client_spec

Here's what I learned while trying to make IntelliJ IDEA work: move the environment-setting commands into a .p4env file and point the P4CONFIG variable at the file. This way one can also quickly switch between client workspaces. So, ~/.tcshrc now says:

setenv P4CONFIG ~/client_spec_foobar.p4env

and ~/client_spec_foobar.p4env contains:

P4PORT=perforce.foo.com:1666
P4USER=username
P4PASSWD=password
P4CLIENT=previously_created_client_spec

Now IntelliJ IDEA picks up the correct information (when, in the Configure CMS / Perforce settings pane) the "Use P4CONFIG" checkbox is set), which must be changed in only one location (better maintenance).

Test this set-up by trying a p4 sync at the root of your source-code hierarchy. p4 info only tests the network connection. If you see an error of the form 'error: Access for user ']]>' has not been enabled by 'p4 protect' double-check that environment variable points to the file with the command-line ls $P4CONFIG.

If IDEA complains "Perforce is unavailable" do the same double-check.

IDEA also needs a path to the p4 program. On Mac OS X (Darwin) it's /usr/local/bin/p4.

0

Please sign in to leave a comment.