It's all about the answers!

Ask a question

Unable to use scm diff command to create a patch


Peggy Shen (2512) | asked May 25 '12, 9:03 p.m.
When I try to use scm diff command to create a patch, the command gets executed without any error message but there is no patch generated either. The command I have is "scm diff -r <uri> -p workspace before workspace after".

The "-p" option according to document is for creating a patch. But it does go with an argument to tell what is the name of the new patch. And when I add a name after it, the command failed.

I have tested in Eclipse IDE to create a patch and it worked. Since we need to automate the process can someone help on this issue. Thanks

5 answers



permanent link
Evan Hughes (2.4k1318) | answered May 28 '12, 4:30 p.m.
JAZZ DEVELOPER
When I try to use scm diff command to create a patch, the command gets executed without any error message but there is no patch generated either. The command I have is "scm diff -r <uri> -p workspace before workspace after".

The "-p" option according to document is for creating a patch. But it does go with an argument to tell what is the name of the new patch. And when I add a name after it, the command failed.

I have tested in Eclipse IDE to create a patch and it worked. Since we need to automate the process can someone help on this issue. Thanks


The CLI will only generate output if there's a difference between the two files.

For example, if I create a copy of the workspace and diff the same file in each, there won't be any changes:

$ lscm create workspace --repository l ep2 --seed eclipse-proj  # Create workspace 'ep2' from 'eclipse-proj'

Workspace (1291) "ep2" successfully created


If I diff the two workspace, there's no output because the workspaces are identical:

$ lscm diff workspace ep2 workspace eclipse-proj

$


But if I commit a change to workspace eclipse-proj, a change will appear.

First, create a change:

$ echo "plus ca change" > build.properties 

$ lscm ci build.properties
Workspace: (1287) "eclipse-proj" <-> (1287) "eclipse-proj"
Component: (1288) "eclipse-proj"
Baseline: (1289) 1 "Initial Baseline"
Outgoing:
Change sets:
(1292) *--@ "<No>" 28-May-2012 04:28 PM
Changes:
---c- /project/build.properties



Then run the diff:

$ lscm diff workspace ep2 workspace eclipse-proj

diff -u -N project/build.properties project/build.properties
--- project/build.properties 2012-05-28 16:28:33.000000000 -0400
+++ project/build.properties 2012-05-28 14:48:21.000000000 -0400
@@ -1,1 +1,4 @@
-plus ca change
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .

permanent link
Evan Hughes (2.4k1318) | answered May 28 '12, 4:54 p.m.
JAZZ DEVELOPER
The "-p" option according to document is for creating a patch. But it does go with an argument to tell what is the name of the new patch. And when I add a name after it, the command failed.


I don't know exactly what you did, because you didn't provide your input.

But the '-p' argument does not take an argument. Here's the output of help:

$ scm help diff

Help on diff
Shows the difference between two items.
...
Options:
...
-p [--fullpatch] - Produces a full Jazz patch.
-r [--repository-uri] arg - The URI that specifies the location of the repository.


The -p/--fullpatch line does not have the word 'arg' after the option. That means it takes zero arguments. Compare that with the -r/--repository-uri argument. The -r has a 'arg' after it, indicating that it takes an argument.

Continuing with the previous example:
$ lscm diff workspace ep2 workspace eclipse-proj -p

### Jazz Patch 1.0
#changeset: "_Sxyk8akDEeGgn9ZXCFZAIw"
#date: "2012-05-28 16:51:38.000000281 -0400"
#itemid: "project/build.properties" "_v6Mm4Kj1EeG5Cr_Jz2_94g" "_vVRU4Kj1EeGgn9ZXCFZAIw"
#item_type: "_v6Mm4Kj1EeG5Cr_Jz2_94g" "file"
#itemid: "project" "_vutIkKj1EeG5Cr_Jz2_94g" "_vVRU4Kj1EeGgn9ZXCFZAIw"
#item_type: "_vutIkKj1EeG5Cr_Jz2_94g" "folder"
#before_state: "project/build.properties" "_v6Mm4Kj1EeG5Cr_Jz2_94g" "_tRR7hKkDEeGgn9ZXCFZAIw"
#after_state: "project/build.properties" "_v6Mm4Kj1EeG5Cr_Jz2_94g" "_wAD-Xqj1EeGgn9ZXCFZAIw"
#
diff -u -N project/build.properties project/build.properties
--- project/build.properties 2012-05-28 16:28:33.000000000 -0400
+++ project/build.properties 2012-05-28 14:48:21.000000000 -0400
@@ -1,1 +1,4 @@
-plus ca change
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .


The leading lines with the '#' are Jazz-specific information that the ordinary 'patch' utility will ignore. RTC will use those to handle renames and moves.

Because the '-p' doesn't take an argument, it can be stuck pretty much anywhere on the command line. Note that it may not separate an option from its argument.

permanent link
Peggy Shen (2512) | answered May 29 '12, 4:52 a.m.
Thanks for the response for the issue. But it sounds like a scm diff bug to me.

Currently, I am diff 2 workspaces and I can see the difference between in Eclipse Gui but not from command line. There is no log or anything to tell where the problem is. I am not sure what is this "-p" used for if we can not define what the patch is.

Should I open a defect to it?

permanent link
Evan Hughes (2.4k1318) | answered May 29 '12, 8:49 a.m.
JAZZ DEVELOPER
Thanks for the response for the issue. But it sounds like a scm diff bug to me.

Currently, I am diff 2 workspaces and I can see the difference between in Eclipse Gui but not from command line. There is no log or anything to tell where the problem is. I am not sure what is this "-p" used for if we can not define what the patch is.

Should I open a defect to it?


It's up to you. You haven't described much about your problem (CLI input, the difference between the workspaces, or your platform) so it's hard for me to help further.

If you do open a bug, you'll be expected to furnish that information, so to speed things along, please include it in the bug report.

permanent link
Peggy Shen (2512) | answered May 29 '12, 6:36 p.m.
I have opened Defect 213343 against this issue. Please let me know if I need to provide more information for it

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.