TenG
TenG

Reputation: 4004

IBM Rational Tem COncert - how to use scm.exe to compare projects

We have recently moved from Harvest to Rational Team Concert (RTC).

We have numerous complaints, but let's not dwell on them.

I need to know how to do the following:

In my workspace C:\ws I have the following streams/projects:

C:\ws\dev1
C:\ws\dev2

When building the deployment scripts package (Oracle, dotNet) what I want to do is check that everything we have changed during the course of the project is included in the package.

To to do this, we have a stream that reflect current production.

I want to simply query RTC repository and ask the question:

"List all the files that differ in C:\WS\dev1 compared to the production stream".

I cannot find any example of the SCM.exe command that show how to do this.

The only way I have found is to "load" the production stream to my local workspace e.g. "C:\ws\prod" then do a compare between "C:\ws\dev1" and "C:\ws\prod".

Problem with this is because RTC load does not preserve the actual repository check-in timestamp, I immediately have to start filtering these out.

There must be a way to do this easily using SCM.

The graphical Eclipse "compare" shows me diffs, but I cannot even copy/paste that list into a text file because it's all graphical.

Upvotes: 3

Views: 2140

Answers (2)

Tim Mok
Tim Mok

Reputation: 31

The command line will allow you to compare a repository workspace to a stream. If you've checked in your changes that you've loaded on disk, you can compare the repository workspace to the production stream.

lscm compare ws {workspace id} s {stream id} -r {repository_URI} -I f

The -I f option will list the file differences and only the file differences.

If the content hasn't been checked in, you can set your flow target and use the status command. Unchecked-in files will be displayed in the output. You can use the -C option to expand change sets to see the files. You'll have to parse the output though because there isn't an option to exclude that information.

If there still isn't something supported, you can open a work item on jazz.net.

Upvotes: 3

VonC
VonC

Reputation: 1325077

The idea for that kind of comparison is to change for a moment the flow target of dev1 repo workspace, pointing it to prod stream.

That will allow you to get the change set of prod that you don't have in dev1, or list the change set of dev1 which aren't in prod yet.

The article "Getting started with the Jazz SCM command line in Rational Team Concert" illustrates that kind of operation.
(the example is for pointing to another Workspace, but you can also points directly to another Stream)

~/sample$ lscm change-target workspace Workspace1 Workspace2
Target changed.

~/sample$ lscm status
Workspace: (4819) "Workspace1" <-> (4828) "Workspace2"
  Component: (4818) "Comp1" <-> (4828) "Workspace2"
    Baseline: (4825) 1 "Initial Baseline"
    Incoming:
      Change sets:
        (4935)  ---$ userB  <No comment>

But you would still need to list the content of those change sets and look for common files: those are the ones with a different content (not to mentions files present only in dev1 or prod, or deleted files)

In short, there doesn't seem to be an easy way to do this in command line.

Upvotes: 1

Related Questions