It's all about the answers!

Ask a question

Need help trying to show changed files between baselines.


Jason Dean (1061168) | asked Nov 27 '09, 11:36 a.m.
Hi,
I'm relativity new to Java and quite new to RTC. I am looking for samples with the Plain Java API to help me try to list files that have changed in each component between releases (Baselines).

I've looked at the samples that come with the plain Java API's which explain some of the basics but there doesn't seem to be much that shows much more detail, especially with the source control side. Is it possible for someone to post a sample to achieve the above.

Thanks for any help,

Regards,

Jason

13 answers



permanent link
Andrew Hoo (1.0k1) | answered Nov 30 '09, 10:53 a.m.
JAZZ DEVELOPER
When you have the IBaselineConnections, there is a compareTo method that
returns a IChangeHistorySyncReport. That should give you somewhere to
start looking.


On Fri, 27 Nov 2009 11:38:00 -0500, jasuk70
<jdean> wrote:

Hi,
I'm relativity new to Java and quite new to RTC. I am looking for
samples with the Plain Java API to help me try to list files that
have changed in each component between releases (Baselines).

I've looked at the samples that come with the plain Java API's which
explain some of the basics but there doesn't seem to be much that
shows much more detail, especially with the source control side. Is
it possible for someone to post a sample to achieve the above.

Thanks for any help,

Regards,

Jason

permanent link
Jason Dean (1061168) | answered Dec 02 '09, 10:30 a.m.
Hi,
Thanks for replying, so far I've managed to get a workspace manager:


String repositoryURI= "http://xxx.xxx.com:9080/jazz";
String userId= "xxxxx";
String password= "xxxxx";
String projectAreaName= "Test Project";

ITeamRepository teamRepository= TeamPlatform.getTeamRepositoryService().getTeamRepository(repositoryURI);
teamRepository.registerLoginHandler(new LoginHandler(userId, password));
try {
teamRepository.login(null);
} catch (TeamRepositoryException e1) {
System.out.println("Login failed with user "+userId);
return;
}
IWorkspaceManager wm = SCMPlatform.getWorkspaceManager(teamRepository);


I was hoping to be able to list the streams in this project and then a list of baselines for the streams. But I'm finding it hard to find documentation or samples on how to do this.

Jas

permanent link
Jason Dean (1061168) | answered Dec 02 '09, 12:11 p.m.
The main thing I'm trying to work out is how to use the "Searches" to find baselines (And snapshots) linked to a stream or a component within a stream.


IWorkspaceManager wm = SCMPlatform.getWorkspaceManager(teamRepository);
IBaselineSearchCriteria search = IBaselineSearchCriteria.FACTORY.newInstance();
search.????
List<IBaselineHandle> baselines = wm.findBaselines(search, 0, null);
for (Iterator<IBaselineHandle> baseline = baselines.iterator() ; baseline.hasNext(); ) {
System.out.println("Baseline = ["+baseline.next()+"]");
}


The search doesn't seem to have any understandable methods to do this.

Cheers,

Jas

permanent link
Andrew Hoo (1.0k1) | answered Dec 03 '09, 11:38 a.m.
JAZZ DEVELOPER
Unfortunately I think you have to work from the other end, start with the
workspaces/streams and then fetch baselines from them, if you know of the
set of workspaces/streams/snapshot that you want to inspect.

On Wed, 02 Dec 2009 12:23:00 -0500, jasuk70
<jdean> wrote:

The main thing I'm trying to work out is how to use the
"Searches" to find baselines (And snapshots) linked to a
stream or a component within a stream.


IWorkspaceManager wm =
SCMPlatform.getWorkspaceManager(teamRepository);
IBaselineSearchCriteria search =
IBaselineSearchCriteria.FACTORY.newInstance();
search.????
List<IBaselineHandle> baselines =
wm.findBaselines(search, 0, null);
for (Iterator<IBaselineHandle> baseline =
baselines.iterator() ; baseline.hasNext(); )
{
System.out.println("Baseline =
");
}


The search doesn't seem to have any understandable methods to do
this.

Cheers,

Jas



--

permanent link
Jason Fregien (58910) | answered Dec 03 '09, 1:23 p.m.
Here's a thread that shows a couple of ways to get a list of changeSets by comparing two baselines.

http://jazz.net/forums/viewtopic.php?p=22460

I didn't find the baselineQueries very easy to use...maybe I was just using them wrong. The query would just return 25 or so and I wanted all of them. So I just get a list of all the baselines and then grab the baseline id that I'm looking for or sort them and grab the latest one.

List<IBaseline> baselines = this.workspaceMgr.findAllBaselines(component, "", this.monitor);

permanent link
Jason Dean (1061168) | answered Dec 04 '09, 6:53 a.m.
Unfortunately I think you have to work from the other end, start with the
workspaces/streams and then fetch baselines from them, if you know of the
set of workspaces/streams/snapshot that you want to inspect.


Thanks,

I know the stream name, I need to iterate through the components in that stream and then compare using the baselines. (I.e. I know the baseline name will start with certain characters and and then if it exists, I then need to check the previous baseline and see what has changed.)

If that makes sense.

We use this information to create an update package to allow users to only update the relevant components. Under perforce this was a very simple task that used the command line tool p4.

Any tips on doing the "Iterate through components in a stream" bit that should get me well on the way.

Thanks again for the help,

Jas

permanent link
Geoffrey Clemm (29.7k23035) | answered Dec 04 '09, 9:08 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Just for interest's sake, why are you writing code to do this?
It is built-in functionality of the Jazz SCM system.

Cheers,
Geoff

jasuk70 wrote:
adhoowrote:
Unfortunately I think you have to work from the other end, start with
the
workspaces/streams and then fetch baselines from them, if you know
of the
set of workspaces/streams/snapshot that you want to inspect.


Thanks,

I know the stream name, I need to iterate through the components in
that stream and then compare using the baselines. (I.e. I know the
baseline name will start with certain characters and and then if it
exists, I then need to check the previous baseline and see what has
changed.)

If that makes sense.

We use this information to create an update package to allow users to
only update the relevant components. Under perforce this was a very
simple task that used the command line tool p4.

Any tips on doing the "Iterate through components in a
stream" bit that should get me well on the way.

Thanks again for the help,

Jas

permanent link
Jason Dean (1061168) | answered Dec 04 '09, 9:36 a.m.
Just for interest's sake, why are you writing code to do this?
It is built-in functionality of the Jazz SCM system.

Cheers,
Geoff



Can it be done from the command line?

We need to use this in our build process. (Which is done using makefiles on multiple Unix and windows platforms using the same source code)

Cheers,

Jas

permanent link
Geoffrey Clemm (29.7k23035) | answered Dec 04 '09, 11:08 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Yes, you can use the Jazz SCM command line to efficiently update your
file area.

Cheers,
Geoff

jasuk70 wrote:
gmclemmwrote:
Just for interest's sake, why are you writing code to do this?
It is built-in functionality of the Jazz SCM system.

Cheers,
Geoff



Can it be done from the command line?

We need to use this in our build process. (Which is done using
makefiles on multiple Unix and windows platforms using the same
source code)

Cheers,

Jas

permanent link
Jason Dean (1061168) | answered Dec 04 '09, 11:33 a.m.
Yes, you can use the Jazz SCM command line to efficiently update your
file area.

Cheers,
Geoff


Hi,
We need a list of files that have changed in each component so we can generate an upgrade package for each component that has changed for our auto update system.

An example of the perforce way is:

ukvir-jdrh5_64-~: p4 changes -m 1 //depot/APP/COMP1/...
Change 86367 on 2009/11/25 by xxx@xxx 'xxxxxxxxxxxxxx'

The routine will then check the last change that was made to the component and work out if this "Component" has been updated since the last release (By checking a file that has been checked into an area of perforce). If it has changed, then it will update this area with the latest change number and then mark this component as needing to be updated.

This is all done by the build process.

Cheers,

Jas

Your answer


Register or to post your answer.