Perforce - switch to workspace from command line -


i asking how switch client1 client2 client1 belongs stream1 , client2 belongs stream2.

what looking same being in p4v , right click on workspace , selecting 'switch workspace'

note, if current workspace client1 , use:

p4 client -s -s //depot/stream2 

or

p4 client -s s //depot/stream2 client2 

it won't change workspace in p4v gui.

any idea?

thanks!

there several different concepts here.

you can have single workspace, or can have multiple workspaces.

each workspace has own root directory on workstation, , own copy of whatever files have sync'd.

if have single workspace, can switch workspace , forth 1 stream another, using 'client -s' command switch stream workspace bound. way, can alternate between working on 1 stream, , working on another, using single workspace. in recent versions of perforce server (2015.1+), there 'p4 switch' command makes process simpler still.

switching single workspace 1 stream on command line using 'client -s' equivalent of dragging , dropping workspace icon old stream new stream in stream graph, more or less.

you can have multiple workspaces, each independent set of files sync'd, , can work each workspace separately. on command line, switch 1 workspace another, change way tell 'p4' command client want use, can p4client variable or '-c' flag client. example:

p4 -c client1 sync 

vs

p4 -c client2 sync 

tells p4 client sync first client1, client2. alternately, can do:

p4 set p4client=client1 p4 sync 

then

p4 set p4client=client2 p4 sync 

to accomplish same effect (switching between 1 workspace , other @ command line).

p4v, however, has own notion of "current workspace", separate command line, , don't believe changing p4client variable enough perform p4v operation of "right click on workspace , selecting 'switch workspace'".

the closest thing can command-line command changes workspace p4v considers current workspace, think, invoke different copy of p4v command line, , specify different client name when so, described here: http://www.perforce.com/blog/100114/p4v-secrets-calling-p4v-command-line

but think new p4v window other workspace, rather changing current workspace of current p4v window.

another possibility try use 1 of windows gui automation tools, such autoit (https://www.autoitscript.com/site/), create script use connection menu on menu bar , operate switch workspace... dialog via autoit.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -