As long as the javadoc for IConfiguration.determineAncestorsInHistory does not indicate, the server side equivalent of IScmService.configurationDetermineAncestorsInHistory (which is ultimately called) says this in javadoc:
* @param versionableItemHandles * a list of versionable items; only the item ids are needed; * must not be <code>null</code>
Basically, defineAncestorsInHistory does not look for a state identifier in files, it only looks at the element identifier.
The specific state of the file to be considered is determined by the configuration. This happens mainly because until the state of the file in the change set tells you the name of this file, it will not tell you the name of the parent folder. This will depend on the state of the folder, which is present in the workspace at a certain time and may be different for different workspaces.
You basically need to get an IConfiguration representing your workspace when the change set has been accepted / created.
As I see it, I need to get IWorkspaceConnection.changeHistory(component) (this is actually defined in IFlowNodeConnection). You will need to go through the history by calling IChangeHistory.previousHistory(monitor) until you find the one that contains your IChangeHistory.recent(monitor) in IChangeHistory.recent(monitor) . When you find the appropriate IChangeHistory, use IChangeHistory.configuration() to call defineAncestorsInHistory.
Note that this configuration represents the state of the workspace at the end of this particular IChangeHistory, so to be completely accurate, you will need to check the changes that occur after the change in IChangeHistory.recent to see if any of them have changed your name file (or any of the file names with folder names).
(Another alternative is to use story 1 configuration, the previous story containing your changeset, and then view the effects of the changes that occurred before your change)
source share