Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing workspace clobber option directly from Perforce command line

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.

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.

Please tell me the specific command which directly changes noclobber to clobber without using p4v or without editing P4CONFIG.

like image 723
Niyojan Avatar asked Apr 29 '13 11:04

Niyojan


2 Answers

If you're trying to avoid repeatedly opening a text editor, you can accomplish your goal with a little bit of sed, like this:

p4 client -o | \
sed 's/ noclobber/ clobber/' | \
p4 client -i
like image 154
Eric Miller Avatar answered Oct 16 '22 05:10

Eric Miller


It's pretty easy to script this with Perl, Python, Ruby, or even Powershell. Here's a one-liner in Powershell:

p4 client -o | %{$_ -replace "noclobber", "clobber"} | p4 client -i

like image 20
randy-wandisco Avatar answered Oct 16 '22 06:10

randy-wandisco