It's all about the answers!

Ask a question

What is the difference between locateAncestors and determineAncestorsInHistory?


0
1
Albert Yao (521917) | 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.3k7) | answered Aug 16 '18, 1:03 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
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.