0

I have recently start using perforce.

in my organization we have tool that translates installation path to depot path where repos are , I want to know if we can set that translated path in the already open perforce from the commandline ?

which in turn also brings perforce (p4v) in focus.

Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197

1 Answers1

1

Perforce's solution for this is P4CONFIG. Do:

p4 set P4CONFIG=p4config.txt

Then, in the path you want to associate with a particular server ("repo" in gitspeak), create a file called p4config.txt that contains:

P4PORT=your_server:1666

The P4CONFIG file can also contain values for P4USER, P4CLIENT, etc.

It sounds like your tool should simply be modified to write its information to P4CONFIG files so that Perforce client tools can pick the information up automatically. Failing that, you might be able to script something around this tool that queries it and then converts its output to P4CONFIG settings.

Samwise
  • 68,105
  • 3
  • 30
  • 44
  • Samwise, this does not answer his initial question. I'm trying to do a similar thing. His problem is that he wants to take a path and have p4v focus that path on the opened p4v client. That is similar to the "Show in depot" functionality. – Ryan Glenn Oct 03 '22 at 18:20
  • @RyanGlenn That's just `p4v -s FILENAME` AFAIK? (See `p4v -help` for command-line flags to P4V.) – Samwise Oct 03 '22 at 18:54