views:

173

answers:

2

I want to safe resolve all the files in a pending changelist.

Currently, the only way I know to do this is to pass p4 a list of files.

SET CHANGE_NUMBER=default
SET CHANGE_FILES=files.txt
DEL %CHANGE_FILES%
for /f "tokens=1 delims=#" %%a in ('p4 opened -c %CHANGE_NUMBER%') DO ECHO %%a>>%CHANGE_FILES%
p4 -x %CHANGE_FILES% resolve -as

Is it possible with a single p4 command?

+2  A: 

p4 resolve can take a list of files, so I think you can write it like so (Unix-like shell syntax assumed):

p4 resolve -as `p4 opened -c <change-number>`

using the backquote syntax to insert the result of running the p4 opened command, where <change-number> is the number of your changelist.

(If you don't have any files opened in any other changelist, then you should be able to use the simpler p4 resolve -as //...).

aem
p4 can also eat input args from stdin. 'p4 opened -c <change-number> | p4 -x - resolve -as'
Epu
A: 

Also p4 resolve -am (acccept merge) is useful for ones you can use the merged version. Other options are -ay (accept yours), -at (accept theirs).

Brian Carlton