我尝试在纯 java 中以编程方式比较来自一个流的两个快照......
第 1 步:获取我的流(工作)
IWorkspaceConnection stream = null;
List<IWorkspaceConnection> list = RtcAdapter.inst().getStreams(); //my library
for (IWorkspaceConnection connection: list){
if (connection.getName().equalsIgnoreCase("myStreamName") ){
stream = connection;
break;
}
}//now we have found our stream
第 2 步:获取基线(工作)
List<IBaselineSet> snapShotList =
RtcAdapter.inst().getSnapShotsFromStream(stream);
IBaselineSet snapShot0 = null;
IBaselineSet snapShot1 = null;
for (IBaselineSet snapShot: snapShotList){
if (snapShot.getName().equalsIgnoreCase("mySnapShotName0") ){
snapShot0 = snapShot;
}
if (snapShot.getName().equalsIgnoreCase("mySnapShotName1") ){
snapShot1 = snapShot;
}
}//now we've got also my two snapShots
第3步:相互比较(不工作)
IUpdateReport report =
workspaceManager.compareBaselineSetConfigurations(
snapShot0, snapShot0, stream.getComponents(), monitor);
我的报告是空的……--烦人--
report=com.ibm.team.scm.common.internal.dto.impl.UpdateReportImpl@1de5a20 (stateBefore: <unset>, stateAfter: <unset>)
我还尝试获取 ChangeHistorySyncReport ......
IChangeHistorySyncReport report =
workspaceManager.compareBaselineSets(
snapShot0, snapShot1, componentList(stream), monitor);
报告也是空的...
那么如何创建正确的报告呢?或者我如何比较两个基线?(我究竟做错了什么?
report.getAffectedComponents()
返回一个空数组,也一样report.getModifiedComponents()
更新 据我所知,我必须检查 ChangeHistorySyncReport ......当我打印我的报告时,它说:
com.ibm.team.scm.common.internal.dto.impl.ChangeHistorySyncReportImpl@150f091 (localTime: <unset>, remoteTime: <unset>, compareFlags: <unset>)
这让我的问题更深了——如何设置更好的 CompareFlags?