Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show new files in Perforce workspace?

Tags:

perforce

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

like image 380
Casey Avatar asked Aug 24 '10 18:08

Casey


People also ask

How do I get latest from Perforce?

To get the latest revision, right-click the file and choose Get Latest Revision. To get a previous revision, right-click the file and choose File History.

How do I add files to a Changelist?

To add files to the depot, create the files in your workspace, then issue the p4 add command. The p4 add command opens the files for add in the default pending changelist. The files are added when you successfully submit the default pending changelist.

How do I search for a file in P4V?

Find files in a depot or workspaceGo to Search > Find File. The Find File tab opens in the right pane. On the Find File tab in the right pane, under Search in, enter the directory path you want to search. You can drag and drop the file path from the Depot or Workspace Tree in the Tree pane.


2 Answers

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.

like image 24
Chance Avatar answered Sep 20 '22 17:09

Chance


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.

like image 107
Teja Kantamneni Avatar answered Sep 17 '22 17:09

Teja Kantamneni