11

I'm getting ready to integrate our "Dev" branch into our "Testing" branch in preparation for an upcoming release.

For our last release, after the initial integration, we determined there were some changes we didn't want to release. I rolled back some files in the Testing branch, and commented out portions of other files. Many of these files haven't changed in the Dev branch, so as far as Perforce is concerned, they've already been integrated and are good-to-go.

Obviously, I could track down the changelists and un-rollback these files. I could also integrate the offending files with the "-f" option to disregard integration history.

But I was hoping to find a way to do this "automatically". I tried integrating the entire branch with "-f", resolving, and then reverting unchanged files, but this just gives the message: <filename> has pending integrations, not reverted.

Is there a way to get Perforce to revert unchanged files that are pending integration? Is there some other approach I should take?

Chad
  • 1,750
  • 2
  • 16
  • 32
Phillip
  • 600
  • 1
  • 5
  • 12

1 Answers1

24

Have you tried the following steps under 'Pending integrations not reverted'?

http://answers.perforce.com/articles/KB_Article/Reverting-Unchanged-Files

Files that are integrated and resolved but have no content or type changes will still be submitted as new revisions, EVEN IF you have 'revertunchanged' selected in your client spec, or use 'submit -f revertunchanged'. This behavior is by design, but is not obvious.

Again, if a submit would change the integration history of a file, then that file is considered changed, even if there are no content changes. In other words, updates to integration history are considered a file change, just like content, type, and attribute changes.

The command line equivalent of the 'revertunchanged' option, p4 revert -a, offers some context. From p4 help revert:

The -a flag reverts only files that are open for edit or integrate and are unchanged or missing. Files with pending integration records are left open. The file arguments are optional when -a is specified.

For example:

$ p4 revert -a b
//depot/test/b#1 - has pending integrations, not reverted

Users concerned about integrating files with no content changes are advised to use 'p4 diff -sr | p4 -x- revert'. For example:

$ p4 diff -sr | p4 -x- revert 
//depot/test/b#1 - was integrate, reverted

Let me know if this helps.

therealmitchconnors
  • 2,732
  • 1
  • 18
  • 36
P4Shimada
  • 758
  • 4
  • 8
  • So, how to do that for multiple files from P4V? – Mikhail Orlov Jan 02 '15 at 16:14
  • @MikhailOrlov You can use a file as an argument with the -x global option flag, such as: 'p4 -x filename '. The filename will have a list of the files. See the answer here: http://stackoverflow.com/questions/27940137/perforce-sync-multiple-files-at-specific-revisions-quickly AND Here are examples of how to use the '-x' flag in documentation: http://answers.perforce.com/articles/KB_Article/The-x-Flag http://answers.perforce.com/articles/KB_Article/Adding-a-Directory-Tree http://answers.perforce.com/articles/KB_Article/Integ-Using-the-x-Global-Option – P4Shimada Jan 14 '15 at 23:38
  • Just to add this works great provided all files in an integration have been RESOLVED. Please do not do this without resolving first. – Aditya Kumar Pandey Apr 17 '15 at 12:01