Reputation: 35943
With Perforce, I have the following situation:
foo.txt
in client client_a
, opened it for addfoo.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?
Upvotes: 12
Views: 12549
Reputation: 6978
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.Upvotes: 15