diff example

diff example

Examples

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

C:\local-workspaces\HelloJazz>lscm show 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 show conflicts to get more information about the conflict:
C:\local-workspaces\HelloJazz>lscm show conflicts
Conflicts
  Cc- /com.example.hellojazz.service/src/com/example/hellojazz/service/internal/HelloJazzService.java (Modified <-> Modified)
Problem running 'conflicts':
Unresolved conflicts remain.

Run scm diff to compare the file in your sandbox (file path) with the proposed change in the incoming change set (which, as shown by the previous scm show status command, is in the stream with alias 1102):
C:\local-workspaces\HelloJazz>lscm 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?";
     }
}

If you need to compare changes in the local file with that of the current state of the workspace, run lscm diff file local file path
Variations of running diff on a file:
lscm diff file local file path changeset changeset alias/uuid
lscm diff file local file path baseline baseline alias/uuid
lscm diff file local file path workspace workspace name/alias/uuid
lscm diff file local file path stream stream name/alias/uuid
lscm diff file local file path snapshot snapshot name/alias/uuid
If you make changes to files in the sandbox and commit the changes to a changeset, you can run scm diff and specify the change set alias or uuid to compare with the latest state of the workspace.
$ lscm show status -v -C

Local file system is consistent.
Workspace: (2021) "MyWs1" <-> (2021) "MyWs1"  (ADMIN @ lo)
  Component: (2022) "Comp1"
    Baseline: (2023) 1 "Initial Baseline"
    Outgoing:
      Change sets:
        (2025) *--@  "No comment" 29-Aug-2012 04:13 PM
          Changes:
            ---c- /folder1/Activator.java
            ---c- /folder1/Messages.java

$ lscm diff changeset 2025
diff -u -N Comp1/folder1/Activator.java Comp1/folder1/Activator.java
--- Comp1/folder1/Activator.java    2012-08-29 16:03:35.000000000 +0530
+++ Comp1/folder1/Activator.java    2012-08-29 16:07:22.000000000 +0530
@@ -6,10 +6,10 @@
 public class Activator extends Plugin {

     public static final String PLUGIN_ID = "com.myComp.test"; //$NON-NLS-1$
-   

     @Override
     public void start(BundleContext context) throws Exception {
+        // call super class
         super.start(context);
     }
 }
diff -u -N Comp1/folder1/Messages.java Comp1/folder1/Messages.java
--- Comp1/folder1/Messages.java    2012-08-29 16:05:58.000000000 +0530
+++ Comp1/folder1/Messages.java    2012-08-29 16:07:48.000000000 +0530
@@ -10,6 +10,8 @@
     public static String ChangeDisplayer_3;
     public static String ChangeDisplayer_4;
     public static String ChangeDisplayer_5;
+    public static String ChangeDisplayer_6;
+    public static String ChangeDisplayer_7;

     static {
         // initialize resource bundle

Variations of running diff on a changeset:
lscm diff changeset changeset alias/uuid
lscm diff changeset changeset alias/uuid changeset changeset alias/uuid
Variations of running diff on a baseline:
lscm diff baseline baseline name/alias/uuid
lscm diff baseline baseline name/alias/uuid baseline baseline name/alias/uuid
lscm diff baseline baseline name/alias/uuid workspace workspace name/alias/uuid
lscm diff baseline baseline name/alias/uuid stream stream name/alias/uuid
lscm diff baseline baseline name/alias/uuid snapshot snapshot name/alias/uuid
If a baseline name is specified, then the --component option also needs to be specified. For example:
lscm diff baseline baseline name --component name/alias/uuid
Variations of running diff on a workspace:
lscm diff workspace workspace name/alias/uuid
lscm diff workspace workspace name/alias/uuid baseline baseline name/alias/uuid
lscm diff workspace workspace name/alias/uuid workspace workspace name/alias/uuid
lscm diff workspace workspace name/alias/uuid stream stream name/alias/uuid
lscm diff workspace workspace name/alias/uuid snapshot snapshot name/alias/uuid
The above comparision can be restricted to individual component by specifying the --component option. For example:
lscm diff workspace workspace name/alias/uuid workspace workspace name/alias/uuid --component component name/alias/uuid
Variations of running diff on a stream:lscm diff stream stream name/alias/uuid
lscm diff stream stream name/alias/uuid baseline baseline name/alias/uuid
lscm diff stream stream name/alias/uuid stream stream name/alias/uuid
lscm diff stream stream name/alias/uuid workspace workspace name/alias/uuid
lscm diff stream stream name/alias/uuid snapshot snapshot name/alias/uuid
The above comparision can be restricted to an individual component by specifying the --component option. For example:
lscm diff stream stream name/alias/uuid stream stream name/alias/uuid --component component name/alias/uuid
Variations of running diff on a snapshot:
lscm diff snapshot snaphsot name/alias/uuid
lscm diff snapshot snapshot name/alias/uuid baseline baseline name/alias/uuid
lscm diff snapshot snaphsot name/alias/uuid snapshot snapshot name/alias/uuid
lscm diff snapshot snaphsot name/alias/uuid workspace workspace name/alias/uuid
lscm diff snapshot snaphsot name/alias/uuid stream stream name/alias/uuid
The above comparision can be restricted to an individual component by specifying the --component option. For example:
lscm diff snapshot snaphsot name/alias/uuid snapshot snapshot name/alias/uuid --component component name/alias/uuid
Example showing property diff:
$ lscm diff file -S cp folder1\ContentAndPropertyDiff.txt
diff -u -N folder1/ContentAndPropertyDiff.txt folder1/ContentAndPropertyDiff.txt
--- folder1/ContentAndPropertyDiff.txt  2012-08-03 14:44:47.000000597 +0530
+++ folder1/ContentAndPropertyDiff.txt  2012-08-03 14:47:55.000000965 +0530
@@ -1,2 +1,3 @@
Demonstrate content and property diff

+Add, delete and modify properties
\ No newline at end of file
Properties:
+AfterStateProp          - Value3
-BeforeAndAfterStateProp - Value2
+BeforeAndAfterStateProp - Value21
-BeforeStateProp         - Value1
-jazz.mime - text/plain
+jazz.mime - text/html