Draft File Diff List Resource¶
Added in 2.0
Provides information on per-file diffs that are part of a draft.
Each of these contains a single, self-contained diff file that applies to exactly one file on a repository.
Details¶
Name | draft_files |
URI | /api/review-requests/{review_request_id}/draft/diffs/{diff_revision}/files/ |
Token Policy ID | draft_file_diff |
HTTP Methods |
|
Parent Resource | |
Child Resources |
Links¶
Name |
Method |
Resource |
---|---|---|
self | GET |
HTTP GET¶
Returns the list of draft 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 |
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 https://reviews.example.com/api/review-requests/8/draft/diffs/2/files/ -H "Accept: application/json"
HTTP 200 OK
Content-Length: 2071
Content-Type: application/vnd.reviewboard.org.files+json
ETag: f5182a43a05901ab96922a46bfc5250d639d6ec7
Item-Content-Type: application/vnd.reviewboard.org.file+json
Vary: Accept, Cookie
X-Content-Type-Options: nosniff
{
"files": [
{
"binary": false,
"dest_attachment": null,
"dest_detail": "(working copy)",
"dest_file": "/trunk/reviewboard/settings_local.py.tmpl",
"encoding": "utf-8",
"extra_data": {
"delete_count": 9,
"encoding": "utf-8",
"equal_count": 31,
"insert_count": 4,
"orig_sha1": "5ab9c202636417016379061749915006efac40a0",
"patched_sha1": "a9a5606c12ccf3a7d064b5ae3ff147f27535e2a2",
"raw_delete_count": 9,
"raw_insert_count": 4,
"replace_count": 0,
"total_line_count": 44
},
"id": 35,
"links": {
"original_file": {
"href": "https://reviews.example.com/api/review-requests/8/draft/diffs/2/files/35/original-file/",
"method": "GET"
},
"patched_file": {
"href": "https://reviews.example.com/api/review-requests/8/draft/diffs/2/files/35/patched-file/",
"method": "GET"
},
"self": {
"href": "https://reviews.example.com/api/review-requests/8/draft/diffs/2/files/35/",
"method": "GET"
},
"update": {
"href": "https://reviews.example.com/api/review-requests/8/draft/diffs/2/files/35/",
"method": "PUT"
}
},
"source_attachment": null,
"source_file": "/trunk/reviewboard/settings_local.py.tmpl",
"source_revision": "1797",
"status": "modified"
},
{
"binary": false,
"dest_attachment": null,
"dest_detail": "(revision 0)",
"dest_file": "/trunk/reviewboard/TESTING",
"encoding": null,
"extra_data": {},
"id": 37,
"links": {
"original_file": {
"href": "https://reviews.example.com/api/review-requests/8/draft/diffs/2/files/37/original-file/",
"method": "GET"
},
"patched_file": {
"href": "https://reviews.example.com/api/review-requests/8/draft/diffs/2/files/37/patched-file/",
"method": "GET"
},
"self": {
"href": "https://reviews.example.com/api/review-requests/8/draft/diffs/2/files/37/",
"method": "GET"
},
"update": {
"href": "https://reviews.example.com/api/review-requests/8/draft/diffs/2/files/37/",
"method": "PUT"
}
},
"source_attachment": null,
"source_file": "/trunk/reviewboard/TESTING",
"source_revision": "PRE-CREATION",
"status": "modified"
}
],
"links": {
"self": {
"href": "https://reviews.example.com/api/review-requests/8/draft/diffs/2/files/",
"method": "GET"
}
},
"stat": "ok",
"total_results": 2
}