It's all about the answers!

Ask a question

What is the difference between locateAncestors and determineAncestorsInHistory?

Albert Yao (5411322) | asked Aug 06 '18, 5:16 a.m.
edited Aug 06 '18, 5:25 a.m.
My RTC version is 6.0.3. 
RTC's plain Java API has the interface : IConfiguration, 
and IConfiguration has two methods : locateAncestors and determineAncestorsInHistory which both reutrn List<IAncestorReport>. 
I have an IChangeSet as input, and I can get the IChange and IVersionableHandle by the IChangeSet. 
And I have an IConfiguration, but which method should I use to get List<IAncestorReport>?
In which situation, should I choose locateAncestors?
And under which condition, should I use determineAncestorsInHistory? 
Or just the two methods behavior the same way and reach the same goal?

One answer

permanent link
David Lafreniere (4.8k7) | answered Aug 16 '18, 1:03 p.m.
IConfiguration.locateAncestors will not return an IAncestorReport for a file that does not exist in the configuration. Ex: a file used to exist, but has since been deleted.
However, IConfiguration.determineAncestorsInHistory will attempt to find the 'last known' path for that deleted file and return an IAncestorReport that describes where it was before it was deleted. Note: This is a best effort attempt as It is not guaranteed to find a 'last known path'. (this is because the algorithm inspects the last 2048 change sets to see if they contain the file deletion, but will not traverse deeper into history to attempt to find a file that may possibly have never existed in that configuration).

Your answer

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