diff

Compare two states of a file.

Purpose

The scm diff subcommand compares two states of a file, called the before state and the after state, and optionally produces a Rational Team Concert™ source control patch that expresses the difference. A state is specified by providing two parameters: a type name and a selector appropriate for the named type. The after state must be specified. The before state is optional (if omitted, it is derived from the after state).

Synopsis

Options and arguments

-d  |  --dir ] workspace-path
The path name of a local workspace created by scm load or scm share. This subcommand runs with workspace-path set as the current working directory. You can omit this option if the current working directory is in a local workspace.
-P  |  --password ] password for user ID in repository
The password for the specified user ID in the named repository. If this option is not included on the command line, you are prompted for a password. If you specified a repository URI or nickname for which you have stored credentials using the scm login command, this option is ignored.
-p  |  --fullpatch ] 
Generate a full Rational Team Concert source control patch.
-u  |  --username ] user ID in repository
Specifies a user ID that exists in the named repository. If you specified a repository URI or nickname for which you have stored credentials using the scm login command, this option is ignored.
aftertype
One of:
  • file
  • workspace
  • stream
afterselector
One of:
  • pathname, if aftertype is file
  • name, alias, or UUID if aftertype is workspace or stream
beforetype
One of:
  • changeset
  • file
  • workspace
  • stream
beforeselector
One of:
  • pathname, if beforetype is file
  • name, alias, or UUID if beforetype is changeset, workspace, or stream

Examples

Working in a local workspace, you have accepted a change set that conflicts with a file in your workspace, as indicated by scm status:

C:\local-workspaces\HelloJazz>scm status -C
Workspace: (1101) "HelloJazz" <-> (1102) "HelloJazz Stream"
  Component: (1103) "HelloJazz"
    Baseline: (1108) 3 "beta2 updates"
    Conflicts:
      com.example.hellojazz.service/src/com/example/hellojazz/service/internal/>

    Outgoing:
      Change sets:
        (1115) !-@ <No comment>
          Changes:
            !--c /com.example.hellojazz.service/src/com/example/hellojazz/servi>

Run scm conflicts to get more information about the conflict:

C:\local-workspaces\HelloJazz>scm conflicts
Conflicts
  C-m- /com.example.hellojazz.service/src/com/example/hellojazz/service/internal/HelloJazzService.java
Problem running 'conflicts':
Unresolved conflicts remain.

Run scm diff to compare the version of the file in your workspace with the proposed change in the incoming change set (which, as shown by the previous scm status command, is in the stream with alias 1102):

C:\local-workspaces\HelloJazz>scm diff file com.example.hellojazz.service\src\com\example\hellojazz\service\internal\HelloJazzService.java stream 1102
--- com.example.hellojazz.service/src/com/example/hellojazz/service/internal/HelloJazzService.java      2008-06-03 09:17:36.000000723 -0400
+++ com.example.hellojazz.service/src/com/example/hellojazz/service/internal/HelloJazzService.java      2008-06-03 09:12:27.000000563 -0400
@@ -17,6 +17,6 @@
     implements IHelloJazzService {

     public String sayHello() throws TeamRepositoryException {
-        return "Hello Jazz! You're looking good!";
+        return "Hello Jazz! How are you?";
     }
}


Feedback

Did this help? You can provide feedback at Jazz.net (registration required): Comment in the forums or submit a bug