Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

fetch file "revisions" from a Component

Hi,
given a component/baseline is it possible to fetch from the repository all the checked in "revisions" of a specific file of that component/baseline?
If it is possible, how can I do that?
with the following pseudocode I'm able to get the latest "revision" of every IFileItemHandle (and thus also the source code) in the repository for a Component/Baseline:


IConfiguration conf = temp.configuration(tempComp);
Collection<IVersionableHandle> col = conf.childEntriesForRoot(null);
for(Iterator<IVersionableHandle> colIter = col.iterator(); colIter.hasNext();){
.....
....
}


How can I fetch the past "revisions" of files, that I assume are saved in the repository anytime they are modified and checked in?
cheers
Giacomo

0 votes



5 answers

Permanent link
If you have a baseline, then you can get a baseline connection for it
from the workspace manager.

To get all the revisions from that baseline, I would use

connection.changeHistory().getHistoryFor( ... ) which returns data
structures which contain the change-sets that modify this item.

You can sort through this result and collect the change-set handles,
which you can fetch if you require the ability to look at the
content/file items themselves.

HTH,
JohnC
SCM Server

ghezzi wrote:
Hi,
given a component/baseline is it possible to fetch from the repository
all the checked in "revisions" of a specific file of that
component/baseline?
If it is possible, how can I do that?
with the following pseudocode I'm able to get the latest
"revision" of every IFileItemHandle (and thus also the
source code) in the repository for a Component/Baseline:


IConfiguration conf = temp.configuration(tempComp);
Collection<IVersionableHandle> col =
conf.childEntriesForRoot(null);
for(Iterator<IVersionableHandle> colIter = col.iterator();
colIter.hasNext();){
....
...
}

How can I fetch the past "revisions" of files, that I assume
are saved in the repository anytime they are modified and checked in?
cheers
Giacomo

0 votes


Permanent link
If you have a baseline, then you can get a baseline connection for it
from the workspace manager.

To get all the revisions from that baseline, I would use

connection.changeHistory().getHistoryFor( ... ) which returns data
structures which contain the change-sets that modify this item.

You can sort through this result and collect the change-set handles,
which you can fetch if you require the ability to look at the
content/file items themselves.

HTH,
JohnC
SCM Server

ghezzi wrote:
Hi,
given a component/baseline is it possible to fetch from the repository
all the checked in "revisions" of a specific file of that
component/baseline?
If it is possible, how can I do that?
with the following pseudocode I'm able to get the latest
"revision" of every IFileItemHandle (and thus also the
source code) in the repository for a Component/Baseline:


IConfiguration conf = temp.configuration(tempComp);
Collection<IVersionableHandle> col =
conf.childEntriesForRoot(null);
for(Iterator<IVersionableHandle> colIter = col.iterator();
colIter.hasNext();){
....
...
}

How can I fetch the past "revisions" of files, that I assume
are saved in the repository anytime they are modified and checked in?
cheers
Giacomo

0 votes


Permanent link
Can you please tell me how can I get the baseline in the first place?

Thanks

0 votes


Permanent link
ghezzi wrote:
Hi,
given a component/baseline is it possible to fetch from the repository
all the checked in "revisions" of a specific file of that
component/baseline?
If it is possible, how can I do that?
with the following pseudocode I'm able to get the latest
"revision" of every IFileItemHandle (and thus also the
source code) in the repository for a Component/Baseline:


IConfiguration conf = temp.configuration(tempComp);
Collection<IVersionableHandle> col =
conf.childEntriesForRoot(null);
for(Iterator<IVersionableHandle> colIter = col.iterator();
colIter.hasNext();){
....
...
}

How can I fetch the past "revisions" of files, that I assume
are saved in the repository anytime they are modified and checked in?
cheers
Giacomo


Try IComponent#getInitialBaseline() for the starting point.
Workspaces have a historic baseline audit trail which can be referenced
off of IWorkspaceConnection.

HTH,
JohnC
SCM Server

0 votes


Permanent link


connection.changeHistory().getHistoryFor( ... )




Is there a way to get IComponentHandle as required by changeHistory()

from IResource?


I tried looking around but don't know where should I look/ what should I search for.


**Edit**

just figured it out,

IWorkspaceManager.findComponents() did the job for me


****

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,954

Question asked: Mar 17 '08, 11:21 a.m.

Question was seen: 7,594 times

Last updated: Mar 17 '08, 11:21 a.m.

Confirmation Cancel Confirm