3

A parent project is throwing the following error when trying to integrate a child project.

Exception: < FILE > - can't integrate (already opened for delete)

Under what scenario does this occur?

crk
  • 617
  • 1
  • 8
  • 12

2 Answers2

2

When Perforce integrates changes, it tries to resolve the incoming changes in the files in the local workspace. This exception is basically saying that it can't attempt to resolve the changes for the given file, since the file has been marked as being deleted on the local workspace, so it has no place to resolve it.

There are flags you can pass to the integrate command to allow the integration to proceed anyway. However, I've found it's generally not a good idea to integrate changes on top of in-progress changes, so I would recommend finishing (or shelving) your in-progress changes, then attempting the integration.

Caleb Huitt - cjhuitt
  • 14,785
  • 3
  • 42
  • 49
  • When does "marked as being deleted in the local workspace" happen? I'm trying to reproduce this as I'm hitting this in our automated build systems. I tried the cases of (a) ChildA and ChildB deleting the same file and submitting. Then Parent integrating both projects together. (b) Parent sync-ing a deleted file from its parent and then integrating one of the child projects that have deleted the same file too. But, I couldn't reproduce the error. – crk Jul 06 '12 at 18:25
  • @crk: Marked as deleted happens when you tell perforce that you are deleting the file, but before you submit the changes. It will remove the file from the local workspace and mark it as pending deletion in a changelist, but like the other pending changes, nothing is permanently saved until you submit the changes. – Caleb Huitt - cjhuitt Jul 10 '12 at 18:33
1

This question comes up first on google when searching for "already opened for delete", so I thought I might post a way around this if you're not integrating, just trying to undo your own delete:

cp file file.bak  # Make a backup of the file
p4 revert file    # Revert the file
mv file.bak file  # Recover from backup
p4 edit file      # Open the file for edit
Alexander Taylor
  • 16,574
  • 14
  • 62
  • 83