1

I want to merge some specific changes from one part of a Perforce depot to another. The trouble is, the source folder is deleted at HEAD. This means that when I go to add the source folder in the Merge/Integrate dialog, it doesn't show up in the "Browse for Files/Folder" window.

Is it possible to do the merge?

detly
  • 29,332
  • 18
  • 93
  • 152

2 Answers2

1

Yes, but just not from the head revision of a deleted file. Since the head revision of a deleted file is, well, deleted, trying to branch it is essentially trying to branch from something that doesn't exist. You get nothing. You have to branch from a revision prior to the deletion. Restrict your integration operation to a revision number, date, changelist, etc. at which your file(s) still existed. This can be done by applying a filter to your integration operation.

enter image description here

raven
  • 18,004
  • 16
  • 81
  • 112
  • I still can't select the deleted source for the integration though. – detly May 29 '13 at 23:14
  • By that do you mean you can't see the file(s) in the depot tree of P4V? If so, you need to turn on the option to "Show Deleted Depot Files" (via the filter menu at the top right of the depot tree pane). – raven May 30 '13 at 14:54
  • No, I mean that in the image above, when you click "Add..." to select the source for the merge, anything deleted at HEAD is not selectable. – detly May 30 '13 at 23:25
  • @detly: Don't worry that you can't see them. If you sycn a folder to a point in time when the files existed, the files in that folder will be integrated. If you really want to see the old revisions of those deleted files, you'll have to do as I said in my previous comment. Turn on the option to "Show Deleted Depot Files" then merge/integrate using the context menu in the depot tree and restrict your merge/integration to a revision, changelist, etc. that is prior to their deletion. – raven May 30 '13 at 23:43
  • I'm not really sure what you're saying here. If I can't select the folder as the source for the integration, I don't see how I can do the integration. I'll try the trick you suggest with showing deleted depot files though. – detly May 30 '13 at 23:54
  • In the screen capture above, I could branch the folder `//test/pt1/...` to some new location such as `//test/somebranch/...`. Suppose there are ten files in `//test/pt1/...`, but I have deleted nine of them. I would only see that one last file if I were to use that "Add..." button. However, if I just go ahead with the branch and specify "Revisions up to" "Revision" 1. The newly created branch, `//test/somebranch/...`, would contain revision 1 of all ten files. – raven Jun 01 '13 at 19:38
  • What would you do if `pt1` was deleted? – detly Jun 02 '13 at 02:05
  • 1
    If everything in `pt1` were deleted, and I wanted to branch one or more of the file's previous revisions, I would enable the option to "Show Deleted Depot Files" in P4V, and use the "Merge/Integrate..." option on the context menu in the depot tree. You could also do it from the command line with p4.exe. – raven Jun 02 '13 at 15:23
0

If this is for a small number of files, an alternate way to do this is to start from a Revision Graph and identify whichever revision you want to integrate.

Find the file in the depot tree and type Ctrl+Shift+R to bring up the revision graph. Choose the revision with the changes you want to integrate. (tip: Right-click the revision and open it in an editor to verify, or drag one version onto another version of the file to diff them.)

When you've identified the revision you want to integrate, right-click it and choose Merge/Integrate. Then proceed as usual.

If there are multiple files to integrate, as you go, add them to the same changelist as the previous files for easier resolve and submit.

the_cat_lady
  • 852
  • 1
  • 9
  • 16