質問

I have multiple workspaces in Perforce, say w1, w2, w3,... all with different mappings that may or may not point to different folders in the same depot(s). I want to write a .bat file that syncs them automatically and in sequence as not to put stress on the server.

Optimally, I want to start this off automatically and have it first sync w1, after it's done have it sync w2, and so on. Assume I don't have any environment variables set, so if they're necessary, please let me know.

How would go about doing this?

役に立ちましたか?

解決

If you don't want to set up any P4 environment variables, you could use the global options and do something like this:

p4 -u <user> -P <password> -p <port> login
p4 -u <user> -P <password> -p <port> -c <workspace1> sync //path/to/sync/...
p4 -u <user> -P <password> -p <port> -c <workspace2> sync //other/path/...
p4 -u <user> -P <password> -p <port> -c <workspace3> sync //yet/another/path/...

If you set up the P4USER, P4PASSWD, and P4PORT P4 environment variables (see the p4 set command), then you could clean it up a little to look like this:

p4 login
p4 -c <workspace1> sync //path/to/sync/...
p4 -c <workspace2> sync //other/path/...
p4 -c <workspace3> sync //yet/another/path/...
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top