问题描述
如何从命令行更改 perforce 规范?我想要做的是,我有一个工作区,其 clobber 选项设置为 noclobber
(默认值).现在我想把它改成clobber
.
How to change perforce specs from command line?What I want to do is, I have a workspace whose clobber option is set to noclobber
(default value). Now I want to change it to clobber
.
我知道我可以直接从 p4v
中完成,但我不想要那样.我也知道如果我运行 p4 client
,它会在文本编辑器中打开 P4CONFIG 文件,在那里我可以将 noclobber
更改为 clobber
并保存文件并完成了,但我也不想要那个.
I know I can do it directly from p4v
, but I don't want that. I also know that if I run p4 client
, it will open P4CONFIG file in text editor, where I can change noclobber
to clobber
and save the file and it's done, but I also don't want that.
请告诉我不使用p4v
或不编辑P4CONFIG直接将noclobber
改为clobber
的具体命令.
Please tell me the specific command which directly changes noclobber
to clobber
without using p4v
or without editing P4CONFIG.
推荐答案
使用 Perl、Python、Ruby 甚至 Powershell 编写脚本非常容易.这是 Powershell 中的一行代码:
It's pretty easy to script this with Perl, Python, Ruby, or even Powershell. Here's a one-liner in Powershell:
p4 客户端 -o |%{$_ -replace "noclobber", "clobber"} |p4 客户端 -i
这篇关于直接从 Perforce 命令行更改工作区破坏选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!