brain56
brain56

Reputation: 2711

How to check if a file is already marked for add?

I'd like to check if a file is already locally marked for add, without adding the said file. Is this check possible with a Perforce command?

Upvotes: 1

Views: 824

Answers (3)

Ashish Malhotra
Ashish Malhotra

Reputation: 63

I personally use below two commands:

p4 diff -sa  // to show list of all opened files

p4 diff -se  // to show list of all files that are with changes but not opened

Upvotes: 1

ChrisF
ChrisF

Reputation: 137158

If you use the -n option it will preview the add operation telling you which files would be added but not actually adding the file.

Source

p4 add -n testfile

Upvotes: 1

brain56
brain56

Reputation: 2711

You can check if a file is marked for add by running the fstat command. If the command output contains the string "action add", that means the file is already marked for add.

Upvotes: 0

Related Questions