Search code examples
perforcep4v

How to get all changelist (including integrated ones) between two revision?


I need to list all changelists of a steam between two revisions.

p4 changes command can list all changelists that we submitted into a branch in between two revisions.

p4 changes //depot/stream/...@from_revision,to_revision

While this command works great, it will only show changelist that were directly submitted into that branch. Changelists that were merged/integrated from other branches will be missing.

p4 changes command does offer a -i option to include integrated changelist.

p4 changes -i //depot/stream/...@from_revision,to_revision

However, it seems that -i option and revision specifier does not work well together, as I get revision outside of the range. To be more precise, revisions prior to from_revision are not correctly excluded while, strangely enough, revision after to_revision are as expected filtered out !

Any help appreciated on this issue ! Thanks !


Solution

  • If you want changes across all streams within a specific range, leave off the filespec: p4 changes @from_change,to_change

    When you use the "-i" option it shows you contributing changes (via integration) to the changes in the range that you specified. The contributing changes are not restricted by the specified range, since that would usually defeat the purpose -- e.g. if changes were integrated from //depot/source/... to //depot/target/... and you run p4 changes -i //depot/target/..., the entire point of the "-i" option is to show you the //depot/source/... changes that fall outside of the //depot/target/... specification, so the file spec is not applied to the source changes discovered by -i. The exact same logic applies regardless of whether there is a revision specifier attached to the file argument.

    If you want to get changes that contribute to a particular range but you want to further restrict the contributing changes, the best option is post-processing -- run p4 changes -i and then sort/limit the output to include changes from the range you're interested in.