Jump to content

Workspace from path

  • Please log in to reply
2 replies to this topic

#1 mduffor



  • 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"


Michael Duffy

#2 P4Reg


    Advanced Member

  • Staff Moderators
  • 98 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


    Advanced Member

  • Members
  • PipPipPip
  • 782 posts

Posted 11 September 2018 - 02:33 PM

Set up a P4CONFIG file in each workspace root:


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