Reputation: 1606
I am quite new to perforce and I am facing an issue concerning the P4HOST value.
Here's the situation : I have one, let's say, classic setup with a connection, a workspace name, etc. and a host set to the local machine name. Everything works perfectly.
I have another connection with quite the same but the host should not be the local machine name to connect to the correct server. If I set the host to my local machine I am referring to a bad server. If I set the host in p4v I get this error : Client can only be used from host. and it breaks everything for this setup.
To fix this I tried to set the host value manually with this command : p4 set P4HOST=myhost and it works well unless I can't access my other repositories because, I think, it's a global value and as other configurations are not using a specific host it fails.
Anyway, according to my configurations what can I do ? Is it possible to manually set P4HOST for a specific setup without affecting everything ? Is there another way ?
Thank you very much !
Edit : I don't know if this is useful but the classic host I am using is like myname-PC and the other one which is failing is something like apath/toanotherpath
Upvotes: 2
Views: 6387
Reputation: 71454
P4HOST's job is to keep you from using the same workspace from different machines. If you use the same workspace from different machines, you're going to have a bad time. (Why exactly is its own topic -- for purposes of this answer, just take my word for it that you do not want to use one workspace from different client machines. Dead rising from their graves, cats and dogs living together, that kind of thing. Bad time.)
When you create a workspace, its Host: value is set to your current P4HOST value (which defaults to the client machine hostname). If you try to use that workspace with a DIFFERENT host value, it's a strong clue to the server that you're trying to use it from more than one machine (which, as established, is a Bad Time), and so the server gives you that error (to try to stop you before you have a BAD TIME).
So it sounds like this workspace that you're trying to use was created on a different client host machine -- which means that using that workspace is probably going to lead to a bad time. Create a new workspace for the client machine that you're on.
Alternatively (and only if you're really sure it's the right thing to do), you can change the Host in that workspace to match your current machine. Note that if you find yourself having to do this more than once, you're probably in the process of generating a bad time for yourself.
Upvotes: 3