Is it possible to create a patch using a set of changelists?

webXL picture webXL · Apr 21, 2010 · Viewed 22.5k times · Source

Problem: 2 projects shared trunk and were updating some of the same files. Now one project needs to be released, so a new branch was created from a checkpoint before the projects started.

I have a list of just my changelist numbers from the mainline. Using that I can generate a list changed files and diff output using a script with a series of 'p4 describe #' commands.

Can I reformat that output and apply it to the new branch somehow?

Answer

Chaitanya picture Chaitanya · Feb 7, 2011

Response to the title: "Is it possible to create a patch using a set of changelists?" Yes.

p4 diff2 -u //path_to_your_sources/...@cln_minus_1 //path_to_your_sources/...@cln > /tmp/cln.patch.

You can then use /tmp/cln.patch as input to the patch utility. Here, 'cln' is the submitted change list number that you want to create a patch for.