Author Topic: Version control: Perforce History  (Read 5219 times)

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Version control: Perforce History
« on: September 03, 2014, 09:36:50 PM »
Under "Version Control -> History for FILE"


I selected one of the versions, chose the drop-down on "Diff" for "Diff version 9 with version 8".
Then Slick hung for a minute or three.


Finally, an error dialog appeared showing "Perforce client error: Connect to server failed ..."


Slick was running P4 in such a way that P4 was trying to talk to the wrong server.
I have "P4CONFIG=sd.ini" which makes P4.exe look for a file named "sd.ini", (recursively upwards toward root).
That file contains server and client connection information (like P4PORT, etc).
This lets P4 always find the correct client based on the location of the local file you are working with.




When Slick ran P4, it must have set the CWD someplace not in the project because P4 used the default configuration (Try "p4 set" from the cmd line).
For other P4 commands, Slick always seems to run them from the same directory where the file is.
It should do so in this case as well.


Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2897
  • Hero Points: 153
Re: Version control: Perforce History
« Reply #1 on: September 04, 2014, 12:17:46 PM »
Can you tell if it was using the editor's CWD?

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: Version control: Perforce History
« Reply #2 on: September 04, 2014, 08:19:52 PM »

It runs p4.exe twice.
First: p4.exe files E:\src......\Myfile.c
Second: p4.exe print //depot/branch/....../Myfile.c


Both times, apparently with the correct CD.
The second instance is hanging for a long time trying to connect to the wrong server.


I found, using PROCMON.exe, that the only significant difference is that the Second time the ENV VAR "PWD" is set.
PWD isn't a normal Windows environment variable.
PWD is set to "//depot/branch/......"
So that isn't even a legal path, but perforce is attempting to access:
   \\depot\branche\.......\sd.ini
And it does this several times as it tried to walk up the directory tree looking for "sd.ini".




Look here, under "esoteric": http://filehost.perforce.com/perforce/r97.3/doc/cmdguide/html/envvars.htm




Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2897
  • Hero Points: 153
Re: Version control: Perforce History
« Reply #3 on: September 04, 2014, 08:38:08 PM »
We do set PWD, but it's supposed to be set to the directory a command is being run in (there are cases where p4.exe insists on it, regardless of the CWD).  It should be set to a local directory though, not what you have there.

This is all trying to get history?

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: Version control: Perforce History
« Reply #4 on: September 04, 2014, 08:40:48 PM »
Yes.


PWD isn't set for the 1st p4 command.


I've never had p4 need "PWD", which operations seem to require it?


Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2897
  • Hero Points: 153
Re: Version control: Perforce History
« Reply #5 on: September 04, 2014, 08:45:18 PM »
I honestly don't remember.  It might be that it was UNIX where it was needed.  I set it/ reset it anywhere I mess with the current directory.

I'll have to trace the history command and see what it's doing.

Could you set def_svc_logging to 1, and then run the command, set it back to 0, and then send me the resulting log (configpath)/logs/svc.log?

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2897
  • Hero Points: 153
Re: Version control: Perforce History
« Reply #6 on: September 05, 2014, 12:51:48 PM »
Is it OK if I send you something with some debug in it?  I already have your email address.

shadm

  • Community Member
  • Posts: 49
  • Hero Points: 0
Re: Version control: Perforce History
« Reply #7 on: September 05, 2014, 02:34:41 PM »
This sounds slightly familiar.  Do you remember this bug in v18?

http://community.slickedit.com/index.php/topic,8983.msg38439.html#msg38439

Thought I'd post, just in case it brings back some memories.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2897
  • Hero Points: 153
Re: Version control: Perforce History
« Reply #8 on: September 05, 2014, 02:49:59 PM »
I think that thread may be how we eventually led to setting PWD.

In OP's case here, I think the problem is that PWD is getting set to something invalid.

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: Version control: Perforce History
« Reply #9 on: September 05, 2014, 02:57:57 PM »
Sure, send away.