Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find untracked files in a Perforce tree? (analogue of svn status)

Anybody have a script or alias to find untracked (really: unadded) files in a Perforce tree?

EDIT: I updated the accepted answer on this one since it looks like P4V added support for this in the January 2009 release.

like image 353
David Joyner Avatar asked Aug 12 '08 21:08

David Joyner


People also ask

How to find local files in Perforce?

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.

What does p4 status do?

The p4 status command finds unopened files in a client's workspace and detects the following three types of inconsistencies between your workspace and the depot: Files present in the depot, present in your have list, but missing from your workspace. By default, these files are then opened for delete .


2 Answers

EDIT: Please use p4 status now. There is no need for jumping through hoops anymore. See @ColonelPanic's answer.

In the Jan 2009 version of P4V, you can right-click on any folder in your workspace tree and click "reconcile offline work..."

This will do a little processing then bring up a split-tree view of files that are not checked out but have differences from the depot version, or not checked in at all. There may even be a few other categories it brings up.

You can right-click on files in this view and check them out, add them, or even revert them.

It's a very handy tool that's saved my ass a few times.

EDIT: ah the question asked about scripts specifically, but I'll leave this answer here just in case.

like image 133
tenpn Avatar answered Sep 20 '22 07:09

tenpn


On linux, or if you have gnu-tools installed on windows:

find . -type f -print0 | xargs -0 p4 fstat >/dev/null 

This will show an error message for every unaccounted file. If you want to capture that output:

find . -type f -print0 | xargs -0 p4 fstat >/dev/null 2>mylogfile 
like image 35
Mark Harrison Avatar answered Sep 21 '22 07:09

Mark Harrison