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:
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
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, |
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, |
Can you please tell me how can I get the baseline in the first place?
Thanks |
ghezzi wrote:
Hi, 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 |
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 **** |
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.