tags:

views:

85

answers:

3

When I add new files to my project which is managed by Perforce, how can I get a list of the new files I've added (the ones Perforce does not know about yet) so I can make sure I don't miss any in my changeset?

Something like 'svn status | grep ^\?' or 'git status' to show the unstaged, unknown files.

Thanks! -Casey

+1  A: 

Find the similar question on SO and check the other answers and comments too. There is no direct command available from command-line. But you can use a powershell script or a GUI for it.

Teja Kantamneni
Guess I should have searched for 'untracked'... Well, at least this might improve the odds of the next poor developer finding it :)
Casey
Did that helped you? If you think this is the right answer, accept it so that the next person searching will know that it is what he needs to look. The green Checkmark next to answer is the one to accept the answer :-)
Teja Kantamneni
+1  A: 

The best answer is provided in the similar question linked to by Teja. However, if you want an easy command line solution that deals specifically with added files, you can do the following

find directory -type f | p4 -x- add

for normal files, and

find directory -type l | p4 -x- add

for links. (Letter 'el', not 'one' in above command)

Perforce simply refuses to add any files that are already in version control. The only problem is that this adds everything, including binary files.

Chance
A: 

For P4V, right-click on a folder in the workspace tree and click "Find File...". In "All or part of a file name", type "*.cs". Then sort by filetype - new files will have filetype "none".

Unfortunately there doesn't seem to be a way to apply multiple filters, e.g., "*.cs; *.aspx". So you have to filter one filetype at a time. Also, you have to be patient if there are thousands of files - the sorting mechanism won't work properly until the asynchronous find process has completed.

(The "Reconcile Offline Work..." option isn't working for me. I'm using P4V June 2009.)

Rizal
@Rizal I'm sure that this guy was *not* looking for a GUI solution. Sorry, no vote :)
Sorin Sbarnea