fetch file "revisions" from a Component
![](http://jazz.net/_images/myphoto/06a089ab430fa9da70fc39a81a65d146.jpg)
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:
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
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
5 answers
![](http://jazz.net/_images/myphoto/06a089ab430fa9da70fc39a81a65d146.jpg)
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:
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
![](http://jazz.net/_images/myphoto/06a089ab430fa9da70fc39a81a65d146.jpg)
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:
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
![](http://jazz.net/_images/myphoto/06a089ab430fa9da70fc39a81a65d146.jpg)
ghezzi wrote:
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
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
![](http://jazz.net/_images/myphoto/06a089ab430fa9da70fc39a81a65d146.jpg)
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
****