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

前端 未结 16 2123
独厮守ぢ
独厮守ぢ 2020-12-02 06:44

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

16条回答
  •  悲&欢浪女
    2020-12-02 07:45

    Ahh, one of the Perforce classics :) Yes, it really sucks that there is STILL no easy way for this built into the default commands.

    The easiest way is to run a command to find all files under your clients root, and then attempt to add them to the depot. You'll end up with a changelist of all new files and existing files are ignored.

    E.g dir /s /b /A-D | p4 -x - add

    (use 'find . -type f -print' from a nix command line).

    If you want a physical list (in the console or file) then you can pipe on the results of a diff (or add if you also want them in a changelist).

    If you're running this within P4Win you can use $r to substitute the client root of the current workspace.

提交回复
热议问题