Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

p4 - how to edit a file that's opened for add or not in client

I am new to p4, so some explanations will be much appreciated and more helpful than the answer itself.

I want to edit a file foo.txt. I am in the directory where this file lives.

My attempts to edit foo.txt have been the following:

$p4 sync
File(s) up-to-date.

$p4 edit foo.txt
foo.txt - files(s) not on client

$p4 add foo.txt
//depot/directory/foo.txt#1 - opened for add
$p4 edit foo.txt
//depot/directory/foo.txt#1 - can't edit (already opened for add)

The fact that there isn't much info on this when Googling this issue indicates that it's probably trivial.

like image 382
Bowser Avatar asked Dec 22 '14 18:12

Bowser


1 Answers

If a file does not exist in perforce, you cannot edit it. If a file is currently opened for add, you don't need to edit it. When you submit the change that contains the add, the contents of the file at that time are used. Once you have submitted the change adding the file, any time you want to subsequently modify the file, you would do p4 edit foo.txt to add it to a changelist, make changes, and then submit that change.

like image 102
MuertoExcobito Avatar answered Nov 04 '22 22:11

MuertoExcobito