Diff Resource¶
Name | diff |
URI | /api/review-requests/{review_request_id}/diffs/{diff_revision}/ |
Description | Provides information on a collection of complete diffs. Each diff contains individual per-file diffs as child resources. A diff is revisioned, and more than one can be associated with any particular review request. |
HTTP Methods |
|
Parent Resource | Diff List Resource |
Child Resources | |
Anonymous Access | Yes, if anonymous site access is enabled |
Fields¶
Field | Type | Description |
---|---|---|
id | Integer | The numeric ID of the diff. |
name | String | The name of the diff, usually the filename. |
repository | Repository Resource | The repository that the diff is applied against. |
revision | Integer | The revision of the diff. Starts at 1 for public diffs. Draft diffs may be at 0. |
timestamp | String | The date and time that the diff was uploaded (in YYYY-MM-DD HH:MM:SS format). |
Links¶
Name | Method | Resource |
---|---|---|
files | GET | File Diff List Resource |
self | GET | Diff Resource |
HTTP GET¶
Returns the information or contents on a particular diff.
The output varies by mimetype.
If application/json or application/xml is used, then the fields for the diff are returned, like with any other resource.
If text/x-patch is used, then the actual diff file itself is returned. This diff should be as it was when uploaded originally, with potentially some extra SCM-specific headers stripped. The contents will contain that of all per-file diffs that make up this diff.
Examples¶
application/json¶
{
"diff": {
"id": 8,
"links": {
"files": {
"href": "http://reviews.example.com/api/review-requests/8/diffs/1/files/",
"method": "GET"
},
"repository": {
"href": "http://reviews.example.com/api/repositories/1/",
"method": "GET",
"title": "Review Board SVN"
},
"self": {
"href": "http://reviews.example.com/api/review-requests/8/diffs/1/",
"method": "GET"
}
},
"name": "diff",
"revision": 1,
"timestamp": "2009-02-25 02:01:21"
},
"stat": "ok"
}
application/xml¶
<?xml version="1.0" encoding="utf-8"?>
<rsp>
<diff>
<timestamp>2009-02-25 02:01:21</timestamp>
<name>diff</name>
<id>8</id>
<links>
<files>
<href>http://reviews.example.com/api/review-requests/8/diffs/1/files/</href>
<method>GET</method>
</files>
<self>
<href>http://reviews.example.com/api/review-requests/8/diffs/1/</href>
<method>GET</method>
</self>
<repository>
<href>http://reviews.example.com/api/repositories/1/</href>
<method>GET</method>
<title>Review Board SVN</title>
</repository>
</links>
<revision>1</revision>
</diff>
<stat>ok</stat>
</rsp>