Jump to content


Workspace from path


  • Please log in to reply
2 replies to this topic

#1 mduffor

mduffor

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 10 September 2018 - 10:14 PM

Is there any way with the p4 command to get the workspace view from a give file path on disk?

I have multiple workspaces, checked out to different file trees, and within a given tree I need to run a command line command that queries the latest changelog number for files in that path.  If I run "p4 -z tag where /path/to/directory/on/local/drive" then it fails if I'm not already logged into the workspace view that maps there.  It will throw the error "Path xxxx is not under client's root xxxxx"

Advice?

Thanks!
Michael Duffy

#2 P4Reg

P4Reg

    Advanced Member

  • Staff Moderators
  • 92 posts

Posted 11 September 2018 - 08:01 AM

Does it help specifying the client with -c:

p4 -c client_name where /path/to/directory/on/local/drive

(it will still fail with a "Client 'client-name' can only be used from host 'client-host' if the client is restricted by host and is located on a different machine)

#3 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 588 posts

Posted 11 September 2018 - 02:33 PM

Set up a P4CONFIG file in each workspace root:

https://www.perforce...f/P4CONFIG.html

This will make it so that your P4CLIENT is automatically set to the right value for the directory that you're in.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users