Creating Release Notes

TASK

Using Perforce to create release notes


SOLUTION

In the following examples, you have already created a label of your previous release called "LABEL_97.02_3549". You also know that the last change that went into "97.02/3549" was 3549. "97.02/3549" was made from the codeline: "//depot/main/p4/..."

For the new release, all changes have gone into the same codeline, "//depot/main/p4/..." and the code has been labeled with the label "LABEL_97.02_3960".

Changes between two labels

If you have labels for both releases, that makes creating release notes fairly straightforward. If you do not know what codeline the label came from, you can look at the label itself; you need to know the depot syntax of the area of code the label was made from. First, use p4 changes to get the list of all the changes that went into label "LABEL_97.02_3549" and a list of all changes that went into label "LABEL_97.02_3960", then diff the two files using the Unix diff utility or equivalent. Note the -i flag  includes changes that were integrated, -l gives the long descriptions. The file "CHANGES" is the list of changes that went into "97.02/3960", but were not in "97.02/3549".

p4 changes -l -i //depot/main/p4/...@LABEL_97.02_3549 > FILE1
p4 changes -l -i //depot/main/p4/...@LABEL_97.02_3960 > FILE2
diff FILE1 FILE2 > CHANGES

Changes between two jobs

You can also check what jobs have been fixed between the two labels (or two changes) in the same way using p4 jobs:

p4 jobs -l -i //depot/main/p4/...@LABEL_97.02_3549 > FILE1
p4 jobs -l -i //depot/main/p4/...@LABEL_97.02_3960 > FILE2
diff FILE1 FILE2 > JOBS

Changes between two changelists

If you are trying to figure out what changes have been made and there is no label, you can use change numbers, assuming you released from a client with up to date files. In the following example, release "97.02/3549" was made after change 3549 was submitted, and "97.02/3960" was made after change 3960 was submitted.

p4 changes -l -i //depot/main/p4/...@3549 > FILE1
p4 changes -l -i //depot/main/p4/...@3960 > FILE2
diff FILE1 FILE2 > CHANGES

Changes between a changelist and a label

What if you last released off //depot/main/p4/... at change 3960, but now you are releasing your first beta release from //depot/dev/p4/... at label "LABEL_97.3_4003"? Use the same mining technique; find the changes that went into the mainline at change 3960, then find the changes that went into the "dev" line, and diff the two.

p4 changes -l -i //depot/main/p4/...@3960 > FILE1
p4 changes -l -i //depot/dev/p4/...@LABEL_97.3_4003 > FILE2
diff FILE1 FILE2 > CHANGES

Notes

The one problem with using labels instead of change numbers is that, with labels, you do not get information about changelists that only included file deletions. If files in one label are subsequently deleted on a changelist with only deletes, they are not available in the client when the newer label is made, so they are not part of the file set that gets examined. Because of this exclusion of delete-only changelists, using changelist numbers is a more robust approach. Extracting change information using change numbers includes changes that are only deletions.