Merge gap examples for the source control command line interface

The following examples illustrate how to use the source control command line interface to merge change sets with gaps in history.

Single change set example

The following example uses the same work items and change sets that were used for the Eclipse client example. You accept the change set but add the --queue-merges keyword to indicate that you want to merge any change sets that have gaps.

>scm accept -r server -c _TBlXkU0FEeG_C43XlhdJ0Q --queue-merges

Repository: https://jazzdev.torolab.ibm.com:9443/jazz/
Workspace: (1865) "3.0.1.x Workspace"
  Component: (1884) "Filesystem"
    Current Merge:
      (1946) ----$ Evan Hughes "No comment" 01-Feb-2012 01:53 PM
      Changes:
        -Gm (1947) /com.ibm.team.filesystem.cli.tests/src/com/ibm/team/filesystem/cli/tests/subcommand/DaemonStartCmdTest.java
          -C- (1948) Content modified
        $Gm (1949) /com.ibm.team.filesystem.cli.core/src/com/ibm/team/filesystem/cli/core/internal/SubcommandLauncher.java
          $C- (1950) Content modified
          $A- (1951) Encoding changed from "Cp1252" to "UTF-8"
    Change sets:
      (1946) ----$ Evan Hughes "No comment" 01-Feb-2012 01:53 PM
        Changes:
          ---c- \com.ibm.team.filesystem.cli.core\src\com\ibm\team\filesystem\cli\core\internal\SubcommandLauncher.java
          ---c- \com.ibm.team.filesystem.cli.tests\src\com\ibm\team\filesystem\cli\tests\subcommand\DaemonStartCmdTest.java
        Work items:
          (1952) 6 "Test Failure (FilesystemCLI-C20120131-0928): com.ibm.team..."
          (1953) 103 "Fix failure"
Following components have change sets that require merge after accept:
  3.0.1.x Workspace - Filesystem
Run 'scm resolve current-merge' or 'scm set current-merge' or 'scm list merge-queue' or 'scm show status' to work with the merge queue.

In the output above, a section describes the current merge. The $ in the status codes for the SubcommandLauncher.java file indicate that the two changes for that file automatically resolved. The lack of the indicator for DaemonStartCmdTest.java indicates that the content change for that file must be manually resolved. The mechanism that is used to resolve conflicts with the CLI is by using in place markers. The following command merges the content change and generates the appropriate markers in the file.

>scm resolve current-merge 1884 -w 1865 -c 1948 --in-place-markers

Files that have content conflicts have been modified to include conflicted regions.

Edit the file and check in the changes.

>scm checkin com.ibm.team.filesystem.cli.tests/src/com/ibm/team/filesystem/cli/tests/subcommand/DaemonStartCmdTest.java

Finally, indicate that you are done merging that file. Use the resolve current-merge command with the --mine parameter, which indicates that you want to use the currently checked in version of the file. If you wanted to take the remote value without performing a merge operation, you can use the --proposed options; however, as in the Eclipse example, you can overwrite local content, so use this option with caution.

>scm resolve current-merge 1884 -w 1865 -c 1948 --mine

Complete the merge.

>scm set current-merge -w 1865 1884 --complete

Multiple Change sets example

In the following example, accept the changes sets from the CLI by using the --queue-merges option. The first change set becomes the current merge and the other change sets are placed in the merge queue, which is shown using the list merge-queue command.

>scm accept -r server -c _X5kLE7LyEeCecpaQPLj_tA _TwmTobkeEeCOOo3JDid0KQ _SylY8b4QEeCh0ITMJSRDWQ 
      _4T8JgbfFEeCecpaQPLj_tA _eqJQEb4AEeCh0ITMJSRDWQ --queue-merges
      
>scm list merge-queue -w 1865 1884
Current Merge:
  (1897) ----$ Evan Hughes 1 "Prevent changes to files with specific names" - ">

  Changes:
    &Gm (1898) /com.ibm.team.filesystem.rcp.ui.workitems/plugin.xml       $C- (1955) Content modified     $Cm (1900) /com.ibm.team.filesystem.common/META-INF/MANIFEST.MF       $C- (1956) Content modified     ..... Merge Queue:   (1944) ----$ Evan Hughes 1 "Prevent changes to files with specific names" - ">   (1941) ----$ Evan Hughes 1 "Prevent changes to files with specific names" - ">   (1945) ----$ Evan Hughes 1 "Prevent changes to files with specific names" - ">   (1943) ----$ Evan Hughes 1 "Prevent changes to files with specific names" - ">

Because all the changes auto-resolve, complete the merge and then resume processing of the merge queue.

>scm set current-merge -w 1865 1884 --complete

>scm resume merge-queue -w 1865 1884

Current Merge:
  (1941) ----$ Evan Hughes 1 "Prevent changes to files with specific names" - ">
  Changes:
    $Gm (1927) /com.ibm.team.filesystem.ide.ui/plugin.xml
      $A- (1971) Content modified
    ...
Merge Queue:
  (1945) ----$ Evan Hughes 1 "Prevent changes to files with specific names" - ">
  (1943) ----$ Evan Hughes 1 "Prevent changes to files with specific names" - ">

One change set accepted cleanly from the merge queue and the next change set had a gap where all changes auto-resolved. Repeat the merge process.

>scm set current-merge -w 1865 1884 --complete

>scm resume merge-queue -w 1865 1884

C:\Users\michael\dev\cliwork\sb>scm list merge-queue -w 1865 1884
Current Merge:
  (1945) ----$ Evan Hughes 1 "Prevent changes to files with specific names" - ">
  Changes:
    -Gm (1927) /com.ibm.team.filesystem.ide.ui/plugin.xml
      -C- (1992) Content modified
Merge Queue:
  (1943) ----$ Evan Hughes 1 "Prevent changes to files with specific names" - ">

This change set was from the Eclipse client example that contained merges that you did not want to backport. Use the set current-merge with the --abort option to discard the merge.

>scm set current-merge -w 1865 1884 --abort

Resume processing the merge queue to accept the final change set, which comes in without a gap.

>scm resume merge-queue -w 1865 1884
All change sets in the merge queue have been accepted into your workspace.

Use the locate command to find which change sets on the work item are included directly and which ones are related through a change set link.

C:\Users\michael\dev\cliwork\sb>scm locate -r server -w 1883 --workitems 1 --include-related -v
(1883) "RTC 3.0.1.1" (2 of 5) (2 of 5 related)
  (1943) ----$ Evan Hughes 1 "Prevent changes to files with specific names" - "i18n stragglers" 03-Aug-2011 04:37 PM
  (1944) ----$ Evan Hughes 1 "Prevent changes to files with specific names" - "Add tests and change type differentiation." 26-Jul-2011 05:02 PM
  (1897) S---$ Evan Hughes 1 "Prevent changes to files with specific names" - "Add UI for ProtectFileTypeAdvisor" 20-Jul-2011 01:08 PM
    Related: (1970) M---$ Matt "Merge of 'Add UI for ProtectFileTypeAdvisor'" 11-Oct-2013 01:55 PM
  (1941) S---$ Evan Hughes 1 "Prevent changes to files with specific names" - "i18n, XSD." 03-Aug-2011 02:40 PM
    Related: (2002) M---$ Matt "Merge of 'i18n, XSD.'" 11-Oct-2013 02:23 PM

video icon Video

Jazz.net channel
Software Education channel

learn icon Courses

IoT Academy
Skills Gateway

ask icon Community

Jazz.net
Jazz.net forums
Jazz.net library

support icon Support

IBM Support Community
Deployment wiki