3

我正在创建一些与 Perforce 交互的构建脚本,我想标记删除一些文件。使用命令行的 P4 语法到底是什么?

4

4 回答 4

9
p4 delete filename

(p4帮助删除的输出)

delete -- 打开现有文件以将其从 depot 中删除

p4 删除 [ -c changelist# ] [ -n ] 文件...

Opens a file that currently exists in the depot for deletion.
If the file is present on the client it is removed.  If a pending
changelist number is given with the -c flag the opened file is
associated with that changelist, otherwise it is associated with
the 'default' pending changelist.

Files that are deleted generally do not appear on the have list.

The -n flag displays what would be opened for delete without actually
changing any files or metadata.
于 2008-10-03T19:53:52.100 回答
7

教人钓鱼:

  • p4 help - 为您提供一般命令语法
  • p4 help commands - 列出命令
  • p4 help <command name>- 提供特定命令的详细帮助
于 2008-10-03T19:57:20.580 回答
2

http://www.perforce.com/perforce/doc.062/manuals/boilerplates/quickstart.html

删除文件

要从 Perforce 服务器和您的工作区中删除文件,请发出 p4 delete 命令。例如:

p4 delete demo.txt readme.txt

指定的文件将从您的工作区中删除并标记为从服务器中删除。如果您决定根本不想删除这些文件,请发出 p4 revert 命令。当您恢复为删除而打开的文件时,Perforce 会将它们恢复到您的工作区。

于 2008-10-03T19:54:15.920 回答
0

承认 - 需要(少量)步骤才能在与您的安装相匹配的版本中在线找到(优秀的!)Perforce 用户指南,并获取包含您需要的信息的章节。

每当我发现自己需要有关 p4 命令行客户端的任何信息时,我都会依赖 Perforce 内置的帮助。访问它再简单不过了:

  1. 在命令行上,输入p4

这可以让您了解 Michael Burr 在他的回答中显示的信息(以及更多信息)。如果您没有立即获得帮助屏幕,则说明我们的客户端配置有问题,例如 P4PORT 设置不正确。你显然需要先解决这个问题。

于 2010-02-22T22:16:13.110 回答