SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Topic started by: nelsonhf on October 07, 2013, 08:22:47 pm

Title: Cannot checkout file in Perforce.
Post by: nelsonhf on October 07, 2013, 08:22:47 pm
I have a workspace that I imported from MS Visual Studio 2008. It is stored in Perforce and everything works fine (even the Perforce plug-in for MVS).

If I try to edit in Slick Edit a file that is not checked out, I receive the expected message "This command is not allowed in read only mode"; if I click on "Change RW...", I have the option (among others) to "Check out the latest version" (still, as expected).

Clicking "OK", I receive the error: "Could not get current version of file '<filename>'" followed by "Path '<filename>' is not under client's root '<path>'".

Well... It is actually not in the path because it belongs to a different Perforce workspace...

There must be a way to indicate which Perforce workspace the files in a particular project/solution/workspace are.

I looked around in SlickEdit configuration files and in the forums but could not find anything about this (maybe I didn't look hard enough). Can anyone please help me?

Thanks
Title: Re: Cannot checkout file in Perforce.
Post by: Dan on October 07, 2013, 08:28:52 pm
I haven't had any of our users run into this particular problem.  If you run "p4 client" at a console window, it will launch an editor with several fields for this information.  Either the local directory, or the Perforce workspace, need to be changed.  Perforce can be a little tricky this way.  When you close the editor, that will set the information in perforce.

Hope this helps.
Title: Re: Cannot checkout file in Perforce.
Post by: nelsonhf on October 07, 2013, 09:42:59 pm
I went playing with "p4 client" and got burned :P. I changed the copy of one of my workspaces to another! (luckily, I had a backup)

Hint: DO NOT use p4 client -t workspace1. It will override the definition of the current workspace!  :o

But I remember that I did something sometime ago to change the workspace.

The trick is to use "p4 set P4CLIENT=<workspace>" to change the current (default) workspace.

Is there a way to link a SlickEdit project to a Perforce workspace and set P4CLIENT when that project is opened? (you'll still get weird bugs when someone else modify P4CLIENT, but this is Perforce's fault...).

Thanks
Title: Re: Cannot checkout file in Perforce.
Post by: chrisant on October 08, 2013, 03:43:59 am
"p4 set P4CLIENT=blah" is ok if you only have one client on the machine, but it sounds like the original poster has multiple clients on the same machine.

Look into using P4CONFIG instead.  Along with setting P4CONFIG appropriately (see "p4 help variables"), also put a P4.INI file in the root of the client's local tree and put in it the variables that should be in effect for that particular client.  Such as P4PORT, P4CLIENT, etc.
Title: Re: Cannot checkout file in Perforce.
Post by: nelsonhf on October 08, 2013, 03:03:06 pm
Thanks!

Exactly what I needed. A minor correction, though: at least in my system (Windows 7), the reference to P4CONFIG is in p4 help environment (not variables...)

To make Perforce work in different workspaces (both SlickEdit and Perforce, in this case!):


You don't even have to reload the (SlickEdit) workspace for this to work!

I think these steps are all you need, "It worked on my computer"C