With Perforce, I have the following situation:
foo.txt
in client client_a
, opened it for add
foo.txt
in client_a
, unshelved it in client_b
foo.txt
is open for add in client_b
foo.txt
in client_a
Now my question concerns how I can cleanup foo.txt
in client_b. Maybe it has a one line change from the depot version that I'd like to keep. Ideally I'd like to do a resolve operation against the newly checked in file, but I'm not allowed to do this because it's open for add.
Now I have this file foo.txt#1 - add change default
in my client.
I can't reopen the file ('nothing changed'), I can't diff it vs the depot ('file not open for edit'), I can't resolve it against the depot ('no files to resolve'), I can't open it for edit ('can't edit, already opened for add').
Is there any way to make perforce reopen this as edit instead of add? I know I can copy it to a temp file, revert, reopen for add, and then recopy the temp file back over, but this seems rather unelegant. Is there any command that can do what I want, or is there a good reason I'm not seeing why it's disallowed?
When used with the default changelist, p4 submit brings up a form for editing in the editor defined by the EDITOR (or P4EDITOR ) environment variable. Files can be deleted from the changelist by deleting them from the form, but these files will remain open in the next default changelist.
To add files to the depot, create the files in your workspace, then issue the p4 add command. The p4 add command opens the files for add in the default pending changelist. The files are added when you successfully submit the default pending changelist.
Description. p4 add opens files within the client workspace for addition to the depot. The specified files are linked to a changelist. The command can add files to a new, empty depot or to a depot that already contains files. The files are added to the depot when the changelist is committed with p4 submit .
Only slightly more elegant than the comment in your last paragraph, but you should be able to:
foo.txt
in client_b
. Since it was marked for add the file will remain on the disk with no changesfoo.txt
with -k
. This makes the server think you have the latest revision without modifying your local file.foo.txt
for edit. Diff'ing against the have revision should show the changes.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With