IFlowNodeConnection.compareTo results are truncated.
When I am comparing a workspace to a stream in the GUI, I get complete results. However, when I use IFlowNodeConnection.compareTo() with the plain java client it appears the results are truncated. I have tried both with a monitor and without.
Is there something that limits the results returned when using the API or a way to get the full set?
Is there something that limits the results returned when using the API or a way to get the full set?
3 answers
It depends on the comparison flags you gave to the compare call. Look at WorkspaceComparisonFlags for the options available.
Comments
I am using one of the flags (CHANGE_SET_COMPARISON_ONLY). The problem is that I am only getting about half of the change sets. When I compare in the GUI compare,
I get complete the set of changes. When I use the API, they are all there in the correct order (oldest first) up to a point and it simply stops. Like some limit has been reached...
I do not see any flags like get all results, etc. Perhaps I am missing something...
I'm not aware of any limit in the workspace comparison result. Can you provide a code sample or some more detail of what the comparison is supposed to show (ie. incoming/outgoing baselines, incoming/outgoing change sets)?
Here is the sample code, and I get the exact same results using diffRpt.incomingChangeSets() as I do with the code that loops through the components (just trying diff things...). It is strange, it matches the GUI client output exactly until it just stops in the middle... so, the logic seems valid, the compareTo is not returning the complete set... This is just quick code, so not robust...
public List<IChangeSetHandle> findChgSets(IWorkspaceConnection older, IWorkspaceConnection newer, String component) {
IChangeHistorySyncReport diffRpt;
try {
diffRpt = older.compareTo(newer, WorkspaceComparisonFlags.CHANGE_SET_COMPARISON_ONLY, Collections.EMPTY_LIST, null);
List<IChangeSetHandle> result = new LinkedList<IChangeSetHandle>();
for (Object obj : newer.getComponents()) {
IComponentHandle handle = (IComponentHandle)obj;
result.addAll(diffRpt.incomingChangeSets(handle));
}
// result.addAll(diffRpt.incomingChangeSets());
return result;
} catch (TeamRepositoryException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
public List<IChangeSetHandle> findChgSets(IWorkspaceConnection older, IWorkspaceConnection newer, String component) {
IChangeHistorySyncReport diffRpt;
try {
diffRpt = older.compareTo(newer, WorkspaceComparisonFlags.CHANGE_SET_COMPARISON_ONLY, Collections.EMPTY_LIST, null);
List<IChangeSetHandle> result = new LinkedList<IChangeSetHandle>();
for (Object obj : newer.getComponents()) {
IComponentHandle handle = (IComponentHandle)obj;
result.addAll(diffRpt.incomingChangeSets(handle));
}
// result.addAll(diffRpt.incomingChangeSets());
return result;
} catch (TeamRepositoryException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
I have determined the mistake I made... There was a workspace with the same name as the stream I wanted to compare with. And in my code where I was establishing the IWorkspaceConnection, I sent in the wrong type and said it was a workspace. So, I was comparing to someone's workspace instead of the stream I wanted... Obviously this workspace was not complete.
We figured this out by using scm compare. As a side note, scm compare found both the workspace and the stream and so it said it was ambiguous. However, I told it on the command line it was a stream. So, somehow scm compare is seeing both workspaces and streams even when indicated it was a stream... Not a big deal...
We figured this out by using scm compare. As a side note, scm compare found both the workspace and the stream and so it said it was ambiguous. However, I told it on the command line it was a stream. So, somehow scm compare is seeing both workspaces and streams even when indicated it was a stream... Not a big deal...