我使用REST API从项目中检索变更集。例如,我得到以下响应:
{
"changes": [
{
"kind": 2,
"item": {
"uri": "itemOid/com.ibm.team.filesystem.FileItem/_2ItWACJKEeGAaaEbbqTtgw",
"itemId": "_2ItWACJKEeGAaaEbbqTtgw",
"com.ibm.team.repository.typeName": "com.ibm.team.filesystem.FileItem"
},
"before": "_Rx7-BCJaEeG25dOp_iUerQ",
"after": "_Ngn9BCJeEeG25dOp_iUerQ",
"internalId": "_NhCzwCJeEeG25dOp_iUerQ"
},
{
"kind": 1,
"item": {
"uri": "itemOid/com.ibm.team.filesystem.FileItem/_GWB-kCJeEeGAaaEbbqTtgw",
"itemId": "_GWB-kCJeEeGAaaEbbqTtgw",
"com.ibm.team.repository.typeName": "com.ibm.team.filesystem.FileItem"
},
"before": null,
"after": "_Ngn9CyJeEeG25dOp_iUerQ",
"internalId": "_NhCzwSJeEeG25dOp_iUerQ"
}
],
"comment": "",
"lastUpdatedDate": "2011-12-09T12:06:52.266Z",
"active": false,
"owner": {
"uri": "itemOid/com.ibm.team.repository.Contributor/_hhbosPC1EeCsJbI2ZgPDog",
"itemId": "_hhbosPC1EeCsJbI2ZgPDog",
"com.ibm.team.repository.typeName": "com.ibm.team.repository.Contributor"
},
"com.ibm.team.repository.typeName": "com.ibm.team.scm.ChangeSet",
"stateId": "_R7C54SJeEeG25dOp_iUerQ",
"component": {
"uri": "itemOid/com.ibm.team.scm.Component/_auolkPC9EeCek69P-ztT9w",
"itemId": "_auolkPC9EeCek69P-ztT9w",
"com.ibm.team.repository.typeName": "com.ibm.team.scm.Component"
},
"contextId": "_Dp6kMdwTEd2jUupDpQV1Rw",
"predecessor": "_NhCzwiJeEeG25dOp_iUerQ",
"modified": "2011-12-09T12:06:52.288Z",
"mergePredecessor": null,
"uri": "itemOid/com.ibm.team.scm.ChangeSet/_Nb_UoCJeEeG25dOp_iUerQ",
"itemId": "_Nb_UoCJeEeG25dOp_iUerQ",
"properties": [
],
"modifiedBy": {
"uri": "itemOid/com.ibm.team.repository.Contributor/_hhbosPC1EeCsJbI2ZgPDog",
"itemId": "_hhbosPC1EeCsJbI2ZgPDog",
"com.ibm.team.repository.typeName": "com.ibm.team.repository.Contributor"
},
"xComponentLink": null,
"etag": "_R7C54SJeEeG25dOp_iUerQ"
}
现在我想找到源代码文件以及更改。但是我该怎么做呢?当我尝试发送HTTP Get到列表更改中的uri时,我得到一个坏请求400错误。我能做什么?
您正在调用的其余调用可能不是API -使用它需要自担风险。格式在未来很可能会改变。我假设您在使用源代码控制Web UI时发现了这个rest调用。你可以转到历史视图,查看更改,转到更改后或更改之前的状态。这将带您到状态视图。右键单击下载链接。这是获取URI所需的一种方法,以获取与变更集中的变更中引用的特定状态相关联的内容。