Find merges

Find, filter, and track merges.

Filtering options

The following list displays the different filtering options (where) that are available to use with the cm find merge command:

  • date
  • dstbranch
  • dstchangeset
  • guid
  • id
  • owner
  • srcbranch
  • srcchangeset
  • type

Output options

The following list displays the different output options (--format) available to use with the cm find merge command:

  • date
  • dstbranch
  • dstchangeset
  • id
  • owner
  • srcbranch
  • srcchangeset
  • type

cm find merge examples

Track merges from and to a specific branch or changeset. The find merge command returns all types of merges: regular merges, cherrypicked merges, and subtractive merges.

Find where a branch has been integrated

cm find merge "where srcbranch ='main/Fix-4.1/SCM11769'"
br:/main/Fix-4.1/SCM11769@55613 -->br:/main/Fix-4.1/Release-4.1.10.447@55808

Total: 1

Find branches integrated on a specific release

Find which branches are integrated in a specific branch:

$ cm find merge "where dstbranch ='main/Fix-4.1/Release-4.1.10.447'"
br:/main/Fix-4.1/SCM12835@55568 -->br:/main/Fix-4.1/Release-4.1.10.447@55801
br:/main/Fix-4.1/scm11898@55647 -->br:/main/Fix-4.1/Release-4.1.10.447@55802
br:/main/Fix-4.1/scm12839@55678 -->br:/main/Fix-4.1/Release-4.1.10.447@55803
br:/main/Fix-4.1/SCM11769@55613 -->br:/main/Fix-4.1/Release-4.1.10.447@55808
br:/main/Fix-4.1/SCM12860@55735 -->br:/main/Fix-4.1/Release-4.1.10.447@55809

Customise the output to show only the branch name:

$ cm find merge "where dstbranch ='main/Fix-4.1/Release-4.1.10.447'" --format="{srcbranch}" --nototal
br:/main/Fix-4.1/SCM12835
br:/main/Fix-4.1/scm11898
br:/main/Fix-4.1/scm12839
br:/main/scm12419
br:/main/SCM4052
br:/main/Fix-4.1/SCM11769
br:/main/Fix-4.1/SCM12860

Customise the output so that it returns the source branch, destination branch, and the type of merge:

cm find merges "where dstbranch='br:/main/ReleaseBL274'" --format="{srcbranch}@{srcchangeset} --> {dstbranch}@{dstchangeset}({type})" --nototal
br:/main/scm11148@43953 --> br:/main/ReleaseBL274@44094 (merge)
br:/main/scm11181@43969 --> br:/main/ReleaseBL274@44096 (merge)
br:/main/Fix-4.0/SCM11101@44010 --> br:/main/ReleaseBL274@44030 (merge)
br:/main/scm11135@43980 --> br:/main/ReleaseBL274@44031 (merge)
br:/main/ReleaseBL272@43914 --> br:/main/ReleaseBL274@44032 (cherrypick)
br:/main/ReleaseBL268@43663 --> br:/main/ReleaseBL274@44033 (cherrypick)
br:/main/scm10957@43952 --> br:/main/ReleaseBL274@44093 (merge)
br:/main/SCM11195@43981 --> br:/main/ReleaseBL274@44095 (merge)
br:/main/SCM10924@43942 --> br:/main/ReleaseBL274@44033 (merge)

Find interval merges to a given branch:

cm find merges "where dstbranch='br:/main/Fix-4.1/ReleaseBL285' and type='intervalcherrypick'" --format="({basebranch}@{basechangeset}, {srcbranch}@{srcchangeset}) --> {dstbranch}@{dstchangeset}" --nototal
(br:/main@44448, br:/main/scm11318@44461) --> br:/main/Fix-4.1/ReleaseBL285@44463