File Diff List Resource¶
Provides information on per-file diffs.
Each of these contains a single, self-contained diff file that applies to exactly one file on a repository.
Details¶
Name | files |
URI | /api/review-requests/{review_request_id}/diffs/{diff_revision}/files/ |
Token Policy ID | file_diff |
HTTP Methods |
|
Parent Resource | Diff Resource |
Child Resources | |
Anonymous Access | Yes, if anonymous site access is enabled |
Links¶
Name | Method | Resource |
---|---|---|
self | GET | File Diff List Resource |
HTTP GET¶
Returns the list of public per-file diffs on the review request.
Each per-file diff has information about the diff. It does not provide the contents of the diff. For that, access the per-file diff’s resource directly and use the correct mimetype.
Request Parameters¶
counts-onlyBoolean | If specified, a single count field is returned with the number of results, instead of the results themselves. |
max-resultsInteger | The maximum number of results to return in this list. By default, this is 25. There is a hard limit of 200; if you need more than 200 results, you will need to make more than one request, using the “next” pagination link. |
startInteger | The 0-based index of the first result in the list. The start index is usually the previous start index plus the number of previous results. By default, this is 0. |
Errors¶
100 - Does Not ExistHTTP 404 - Not Found | Object does not exist |
101 - Permission DeniedHTTP 403 - Forbidden | You don’t have permission for this |
103 - Not Logged InHTTP 401 - Unauthorized | You are not logged in |
105 - Invalid Form DataHTTP 400 - Bad Request | One or more fields had errors |
112 - OAuth2 Missing Scope ErrorHTTP 403 - Forbidden | Your OAuth2 token lacks the necessary scopes for this request. |
113 - OAuth2 Access Denied ErrorHTTP 403 - Forbidden | OAuth2 token access for this resource is prohibited. |
Examples¶
application/vnd.reviewboard.org.files+json¶
$ curl http://reviews.example.com/api/review-requests/8/diffs/1/files/ -H "Accept: application/json"
Vary: Accept, Cookie
Item-Content-Type: application/vnd.reviewboard.org.file+json
Content-Type: application/vnd.reviewboard.org.files+json
X-Content-Type-Options: nosniff
{
"files": [
{
"dest_attachment": null,
"dest_detail": "(working copy)",
"dest_file": "/trunk/reviewboard/settings_local.py.tmpl",
"extra_data": {
"delete_count": 5,
"equal_count": 35,
"insert_count": 4,
"orig_sha1": "5ab9c202636417016379061749915006efac40a0",
"patched_sha1": "2c08ecb7ba61733c2ef794c1fa7e49090a4a334f",
"raw_delete_count": 5,
"raw_insert_count": 4,
"replace_count": 0,
"total_line_count": 44
},
"id": 31,
"links": {
"diff_comments": {
"href": "http://reviews.example.com/api/review-requests/8/diffs/1/files/31/diff-comments/",
"method": "GET"
},
"original_file": {
"href": "http://reviews.example.com/api/review-requests/8/diffs/1/files/31/original-file/",
"method": "GET"
},
"patched_file": {
"href": "http://reviews.example.com/api/review-requests/8/diffs/1/files/31/patched-file/",
"method": "GET"
},
"self": {
"href": "http://reviews.example.com/api/review-requests/8/diffs/1/files/31/",
"method": "GET"
},
"update": {
"href": "http://reviews.example.com/api/review-requests/8/diffs/1/files/31/",
"method": "PUT"
}
},
"source_attachment": null,
"source_file": "/trunk/reviewboard/settings_local.py.tmpl",
"source_revision": "1797",
"status": "modified"
},
{
"dest_attachment": null,
"dest_detail": "(revision 0)",
"dest_file": "/trunk/reviewboard/TESTING",
"extra_data": {},
"id": 36,
"links": {
"diff_comments": {
"href": "http://reviews.example.com/api/review-requests/8/diffs/1/files/36/diff-comments/",
"method": "GET"
},
"original_file": {
"href": "http://reviews.example.com/api/review-requests/8/diffs/1/files/36/original-file/",
"method": "GET"
},
"patched_file": {
"href": "http://reviews.example.com/api/review-requests/8/diffs/1/files/36/patched-file/",
"method": "GET"
},
"self": {
"href": "http://reviews.example.com/api/review-requests/8/diffs/1/files/36/",
"method": "GET"
},
"update": {
"href": "http://reviews.example.com/api/review-requests/8/diffs/1/files/36/",
"method": "PUT"
}
},
"source_attachment": null,
"source_file": "/trunk/reviewboard/TESTING",
"source_revision": "PRE-CREATION",
"status": "modified"
}
],
"links": {
"self": {
"href": "http://reviews.example.com/api/review-requests/8/diffs/1/files/",
"method": "GET"
}
},
"stat": "ok",
"total_results": 2
}