Diff Context Resource¶
Added in 2.0
Provides context information for a specific diff view.
The output of this is more or less internal to the Review Board web UI. This will return the various pieces of information required to render a diff view for a given diff revision/interdiff. This is used to re-render the diff viewer without a reload when navigating between revisions.
Details¶
Name | diff_context |
URI | /api/review-requests/{review_request_id}/diff-context/ |
Token Policy ID | diff_context |
HTTP Methods |
|
Parent Resource | |
Child Resources | None |
Links¶
Name |
Method |
Resource |
---|---|---|
self | GET |
HTTP GET¶
Returns the context info for a particular revision or interdiff.
The output of this is more or less internal to the Review Board web UI. The result will be an object with several fields for the files in the diff, pagination information, and other data which is used to render the diff viewer page.
Note that in versions 2.0.0 through 2.0.6, the interdiff-revision
parameter was named interdiff_revision
. Because of the internal
nature of this API, this was changed without adding backwards
compatibility for 2.0.7.
Request Parameters¶
base-commit-idInteger | The ID of the base commit to use to generate the diff for review requests created with commit history. Only changes from after the specified commit will be included in the diff. |
filenamesString | A list of case-sensitive filenames or Unix shell patterns used to filter the resulting list of files. Added in 3.0.4 |
interdiff-revisionInteger | A tip revision for showing interdiffs. If this is provided, the Added in 2.0.7 |
pageInteger | The page number for paginated diffs. |
revisionInteger | Which revision of the diff to show. |
tip-commit-idInteger | The ID of the tip commit to use to generate the diff for review requests created with commit history. No changes from beyond this commit will be included in the diff. |
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.diff-context+json¶
$ curl https://reviews.example.com/api/review-requests/10/diff-context/ -H "Accept: application/json"
HTTP 200 OK
Content-Length: 801
Content-Type: application/vnd.reviewboard.org.diff-context+json
ETag: 809041cb8c24146bf6159a3d2d14cff467aa8300
Vary: Accept, Cookie
X-Content-Type-Options: nosniff
{
"diff_context": {
"comments_hint": {
"commits_with_comments": [],
"diffsets_with_comments": [],
"has_other_comments": false,
"interdiffs_with_comments": []
},
"commit_history_diff": null,
"commits": [
{
"author_name": "Christian Hammond",
"commit_id": "224589cf334e9baafeac1165be5e5c04991fd65e",
"commit_message": "modified tests\n",
"id": 4,
"parent_id": "e76c016e09c415d7afc4c004a8a290b3c51bff59"
}
],
"filename_patterns": [],
"files": [],
"num_diffs": 2,
"pagination": {
"current_page": 1,
"has_next": false,
"has_previous": false,
"is_paginated": false,
"page_numbers": [
1
],
"pages": 1
},
"revision": {
"base_commit_id": null,
"interdiff_revision": null,
"is_draft_diff": false,
"is_draft_interdiff": false,
"is_interdiff": false,
"latest_revision": 2,
"revision": 3,
"tip_commit_id": null
}
},
"stat": "ok"
}