如何在 Perforce 中快速查找/删除所有空变更列表?
我想知道尝试删除已提交的更改列表有什么意义,因为已提交的更改列表不应该为空。
但后来我正在使用教程库,并在整个分支上使用 obliterate 命令,我可以看到在某些情况下您可能会得到空的已提交变更列表(需要使用 -f 标志删除)。
但是,我不知道如何使用命令行找到它们,因为我不知道如何查找没有关联文件的更改列表。
有没有简单的方法可以做到这一点?
谢谢,
托马斯
I was wondering what could be the point in trying to delete committed changelists, because a committed changelist is not supposed to be empty.
But then I am playing with the tutorial depot, and using the obliterate command on a whole branch, I can see there are situation where you can end up with empty committed changelists (that need deletion with the -f flag).
However, I don't know how to find them with the command line, as I don't know how to look for changelists with no files associated with.
Is there an easy way to do that ?
Thanks,
Thomas
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
啊!
在问这个问题之前我应该浏览更多文档...
http://public.perforce.com/wiki/Perforce_Command_Line_Recipes
Duh。
托马斯
Ah !
I should have browse more documentation before asking this...
http://public.perforce.com/wiki/Perforce_Command_Line_Recipes
Duh.
Thomas
要简单地查找所有空的已提交变更列表而不删除它们,您可以比较这两个命令的输出:
p4changes -s Submitted
- allchangelistsp4changes-s已提交 //...
- 具有关联文件的所有更改列表例如,在 Windows PowerShell 中,运行
To simply find all empty submitted changelists without deleting them, you can compare the output of these two commands:
p4 changes -s submitted
- all changelistsp4 changes -s submitted //...
- all changelists with associated filesIn Windows PowerShell, for example, run
由于我在 Windows 上,我创建了一个小脚本,在 PERL 中执行完全相同的操作,而不是 Shell、powershell 或 px :) :
请注意,事实上,在所有情况下,它都不是一个非常聪明的脚本:它尝试删除绝对是每个提交的变更列表,并且强制阻止这样做,因为如果文件与其关联,您将收到错误。
我想脚本的结果应该发送到日志并进行解析,以便仅突出显示相关行。
运行该脚本将产生类似于以下内容的输出:
Cheers,
Thomas
As I am on Windows, I have created a little script doing the exact same thing in PERL, rather than Shell, powershell or px :) :
Note that in fact, in all cases, it's not a very clever script: It tries to delete absolutely every submitted changelist, and is prevented by perforce to do so, because if files are associated with it, you will get an error.
I suppose the result of the script should be sent to a log, and parse, so that only the relevant lines are highlighted.
Running the script will produce an output similar to:
Cheers,
Thomas
这是仅 DOS CMD 版本。只需替换%p4streamsUser%即可。
我使用的是 Windows 7 机器。这将适用于其他几个版本的 Windows/DOS。
Here is a DOS CMD only version. Just replace %p4streamsUser%.
I'm on a Windows 7 machine. This will work on several other versions of windows/DOS.