Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1 | = Gerrit Code Review - /changes/ REST API |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 2 | |
| 3 | This page describes the change related REST endpoints. |
| 4 | Please also take note of the general information on the |
| 5 | link:rest-api.html[REST API]. |
| 6 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 7 | [[change-endpoints]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8 | == Change Endpoints |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 9 | |
Edwin Kempin | 7620274 | 2013-02-15 13:51:50 +0100 | [diff] [blame] | 10 | [[list-changes]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 11 | === Query Changes |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 12 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 13 | 'GET /changes/' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 14 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 15 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 16 | Queries changes visible to the caller. The query string must be |
| 17 | provided by the `q` parameter. The `n` parameter can be used to limit |
| 18 | the returned results. |
| 19 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 20 | As result a list of link:#change-info[ChangeInfo] entries is returned. |
| 21 | The change output is sorted by the last update time, most recently |
| 22 | updated to oldest updated. |
| 23 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 24 | Query for open changes of watched projects: |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 25 | |
| 26 | .Request |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 27 | ---- |
Edwin Kempin | 2091edb | 2013-01-23 19:07:38 +0100 | [diff] [blame] | 28 | GET /changes/?q=status:open+is:watched&n=2 HTTP/1.0 |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 29 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 30 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 31 | .Response |
| 32 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 33 | HTTP/1.1 200 OK |
| 34 | Content-Disposition: attachment |
| 35 | Content-Type: application/json;charset=UTF-8 |
| 36 | |
| 37 | )]}' |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 38 | [ |
| 39 | { |
| 40 | "kind": "gerritcodereview#change", |
| 41 | "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 42 | "project": "demo", |
| 43 | "branch": "master", |
| 44 | "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 45 | "subject": "One change", |
| 46 | "status": "NEW", |
| 47 | "created": "2012-07-17 07:18:30.854000000", |
| 48 | "updated": "2012-07-17 07:19:27.766000000", |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 49 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 50 | "insertions": 26, |
| 51 | "deletions": 10, |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 52 | "_sortkey": "001e7057000006dc", |
| 53 | "_number": 1756, |
| 54 | "owner": { |
| 55 | "name": "John Doe" |
| 56 | }, |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 57 | }, |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 58 | { |
| 59 | "kind": "gerritcodereview#change", |
| 60 | "id": "demo~master~I09c8041b5867d5b33170316e2abc34b79bbb8501", |
| 61 | "project": "demo", |
| 62 | "branch": "master", |
| 63 | "change_id": "I09c8041b5867d5b33170316e2abc34b79bbb8501", |
| 64 | "subject": "Another change", |
| 65 | "status": "NEW", |
| 66 | "created": "2012-07-17 07:18:30.884000000", |
| 67 | "updated": "2012-07-17 07:18:30.885000000", |
| 68 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 69 | "insertions": 12, |
| 70 | "deletions": 18, |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 71 | "_sortkey": "001e7056000006dd", |
| 72 | "_number": 1757, |
| 73 | "owner": { |
| 74 | "name": "John Doe" |
| 75 | }, |
| 76 | "_more_changes": true |
| 77 | } |
| 78 | ] |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 79 | ---- |
| 80 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 81 | If the `n` query parameter is supplied and additional changes exist |
| 82 | that match the query beyond the end, the last change object has a |
| 83 | `_more_changes: true` JSON field set. Callers can resume a query with |
Christian Aistleitner | 5536401 | 2013-02-17 12:18:22 +0100 | [diff] [blame] | 84 | the `N` query parameter, supplying the last change's `_sortkey` field |
| 85 | as the value. When going in the reverse direction with the `P` query |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 86 | parameter a `_more_changes: true` is put in the first change object if |
| 87 | there are results *before* the first change returned. |
| 88 | |
| 89 | Clients are allowed to specify more than one query by setting the `q` |
| 90 | parameter multiple times. In this case the result is an array of |
| 91 | arrays, one per query in the same order the queries were given in. |
| 92 | |
Edwin Kempin | a64c4b9 | 2013-01-23 11:30:40 +0100 | [diff] [blame] | 93 | .Query for the 25 most recent open changes of the projects that you watch |
| 94 | **** |
| 95 | get::/changes/?q=status:open+is:watched&n=25 |
| 96 | **** |
| 97 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 98 | Query that retrieves changes for a user's dashboard: |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 99 | |
| 100 | .Request |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 101 | ---- |
| 102 | GET /changes/?q=is:open+owner:self&q=is:open+reviewer:self+-owner:self&q=is:closed+owner:self+limit:5&o=LABELS HTTP/1.0 |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 103 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 104 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 105 | .Response |
| 106 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 107 | HTTP/1.1 200 OK |
| 108 | Content-Disposition: attachment |
| 109 | Content-Type: application/json;charset=UTF-8 |
| 110 | |
| 111 | )]}' |
| 112 | [ |
| 113 | [ |
| 114 | { |
| 115 | "kind": "gerritcodereview#change", |
| 116 | "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 117 | "project": "demo", |
| 118 | "branch": "master", |
| 119 | "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 120 | "subject": "One change", |
| 121 | "status": "NEW", |
| 122 | "created": "2012-07-17 07:18:30.854000000", |
| 123 | "updated": "2012-07-17 07:19:27.766000000", |
Edwin Kempin | db1f0b8 | 2013-02-21 15:07:00 +0100 | [diff] [blame] | 124 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 125 | "insertions": 4, |
| 126 | "deletions": 7, |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 127 | "_sortkey": "001e7057000006dc", |
| 128 | "_number": 1756, |
| 129 | "owner": { |
| 130 | "name": "John Doe" |
| 131 | }, |
| 132 | "labels": { |
| 133 | "Verified": {}, |
| 134 | "Code-Review": {} |
| 135 | } |
| 136 | } |
| 137 | ], |
| 138 | [], |
| 139 | [] |
| 140 | ] |
| 141 | ---- |
| 142 | |
Edwin Kempin | a64c4b9 | 2013-01-23 11:30:40 +0100 | [diff] [blame] | 143 | .Query the changes for your user dashboard |
| 144 | **** |
| 145 | get::/changes/?q=is:open+owner:self&q=is:open+reviewer:self+-owner:self&q=is:closed+owner:self+limit:5&o=LABELS |
| 146 | **** |
| 147 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 148 | Additional fields can be obtained by adding `o` parameters, each |
| 149 | option requires more database lookups and slows down the query |
| 150 | response time to the client so they are generally disabled by |
| 151 | default. Optional fields are: |
| 152 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 153 | [[labels]] |
| 154 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 155 | * `LABELS`: a summary of each label required for submit, and |
| 156 | approvers that have granted (or rejected) with that label. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 157 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 158 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 159 | [[detailed-labels]] |
| 160 | -- |
Dave Borowitz | 4c7231a | 2013-01-30 16:18:59 -0800 | [diff] [blame] | 161 | * `DETAILED_LABELS`: detailed label information, including numeric |
Dave Borowitz | 992ddd7 | 2013-02-13 11:53:17 -0800 | [diff] [blame] | 162 | values of all existing approvals, recognized label values, values |
| 163 | permitted to be set by the current user, and reviewers that may be |
| 164 | removed by the current user. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 165 | -- |
Dave Borowitz | 4c7231a | 2013-01-30 16:18:59 -0800 | [diff] [blame] | 166 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 167 | [[current-revision]] |
| 168 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 169 | * `CURRENT_REVISION`: describe the current revision (patch set) |
| 170 | of the change, including the commit SHA-1 and URLs to fetch from. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 171 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 172 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 173 | [[all-revisions]] |
| 174 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 175 | * `ALL_REVISIONS`: describe all revisions, not just current. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 176 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 177 | |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 178 | [[download_commands]] |
| 179 | -- |
| 180 | * `DOWNLOAD_COMMANDS`: include the `commands` field in the |
| 181 | link:#fetch-info[FetchInfo] for revisions. Only valid when the |
| 182 | `CURRENT_REVISION` or `ALL_REVISIONS` option is selected. |
| 183 | -- |
| 184 | |
David Ostrovsky | 17d0d33 | 2013-09-30 21:36:09 +0200 | [diff] [blame] | 185 | [[draft_comments]] |
| 186 | -- |
| 187 | * `DRAFT_COMMENTS`: include the `has_draft_comments` field for |
| 188 | revisions. Only valid when the `CURRENT_REVISION` or `ALL_REVISIONS` |
| 189 | option is selected. |
Dave Borowitz | 685bad9 | 2013-10-03 11:24:07 -0700 | [diff] [blame] | 190 | -- |
David Ostrovsky | 17d0d33 | 2013-09-30 21:36:09 +0200 | [diff] [blame] | 191 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 192 | [[current-commit]] |
| 193 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 194 | * `CURRENT_COMMIT`: parse and output all header fields from the |
David Pursehouse | 98006e8 | 2013-10-02 10:15:52 +0900 | [diff] [blame] | 195 | commit object, including message. Only valid when the |
| 196 | `CURRENT_REVISION` or `ALL_REVISIONS` option is selected. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 197 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 198 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 199 | [[all-commits]] |
| 200 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 201 | * `ALL_COMMITS`: parse and output all header fields from the |
| 202 | output revisions. If only `CURRENT_REVISION` was requested |
| 203 | then only the current revision's commit data will be output. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 204 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 205 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 206 | [[current-files]] |
| 207 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 208 | * `CURRENT_FILES`: list files modified by the commit, including |
| 209 | basic line counts inserted/deleted per file. Only valid when |
David Pursehouse | 98006e8 | 2013-10-02 10:15:52 +0900 | [diff] [blame] | 210 | the `CURRENT_REVISION` or `ALL_REVISIONS` option is selected. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 211 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 212 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 213 | [[all-files]] |
| 214 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 215 | * `ALL_FILES`: list files modified by the commit, including |
| 216 | basic line counts inserted/deleted per file. If only the |
David Pursehouse | 98006e8 | 2013-10-02 10:15:52 +0900 | [diff] [blame] | 217 | `CURRENT_REVISION` was requested then only that commit's |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 218 | modified files will be output. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 219 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 220 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 221 | [[detailed-accounts]] |
| 222 | -- |
Edwin Kempin | 4a00e22 | 2013-10-16 14:34:24 +0200 | [diff] [blame] | 223 | * `DETAILED_ACCOUNTS`: include `_account_id`, `email` and `username` |
| 224 | fields when referencing accounts. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 225 | -- |
Dave Borowitz | 8926a88 | 2013-02-01 14:32:48 -0800 | [diff] [blame] | 226 | |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 227 | [[messages]] |
| 228 | -- |
| 229 | * `MESSAGES`: include messages associated with the change. |
| 230 | -- |
| 231 | |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 232 | [[actions]] |
| 233 | -- |
| 234 | * `CURRENT_ACTIONS`: include information on available actions |
| 235 | for the change and its current revision. The caller must be |
| 236 | authenticated to obtain the available actions. |
| 237 | -- |
| 238 | |
Shawn Pearce | 414c5ff | 2013-09-06 21:51:02 -0700 | [diff] [blame] | 239 | [[reviewed]] |
| 240 | -- |
| 241 | * `REVIEWED`: include the `reviewed` field if the caller is |
| 242 | authenticated and has commented on the current revision. |
| 243 | -- |
| 244 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 245 | .Request |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 246 | ---- |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 247 | GET /changes/?q=97&o=CURRENT_REVISION&o=CURRENT_COMMIT&o=CURRENT_FILES&o=DOWNLOAD_COMMANDS HTTP/1.0 |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 248 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 249 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 250 | .Response |
| 251 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 252 | HTTP/1.1 200 OK |
| 253 | Content-Disposition: attachment |
| 254 | Content-Type: application/json;charset=UTF-8 |
| 255 | |
| 256 | )]}' |
| 257 | [ |
| 258 | { |
| 259 | "kind": "gerritcodereview#change", |
| 260 | "id": "demo~master~I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a", |
| 261 | "project": "gerrit", |
| 262 | "branch": "master", |
| 263 | "change_id": "I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a", |
| 264 | "subject": "Use an EventBus to manage star icons", |
| 265 | "status": "NEW", |
| 266 | "created": "2012-04-25 00:52:25.580000000", |
| 267 | "updated": "2012-04-25 00:52:25.586000000", |
Edwin Kempin | db1f0b8 | 2013-02-21 15:07:00 +0100 | [diff] [blame] | 268 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 269 | "insertions": 16, |
| 270 | "deletions": 7, |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 271 | "_sortkey": "001c9bf400000061", |
| 272 | "_number": 97, |
| 273 | "owner": { |
| 274 | "name": "Shawn Pearce" |
| 275 | }, |
| 276 | "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c", |
| 277 | "revisions": { |
| 278 | "184ebe53805e102605d11f6b143486d15c23a09c": { |
| 279 | "_number": 1, |
| 280 | "fetch": { |
| 281 | "git": { |
| 282 | "url": "git://localhost/gerrit", |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 283 | "ref": "refs/changes/97/97/1", |
| 284 | "commands": { |
| 285 | "Checkout": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD", |
| 286 | "Cherry-Pick": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD", |
| 287 | "Format-Patch": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD", |
| 288 | "Pull": "git pull git://localhost/gerrit refs/changes/97/97/1" |
| 289 | } |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 290 | }, |
| 291 | "http": { |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 292 | "url": "http://myuser@127.0.0.1:8080/gerrit", |
| 293 | "ref": "refs/changes/97/97/1", |
| 294 | "commands": { |
| 295 | "Checkout": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD", |
| 296 | "Cherry-Pick": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD", |
| 297 | "Format-Patch": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD", |
| 298 | "Pull": "git pull http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1" |
| 299 | } |
| 300 | }, |
| 301 | "ssh": { |
| 302 | "url": "ssh://myuser@*:29418/gerrit", |
| 303 | "ref": "refs/changes/97/97/1", |
| 304 | "commands": { |
| 305 | "Checkout": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD", |
| 306 | "Cherry-Pick": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD", |
| 307 | "Format-Patch": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD", |
| 308 | "Pull": "git pull ssh://myuser@*:29418/gerrit refs/changes/97/97/1" |
| 309 | } |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 310 | } |
| 311 | }, |
| 312 | "commit": { |
| 313 | "parents": [ |
| 314 | { |
| 315 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 316 | "subject": "Migrate contributor agreements to All-Projects." |
| 317 | } |
| 318 | ], |
| 319 | "author": { |
| 320 | "name": "Shawn O. Pearce", |
| 321 | "email": "sop@google.com", |
| 322 | "date": "2012-04-24 18:08:08.000000000", |
| 323 | "tz": -420 |
| 324 | }, |
| 325 | "committer": { |
| 326 | "name": "Shawn O. Pearce", |
| 327 | "email": "sop@google.com", |
| 328 | "date": "2012-04-24 18:08:08.000000000", |
| 329 | "tz": -420 |
| 330 | }, |
| 331 | "subject": "Use an EventBus to manage star icons", |
| 332 | "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..." |
| 333 | }, |
| 334 | "files": { |
| 335 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeCache.java": { |
| 336 | "lines_deleted": 8 |
| 337 | }, |
| 338 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeDetailCache.java": { |
| 339 | "lines_inserted": 1 |
| 340 | }, |
| 341 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java": { |
| 342 | "lines_inserted": 11, |
| 343 | "lines_deleted": 19 |
| 344 | }, |
| 345 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java": { |
| 346 | "lines_inserted": 23, |
| 347 | "lines_deleted": 20 |
| 348 | }, |
| 349 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarCache.java": { |
| 350 | "status": "D", |
| 351 | "lines_deleted": 139 |
| 352 | }, |
| 353 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarredChanges.java": { |
| 354 | "status": "A", |
| 355 | "lines_inserted": 204 |
| 356 | }, |
| 357 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Screen.java": { |
| 358 | "lines_deleted": 9 |
| 359 | } |
| 360 | } |
| 361 | } |
| 362 | } |
| 363 | } |
| 364 | ] |
| 365 | ---- |
| 366 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 367 | [[get-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 368 | === Get Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 369 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 370 | 'GET /changes/link:#change-id[\{change-id\}]' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 371 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 372 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 373 | Retrieves a change. |
| 374 | |
Dave Borowitz | 0314f73 | 2013-10-03 09:34:30 -0700 | [diff] [blame] | 375 | Additional fields can be obtained by adding `o` parameters, each |
| 376 | option requires more database lookups and slows down the query |
| 377 | response time to the client so they are generally disabled by |
| 378 | default. Fields are described in link:#list-changes[Query Changes]. |
| 379 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 380 | .Request |
| 381 | ---- |
| 382 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0 |
| 383 | ---- |
| 384 | |
| 385 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 386 | describes the change. |
| 387 | |
| 388 | .Response |
| 389 | ---- |
| 390 | HTTP/1.1 200 OK |
| 391 | Content-Disposition: attachment |
| 392 | Content-Type: application/json;charset=UTF-8 |
| 393 | |
| 394 | )]}' |
| 395 | { |
| 396 | "kind": "gerritcodereview#change", |
| 397 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 398 | "project": "myProject", |
| 399 | "branch": "master", |
| 400 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 401 | "subject": "Implementing Feature X", |
| 402 | "status": "NEW", |
| 403 | "created": "2013-02-01 09:59:32.126000000", |
| 404 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 405 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 406 | "insertions": 34, |
| 407 | "deletions": 101, |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 408 | "_sortkey": "0023412400000f7d", |
| 409 | "_number": 3965, |
| 410 | "owner": { |
| 411 | "name": "John Doe" |
| 412 | } |
| 413 | } |
| 414 | ---- |
| 415 | |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 416 | [[get-change-detail]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 417 | === Get Change Detail |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 418 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 419 | 'GET /changes/link:#change-id[\{change-id\}]/detail' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 420 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 421 | |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 422 | Retrieves a change with link:#labels[labels], link:#detailed-labels[ |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 423 | detailed labels], link:#detailed-accounts[detailed accounts], and |
| 424 | link:#messages[messages]. |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 425 | |
Shawn Pearce | 7f3dccf | 2013-07-06 19:24:29 -0700 | [diff] [blame] | 426 | Additional fields can be obtained by adding `o` parameters, each |
| 427 | option requires more database lookups and slows down the query |
| 428 | response time to the client so they are generally disabled by |
| 429 | default. Fields are described in link:#list-changes[Query Changes]. |
| 430 | |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 431 | .Request |
| 432 | ---- |
| 433 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/detail HTTP/1.0 |
| 434 | ---- |
| 435 | |
| 436 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 437 | describes the change. |
| 438 | |
| 439 | .Response |
| 440 | ---- |
| 441 | HTTP/1.1 200 OK |
| 442 | Content-Disposition: attachment |
| 443 | Content-Type: application/json;charset=UTF-8 |
| 444 | |
| 445 | )]}' |
| 446 | { |
| 447 | "kind": "gerritcodereview#change", |
| 448 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 449 | "project": "myProject", |
| 450 | "branch": "master", |
| 451 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 452 | "subject": "Implementing Feature X", |
| 453 | "status": "NEW", |
| 454 | "created": "2013-02-01 09:59:32.126000000", |
| 455 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 456 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 457 | "insertions": 126, |
| 458 | "deletions": 11, |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 459 | "_sortkey": "0023412400000f7d", |
| 460 | "_number": 3965, |
| 461 | "owner": { |
| 462 | "_account_id": 1000096, |
| 463 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 464 | "email": "john.doe@example.com", |
| 465 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 466 | }, |
| 467 | "labels": { |
| 468 | "Verified": { |
| 469 | "all": [ |
| 470 | { |
| 471 | "value": 0, |
| 472 | "_account_id": 1000096, |
| 473 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 474 | "email": "john.doe@example.com", |
| 475 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 476 | }, |
| 477 | { |
| 478 | "value": 0, |
| 479 | "_account_id": 1000097, |
| 480 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 481 | "email": "jane.roe@example.com", |
| 482 | "username": "jroe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 483 | } |
| 484 | ], |
| 485 | "values": { |
| 486 | "-1": "Fails", |
| 487 | " 0": "No score", |
| 488 | "+1": "Verified" |
| 489 | } |
| 490 | }, |
| 491 | "Code-Review": { |
| 492 | "recommended": { |
| 493 | "_account_id": 1000097, |
| 494 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 495 | "email": "jane.roe@example.com", |
| 496 | "username": "jroe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 497 | }, |
| 498 | "disliked": { |
| 499 | "_account_id": 1000096, |
| 500 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 501 | "email": "john.doe@example.com", |
| 502 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 503 | }, |
| 504 | "all": [ |
| 505 | { |
| 506 | "value": -1, |
| 507 | "_account_id": 1000096, |
| 508 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 509 | "email": "john.doe@example.com", |
| 510 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 511 | }, |
| 512 | { |
| 513 | "value": 1, |
| 514 | "_account_id": 1000097, |
| 515 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 516 | "email": "jane.roe@example.com", |
| 517 | "username": "jroe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 518 | } |
| 519 | ] |
| 520 | "values": { |
Paul Fertser | 2474e52 | 2014-01-23 10:00:59 +0400 | [diff] [blame^] | 521 | "-2": "This shall not be merged", |
| 522 | "-1": "I would prefer this is not merged as is", |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 523 | " 0": "No score", |
| 524 | "+1": "Looks good to me, but someone else must approve", |
| 525 | "+2": "Looks good to me, approved" |
| 526 | } |
| 527 | } |
| 528 | }, |
| 529 | "permitted_labels": { |
| 530 | "Verified": [ |
| 531 | "-1", |
| 532 | " 0", |
| 533 | "+1" |
| 534 | ], |
| 535 | "Code-Review": [ |
| 536 | "-2", |
| 537 | "-1", |
| 538 | " 0", |
| 539 | "+1", |
| 540 | "+2" |
| 541 | ] |
| 542 | }, |
| 543 | "removable_reviewers": [ |
| 544 | { |
| 545 | "_account_id": 1000096, |
| 546 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 547 | "email": "john.doe@example.com", |
| 548 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 549 | }, |
| 550 | { |
| 551 | "_account_id": 1000097, |
| 552 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 553 | "email": "jane.roe@example.com", |
| 554 | "username": "jroe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 555 | } |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 556 | ], |
| 557 | "messages": [ |
| 558 | { |
| 559 | "id": "YH-egE", |
| 560 | "author": { |
| 561 | "_account_id": 1000096, |
| 562 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 563 | "email": "john.doe@example.com", |
| 564 | "username": "jdoe" |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 565 | }, |
| 566 | "updated": "2013-03-23 21:34:02.419000000", |
| 567 | "message": "Patch Set 1:\n\nThis is the first message.", |
| 568 | "revision_number": 1 |
| 569 | }, |
| 570 | { |
| 571 | "id": "WEEdhU", |
| 572 | "author": { |
| 573 | "_account_id": 1000097, |
| 574 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 575 | "email": "jane.roe@example.com", |
| 576 | "username": "jroe" |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 577 | }, |
| 578 | "updated": "2013-03-23 21:36:52.332000000", |
| 579 | "message": "Patch Set 1:\n\nThis is the second message.\n\nWith a line break.", |
| 580 | "revision_number": 1 |
| 581 | } |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 582 | ] |
| 583 | } |
| 584 | ---- |
| 585 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 586 | [[get-topic]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 587 | === Get Topic |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 588 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 589 | 'GET /changes/link:#change-id[\{change-id\}]/topic' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 590 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 591 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 592 | Retrieves the topic of a change. |
| 593 | |
| 594 | .Request |
| 595 | ---- |
| 596 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
| 597 | ---- |
| 598 | |
| 599 | .Response |
| 600 | ---- |
| 601 | HTTP/1.1 200 OK |
| 602 | Content-Disposition: attachment |
| 603 | Content-Type: application/json;charset=UTF-8 |
| 604 | |
| 605 | )]}' |
| 606 | "Documentation" |
| 607 | ---- |
| 608 | |
| 609 | If the change does not have a topic an empty string is returned. |
| 610 | |
| 611 | [[set-topic]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 612 | === Set Topic |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 613 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 614 | 'PUT /changes/link:#change-id[\{change-id\}]/topic' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 615 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 616 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 617 | Sets the topic of a change. |
| 618 | |
| 619 | The new topic must be provided in the request body inside a |
| 620 | link:#topic-input[TopicInput] entity. |
| 621 | |
| 622 | .Request |
| 623 | ---- |
| 624 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
| 625 | Content-Type: application/json;charset=UTF-8 |
| 626 | |
| 627 | { |
| 628 | "topic": "Documentation" |
| 629 | } |
| 630 | ---- |
| 631 | |
| 632 | As response the new topic is returned. |
| 633 | |
| 634 | .Response |
| 635 | ---- |
| 636 | HTTP/1.1 200 OK |
| 637 | Content-Disposition: attachment |
| 638 | Content-Type: application/json;charset=UTF-8 |
| 639 | |
| 640 | )]}' |
| 641 | "Documentation" |
| 642 | ---- |
| 643 | |
| 644 | If the topic was deleted the response is "`204 No Content`". |
| 645 | |
| 646 | [[delete-topic]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 647 | === Delete Topic |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 648 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 649 | 'DELETE /changes/link:#change-id[\{change-id\}]/topic' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 650 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 651 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 652 | Deletes the topic of a change. |
| 653 | |
| 654 | The request body does not need to include a link:#topic-input[ |
| 655 | TopicInput] entity if no review comment is added. |
| 656 | |
| 657 | Please note that some proxies prohibit request bodies for DELETE |
| 658 | requests. In this case, if you want to specify a commit message, use |
| 659 | link:#set-topic[PUT] to delete the topic. |
| 660 | |
| 661 | .Request |
| 662 | ---- |
| 663 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
| 664 | ---- |
| 665 | |
| 666 | .Response |
| 667 | ---- |
| 668 | HTTP/1.1 204 No Content |
| 669 | ---- |
| 670 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 671 | [[abandon-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 672 | === Abandon Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 673 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 674 | 'POST /changes/link:#change-id[\{change-id\}]/abandon' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 675 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 676 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 677 | Abandons a change. |
| 678 | |
| 679 | The request body does not need to include a link:#abandon-input[ |
| 680 | AbandonInput] entity if no review comment is added. |
| 681 | |
| 682 | .Request |
| 683 | ---- |
| 684 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/abandon HTTP/1.0 |
| 685 | ---- |
| 686 | |
| 687 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 688 | describes the abandoned change. |
| 689 | |
| 690 | .Response |
| 691 | ---- |
| 692 | HTTP/1.1 200 OK |
| 693 | Content-Disposition: attachment |
| 694 | Content-Type: application/json;charset=UTF-8 |
| 695 | |
| 696 | )]}' |
| 697 | { |
| 698 | "kind": "gerritcodereview#change", |
| 699 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 700 | "project": "myProject", |
| 701 | "branch": "master", |
| 702 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 703 | "subject": "Implementing Feature X", |
| 704 | "status": "ABANDONED", |
| 705 | "created": "2013-02-01 09:59:32.126000000", |
| 706 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 707 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 708 | "insertions": 3, |
| 709 | "deletions": 310, |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 710 | "_sortkey": "0023412400000f7d", |
| 711 | "_number": 3965, |
| 712 | "owner": { |
| 713 | "name": "John Doe" |
| 714 | } |
| 715 | } |
| 716 | ---- |
| 717 | |
| 718 | If the change cannot be abandoned because the change state doesn't |
| 719 | allow abandoning of the change, the response is "`409 Conflict`" and |
| 720 | the error message is contained in the response body. |
| 721 | |
| 722 | .Response |
| 723 | ---- |
| 724 | HTTP/1.1 409 Conflict |
| 725 | Content-Disposition: attachment |
| 726 | Content-Type: text/plain;charset=UTF-8 |
| 727 | |
| 728 | change is merged |
| 729 | ---- |
| 730 | |
| 731 | [[restore-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 732 | === Restore Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 733 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 734 | 'POST /changes/link:#change-id[\{change-id\}]/restore' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 735 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 736 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 737 | Restores a change. |
| 738 | |
| 739 | The request body does not need to include a link:#restore-input[ |
| 740 | RestoreInput] entity if no review comment is added. |
| 741 | |
| 742 | .Request |
| 743 | ---- |
| 744 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/restore HTTP/1.0 |
| 745 | ---- |
| 746 | |
| 747 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 748 | describes the restored change. |
| 749 | |
| 750 | .Response |
| 751 | ---- |
| 752 | HTTP/1.1 200 OK |
| 753 | Content-Disposition: attachment |
| 754 | Content-Type: application/json;charset=UTF-8 |
| 755 | |
| 756 | )]}' |
| 757 | { |
| 758 | "kind": "gerritcodereview#change", |
| 759 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 760 | "project": "myProject", |
| 761 | "branch": "master", |
| 762 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 763 | "subject": "Implementing Feature X", |
| 764 | "status": "NEW", |
| 765 | "created": "2013-02-01 09:59:32.126000000", |
| 766 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 767 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 768 | "insertions": 2, |
| 769 | "deletions": 13, |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 770 | "_sortkey": "0023412400000f7d", |
| 771 | "_number": 3965, |
| 772 | "owner": { |
| 773 | "name": "John Doe" |
| 774 | } |
| 775 | } |
| 776 | ---- |
| 777 | |
| 778 | If the change cannot be restored because the change state doesn't |
| 779 | allow restoring the change, the response is "`409 Conflict`" and |
| 780 | the error message is contained in the response body. |
| 781 | |
| 782 | .Response |
| 783 | ---- |
| 784 | HTTP/1.1 409 Conflict |
| 785 | Content-Disposition: attachment |
| 786 | Content-Type: text/plain;charset=UTF-8 |
| 787 | |
| 788 | change is new |
| 789 | ---- |
| 790 | |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 791 | [[rebase-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 792 | === Rebase Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 793 | -- |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 794 | 'POST /changes/link:#change-id[\{change-id\}]/rebase' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 795 | -- |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 796 | |
| 797 | Rebases a change. |
| 798 | |
| 799 | .Request |
| 800 | ---- |
| 801 | POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/rebase HTTP/1.0 |
| 802 | ---- |
| 803 | |
| 804 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 805 | describes the rebased change. Information about the current patch set |
| 806 | is included. |
| 807 | |
| 808 | .Response |
| 809 | ---- |
| 810 | HTTP/1.1 200 OK |
| 811 | Content-Disposition: attachment |
| 812 | Content-Type: application/json;charset=UTF-8 |
| 813 | |
| 814 | )]}' |
| 815 | { |
| 816 | "kind": "gerritcodereview#change", |
| 817 | "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 818 | "project": "myProject", |
| 819 | "branch": "master", |
| 820 | "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 821 | "subject": "Implement Feature X", |
| 822 | "status": "NEW", |
| 823 | "created": "2013-02-01 09:59:32.126000000", |
| 824 | "updated": "2013-02-21 11:16:36.775000000", |
| 825 | "mergeable": false, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 826 | "insertions": 33, |
| 827 | "deletions": 9, |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 828 | "_sortkey": "0024cf9a000012bf", |
| 829 | "_number": 4799, |
| 830 | "owner": { |
| 831 | "name": "John Doe" |
| 832 | }, |
| 833 | "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822", |
| 834 | "revisions": { |
| 835 | "27cc4558b5a3d3387dd11ee2df7a117e7e581822": { |
| 836 | "_number": 2, |
| 837 | "fetch": { |
| 838 | "http": { |
| 839 | "url": "http://gerrit:8080/myProject", |
| 840 | "ref": "refs/changes/99/4799/2" |
| 841 | } |
| 842 | }, |
| 843 | "commit": { |
| 844 | "parents": [ |
| 845 | { |
| 846 | "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70", |
| 847 | "subject": "Implement Feature A" |
| 848 | } |
| 849 | ], |
| 850 | "author": { |
| 851 | "name": "John Doe", |
| 852 | "email": "john.doe@example.com", |
| 853 | "date": "2013-05-07 15:21:27.000000000", |
| 854 | "tz": 120 |
| 855 | }, |
| 856 | "committer": { |
| 857 | "name": "Gerrit Code Review", |
| 858 | "email": "gerrit-server@example.com", |
| 859 | "date": "2013-05-07 15:35:43.000000000", |
| 860 | "tz": 120 |
| 861 | }, |
| 862 | "subject": "Implement Feature X", |
| 863 | "message": "Implement Feature X\n\nAdded feature X." |
| 864 | } |
| 865 | } |
| 866 | } |
| 867 | ---- |
| 868 | |
| 869 | If the change cannot be rebased, e.g. due to conflicts, the response is |
| 870 | "`409 Conflict`" and the error message is contained in the response |
| 871 | body. |
| 872 | |
| 873 | .Response |
| 874 | ---- |
| 875 | HTTP/1.1 409 Conflict |
| 876 | Content-Disposition: attachment |
| 877 | Content-Type: text/plain;charset=UTF-8 |
| 878 | |
| 879 | The change could not be rebased due to a path conflict during merge. |
| 880 | ---- |
| 881 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 882 | [[revert-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 883 | === Revert Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 884 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 885 | 'POST /changes/link:#change-id[\{change-id\}]/revert' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 886 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 887 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 888 | Reverts a change. |
| 889 | |
| 890 | The request body does not need to include a link:#revert-input[ |
| 891 | RevertInput] entity if no review comment is added. |
| 892 | |
| 893 | .Request |
| 894 | ---- |
| 895 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revert HTTP/1.0 |
| 896 | ---- |
| 897 | |
| 898 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 899 | describes the reverting change. |
| 900 | |
| 901 | .Response |
| 902 | ---- |
| 903 | HTTP/1.1 200 OK |
| 904 | Content-Disposition: attachment |
| 905 | Content-Type: application/json;charset=UTF-8 |
| 906 | |
| 907 | )]}' |
| 908 | { |
| 909 | "kind": "gerritcodereview#change", |
| 910 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 911 | "project": "myProject", |
| 912 | "branch": "master", |
| 913 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 914 | "subject": "Revert \"Implementing Feature X\"", |
| 915 | "status": "NEW", |
| 916 | "created": "2013-02-01 09:59:32.126000000", |
| 917 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 918 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 919 | "insertions": 6, |
| 920 | "deletions": 4, |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 921 | "_sortkey": "0023412400000f7d", |
| 922 | "_number": 3965, |
| 923 | "owner": { |
| 924 | "name": "John Doe" |
| 925 | } |
| 926 | } |
| 927 | ---- |
| 928 | |
| 929 | If the change cannot be reverted because the change state doesn't |
| 930 | allow reverting the change, the response is "`409 Conflict`" and |
| 931 | the error message is contained in the response body. |
| 932 | |
| 933 | .Response |
| 934 | ---- |
| 935 | HTTP/1.1 409 Conflict |
| 936 | Content-Disposition: attachment |
| 937 | Content-Type: text/plain;charset=UTF-8 |
| 938 | |
| 939 | change is new |
| 940 | ---- |
| 941 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 942 | [[submit-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 943 | === Submit Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 944 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 945 | 'POST /changes/link:#change-id[\{change-id\}]/submit' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 946 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 947 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 948 | Submits a change. |
| 949 | |
| 950 | The request body only needs to include a link:#submit-input[ |
| 951 | SubmitInput] entity if the request should wait for the merge to |
| 952 | complete. |
| 953 | |
| 954 | .Request |
| 955 | ---- |
| 956 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submit HTTP/1.0 |
| 957 | Content-Type: application/json;charset=UTF-8 |
| 958 | |
| 959 | { |
| 960 | "wait_for_merge": true |
| 961 | } |
| 962 | ---- |
| 963 | |
| 964 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 965 | describes the submitted/merged change. |
| 966 | |
| 967 | .Response |
| 968 | ---- |
| 969 | HTTP/1.1 200 OK |
| 970 | Content-Disposition: attachment |
| 971 | Content-Type: application/json;charset=UTF-8 |
| 972 | |
| 973 | )]}' |
| 974 | { |
| 975 | "kind": "gerritcodereview#change", |
| 976 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 977 | "project": "myProject", |
| 978 | "branch": "master", |
| 979 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 980 | "subject": "Implementing Feature X", |
| 981 | "status": "MERGED", |
| 982 | "created": "2013-02-01 09:59:32.126000000", |
| 983 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 984 | "_sortkey": "0023412400000f7d", |
| 985 | "_number": 3965, |
| 986 | "owner": { |
| 987 | "name": "John Doe" |
| 988 | } |
| 989 | } |
| 990 | ---- |
| 991 | |
| 992 | If the change cannot be submitted because the submit rule doesn't allow |
| 993 | submitting the change, the response is "`409 Conflict`" and the error |
| 994 | message is contained in the response body. |
| 995 | |
| 996 | .Response |
| 997 | ---- |
| 998 | HTTP/1.1 409 Conflict |
| 999 | Content-Disposition: attachment |
| 1000 | Content-Type: text/plain;charset=UTF-8 |
| 1001 | |
| 1002 | blocked by Verified |
| 1003 | ---- |
| 1004 | |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 1005 | [[publish-draft-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1006 | === Publish Draft Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1007 | -- |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 1008 | 'POST /changes/link:#change-id[\{change-id\}]/publish' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1009 | -- |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 1010 | |
| 1011 | Publishes a draft change. |
| 1012 | |
| 1013 | .Request |
| 1014 | ---- |
| 1015 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/publish HTTP/1.0 |
| 1016 | Content-Type: application/json;charset=UTF-8 |
| 1017 | ---- |
| 1018 | |
| 1019 | .Response |
| 1020 | ---- |
| 1021 | HTTP/1.1 204 No Content |
| 1022 | ---- |
| 1023 | |
| 1024 | [[delete-draft-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1025 | === Delete Draft Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1026 | -- |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 1027 | 'DELETE /changes/link:#change-id[\{change-id\}]' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1028 | -- |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 1029 | |
| 1030 | Deletes a draft change. |
| 1031 | |
| 1032 | .Request |
| 1033 | ---- |
| 1034 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0 |
| 1035 | Content-Type: application/json;charset=UTF-8 |
| 1036 | ---- |
| 1037 | |
| 1038 | .Response |
| 1039 | ---- |
| 1040 | HTTP/1.1 204 No Content |
| 1041 | ---- |
| 1042 | |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 1043 | [[get-included-in]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1044 | === Get Included In |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1045 | -- |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 1046 | 'GET /changes/link:#change-id[\{change-id\}]/in' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1047 | -- |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 1048 | |
| 1049 | Retrieves the branches and tags in which a change is included. As result |
| 1050 | an link:#included-in-info[IncludedInInfo] entity is returned. |
| 1051 | |
| 1052 | .Request |
| 1053 | ---- |
| 1054 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/in HTTP/1.0 |
| 1055 | ---- |
| 1056 | |
| 1057 | .Response |
| 1058 | ---- |
| 1059 | HTTP/1.1 200 OK |
| 1060 | Content-Disposition: attachment |
| 1061 | Content-Type: application/json;charset=UTF-8 |
| 1062 | |
| 1063 | )]}' |
| 1064 | { |
| 1065 | "kind": "gerritcodereview#includedininfo", |
| 1066 | "branches": [ |
| 1067 | "master" |
| 1068 | ], |
| 1069 | "tags": [] |
| 1070 | } |
| 1071 | ---- |
| 1072 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 1073 | [[reviewer-endpoints]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1074 | == Reviewer Endpoints |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 1075 | |
| 1076 | [[list-reviewers]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1077 | === List Reviewers |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1078 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1079 | 'GET /changes/link:#change-id[\{change-id\}]/reviewers/' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1080 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1081 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 1082 | Lists the reviewers of a change. |
| 1083 | |
| 1084 | As result a list of link:#reviewer-info[ReviewerInfo] entries is returned. |
| 1085 | |
| 1086 | .Request |
| 1087 | ---- |
| 1088 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/ HTTP/1.0 |
| 1089 | ---- |
| 1090 | |
| 1091 | .Response |
| 1092 | ---- |
| 1093 | HTTP/1.1 200 OK |
| 1094 | Content-Disposition: attachment |
| 1095 | Content-Type: application/json;charset=UTF-8 |
| 1096 | |
| 1097 | )]}' |
| 1098 | [ |
| 1099 | { |
| 1100 | "kind": "gerritcodereview#reviewer", |
| 1101 | "approvals": { |
| 1102 | "Verified": "+1", |
| 1103 | "Code-Review": "+2" |
| 1104 | }, |
| 1105 | "_account_id": 1000096, |
| 1106 | "name": "John Doe", |
| 1107 | "email": "john.doe@example.com" |
| 1108 | }, |
| 1109 | { |
| 1110 | "kind": "gerritcodereview#reviewer", |
| 1111 | "approvals": { |
| 1112 | "Verified": " 0", |
| 1113 | "Code-Review": "-1" |
| 1114 | }, |
| 1115 | "_account_id": 1000097, |
| 1116 | "name": "Jane Roe", |
| 1117 | "email": "jane.roe@example.com" |
| 1118 | } |
| 1119 | ] |
| 1120 | ---- |
| 1121 | |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 1122 | [[suggest-reviewers]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1123 | === Suggest Reviewers |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1124 | -- |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 1125 | 'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1126 | -- |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 1127 | |
| 1128 | Suggest the reviewers for a given query `q` and result limit `n`. If result |
| 1129 | limit is not passed, then the default 10 is used. |
| 1130 | |
| 1131 | As result a list of link:#suggested-reviewer-info[SuggestedReviewerInfo] entries is returned. |
| 1132 | |
| 1133 | .Request |
| 1134 | ---- |
| 1135 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/suggest_reviewers?q=J HTTP/1.0 |
| 1136 | ---- |
| 1137 | |
| 1138 | .Response |
| 1139 | ---- |
| 1140 | HTTP/1.1 200 OK |
| 1141 | Content-Disposition: attachment |
| 1142 | Content-Type: application/json;charset=UTF-8 |
| 1143 | |
| 1144 | )]}' |
| 1145 | [ |
| 1146 | { |
| 1147 | "kind": "gerritcodereview#suggestedreviewer", |
| 1148 | "account": { |
| 1149 | "_account_id": 1000097, |
| 1150 | "name": "Jane Roe", |
| 1151 | "email": "jane.roe@example.com" |
| 1152 | } |
| 1153 | }, |
| 1154 | { |
| 1155 | "kind": "gerritcodereview#suggestedreviewer", |
| 1156 | "group": { |
| 1157 | "id": "4fd581c0657268f2bdcc26699fbf9ddb76e3a279", |
| 1158 | "name": "Joiner" |
| 1159 | } |
| 1160 | } |
| 1161 | ] |
| 1162 | ---- |
| 1163 | |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 1164 | [[get-reviewer]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1165 | === Get Reviewer |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1166 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1167 | 'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1168 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1169 | |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 1170 | Retrieves a reviewer of a change. |
| 1171 | |
| 1172 | As response a link:#reviewer-info[ReviewerInfo] entity is returned that |
| 1173 | describes the reviewer. |
| 1174 | |
| 1175 | .Request |
| 1176 | ---- |
| 1177 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/john.doe@example.com HTTP/1.0 |
| 1178 | ---- |
| 1179 | |
| 1180 | .Response |
| 1181 | ---- |
| 1182 | HTTP/1.1 200 OK |
| 1183 | Content-Disposition: attachment |
| 1184 | Content-Type: application/json;charset=UTF-8 |
| 1185 | |
| 1186 | )]}' |
| 1187 | { |
| 1188 | "kind": "gerritcodereview#reviewer", |
| 1189 | "approvals": { |
| 1190 | "Verified": "+1", |
| 1191 | "Code-Review": "+2" |
| 1192 | }, |
| 1193 | "_account_id": 1000096, |
| 1194 | "name": "John Doe", |
| 1195 | "email": "john.doe@example.com" |
| 1196 | } |
| 1197 | ---- |
| 1198 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 1199 | [[add-reviewer]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1200 | === Add Reviewer |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1201 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1202 | 'POST /changes/link:#change-id[\{change-id\}]/reviewers' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1203 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1204 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 1205 | Adds one user or all members of one group as reviewer to the change. |
| 1206 | |
| 1207 | The reviewer to be added to the change must be provided in the request |
| 1208 | body as a link:#reviewer-input[ReviewerInput] entity. |
| 1209 | |
| 1210 | .Request |
| 1211 | ---- |
| 1212 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
| 1213 | Content-Type: application/json;charset=UTF-8 |
| 1214 | |
| 1215 | { |
| 1216 | "reviewer": "john.doe@example.com" |
| 1217 | } |
| 1218 | ---- |
| 1219 | |
| 1220 | As response an link:#add-reviewer-result[AddReviewerResult] entity is |
| 1221 | returned that describes the newly added reviewers. |
| 1222 | |
| 1223 | .Response |
| 1224 | ---- |
| 1225 | HTTP/1.1 200 OK |
| 1226 | Content-Disposition: attachment |
| 1227 | Content-Type: application/json;charset=UTF-8 |
| 1228 | |
| 1229 | )]}' |
| 1230 | { |
| 1231 | "reviewers": [ |
| 1232 | { |
| 1233 | "kind": "gerritcodereview#reviewer", |
| 1234 | "approvals": { |
| 1235 | "Verified": " 0", |
| 1236 | "Code-Review": " 0" |
| 1237 | }, |
| 1238 | "_account_id": 1000096, |
| 1239 | "name": "John Doe", |
| 1240 | "email": "john.doe@example.com" |
| 1241 | } |
| 1242 | ] |
| 1243 | } |
| 1244 | ---- |
| 1245 | |
| 1246 | If a group is specified, adding the group members as reviewers is an |
| 1247 | atomic operation. This means if an error is returned, none of the |
| 1248 | members are added as reviewer. |
| 1249 | |
| 1250 | If a group with many members is added as reviewer a confirmation may be |
| 1251 | required. |
| 1252 | |
| 1253 | .Request |
| 1254 | ---- |
| 1255 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
| 1256 | Content-Type: application/json;charset=UTF-8 |
| 1257 | |
| 1258 | { |
| 1259 | "reviewer": "MyProjectVerifiers" |
| 1260 | } |
| 1261 | ---- |
| 1262 | |
| 1263 | .Response |
| 1264 | ---- |
| 1265 | HTTP/1.1 200 OK |
| 1266 | Content-Disposition: attachment |
| 1267 | Content-Type: application/json;charset=UTF-8 |
| 1268 | |
| 1269 | )]}' |
| 1270 | { |
| 1271 | "error": "The group My Group has 15 members. Do you want to add them all as reviewers?", |
| 1272 | "confirm": true |
| 1273 | } |
| 1274 | ---- |
| 1275 | |
| 1276 | To confirm the addition of the reviewers, resend the request with the |
Edwin Kempin | 08da43d | 2013-02-26 11:06:58 +0100 | [diff] [blame] | 1277 | `confirmed` flag being set. |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 1278 | |
| 1279 | .Request |
| 1280 | ---- |
| 1281 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
| 1282 | Content-Type: application/json;charset=UTF-8 |
| 1283 | |
| 1284 | { |
| 1285 | "reviewer": "MyProjectVerifiers", |
Edwin Kempin | 08da43d | 2013-02-26 11:06:58 +0100 | [diff] [blame] | 1286 | "confirmed": true |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 1287 | } |
| 1288 | ---- |
| 1289 | |
Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame] | 1290 | [[delete-reviewer]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1291 | === Delete Reviewer |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1292 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1293 | 'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1294 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1295 | |
Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame] | 1296 | Deletes a reviewer from a change. |
| 1297 | |
| 1298 | .Request |
| 1299 | ---- |
| 1300 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe HTTP/1.0 |
| 1301 | ---- |
| 1302 | |
| 1303 | .Response |
| 1304 | ---- |
| 1305 | HTTP/1.1 204 No Content |
| 1306 | ---- |
| 1307 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 1308 | [[revision-endpoints]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1309 | == Revision Endpoints |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 1310 | |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 1311 | [[get-commit]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1312 | === Get Commit |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1313 | -- |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 1314 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/commit' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1315 | -- |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 1316 | |
| 1317 | Retrieves a parsed commit of a revision. |
| 1318 | |
| 1319 | .Request |
| 1320 | ---- |
| 1321 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/commit HTTP/1.0 |
| 1322 | ---- |
| 1323 | |
| 1324 | As response a link:#commit-info[CommitInfo] entity is returned that |
| 1325 | describes the revision. |
| 1326 | |
| 1327 | .Response |
| 1328 | ---- |
| 1329 | HTTP/1.1 200 OK |
| 1330 | Content-Disposition: attachment |
| 1331 | Content-Type: application/json;charset=UTF-8 |
| 1332 | |
| 1333 | )]}' |
| 1334 | { |
| 1335 | "kind": "gerritcodereview#commit", |
| 1336 | "parents": [ |
| 1337 | { |
| 1338 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 1339 | "subject": "Migrate contributor agreements to All-Projects." |
| 1340 | } |
| 1341 | ], |
| 1342 | "author": { |
| 1343 | "name": "Shawn O. Pearce", |
| 1344 | "email": "sop@google.com", |
| 1345 | "date": "2012-04-24 18:08:08.000000000", |
| 1346 | "tz": -420 |
| 1347 | }, |
| 1348 | "committer": { |
| 1349 | "name": "Shawn O. Pearce", |
| 1350 | "email": "sop@google.com", |
| 1351 | "date": "2012-04-24 18:08:08.000000000", |
| 1352 | "tz": -420 |
| 1353 | }, |
| 1354 | "subject": "Use an EventBus to manage star icons", |
| 1355 | "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..." |
| 1356 | } |
| 1357 | ---- |
| 1358 | |
| 1359 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 1360 | [[get-review]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1361 | === Get Review |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1362 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1363 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1364 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1365 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 1366 | Retrieves a review of a revision. |
| 1367 | |
| 1368 | .Request |
| 1369 | ---- |
| 1370 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0 |
| 1371 | ---- |
| 1372 | |
| 1373 | As response a link:#change-info[ChangeInfo] entity with |
| 1374 | link:#detailed-labels[detailed labels] and link:#detailed-accounts[ |
| 1375 | detailed accounts] is returned that describes the review of the |
| 1376 | revision. The revision for which the review is retrieved is contained |
| 1377 | in the `revisions` field. In addition the `current_revision` field is |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 1378 | set if the revision for which the review is retrieved is the current |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 1379 | revision of the change. Please note that the returned labels are always |
| 1380 | for the current patch set. |
| 1381 | |
| 1382 | .Response |
| 1383 | ---- |
| 1384 | HTTP/1.1 200 OK |
| 1385 | Content-Disposition: attachment |
| 1386 | Content-Type: application/json;charset=UTF-8 |
| 1387 | |
| 1388 | )]}' |
| 1389 | { |
| 1390 | "kind": "gerritcodereview#change", |
| 1391 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1392 | "project": "myProject", |
| 1393 | "branch": "master", |
| 1394 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1395 | "subject": "Implementing Feature X", |
| 1396 | "status": "NEW", |
| 1397 | "created": "2013-02-01 09:59:32.126000000", |
| 1398 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 1399 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 1400 | "insertions": 34, |
| 1401 | "deletions": 45, |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 1402 | "_sortkey": "0023412400000f7d", |
| 1403 | "_number": 3965, |
| 1404 | "owner": { |
| 1405 | "_account_id": 1000096, |
| 1406 | "name": "John Doe", |
| 1407 | "email": "john.doe@example.com" |
| 1408 | }, |
| 1409 | "labels": { |
| 1410 | "Verified": { |
| 1411 | "all": [ |
| 1412 | { |
| 1413 | "value": 0, |
| 1414 | "_account_id": 1000096, |
| 1415 | "name": "John Doe", |
| 1416 | "email": "john.doe@example.com" |
| 1417 | }, |
| 1418 | { |
| 1419 | "value": 0, |
| 1420 | "_account_id": 1000097, |
| 1421 | "name": "Jane Roe", |
| 1422 | "email": "jane.roe@example.com" |
| 1423 | } |
| 1424 | ], |
| 1425 | "values": { |
| 1426 | "-1": "Fails", |
| 1427 | " 0": "No score", |
| 1428 | "+1": "Verified" |
| 1429 | } |
| 1430 | }, |
| 1431 | "Code-Review": { |
| 1432 | "all": [ |
| 1433 | { |
| 1434 | "value": -1, |
| 1435 | "_account_id": 1000096, |
| 1436 | "name": "John Doe", |
| 1437 | "email": "john.doe@example.com" |
| 1438 | }, |
| 1439 | { |
| 1440 | "value": 1, |
| 1441 | "_account_id": 1000097, |
| 1442 | "name": "Jane Roe", |
| 1443 | "email": "jane.roe@example.com" |
| 1444 | } |
| 1445 | ] |
| 1446 | "values": { |
Paul Fertser | 2474e52 | 2014-01-23 10:00:59 +0400 | [diff] [blame^] | 1447 | "-2": "This shall not be merged", |
| 1448 | "-1": "I would prefer this is not merged as is", |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 1449 | " 0": "No score", |
| 1450 | "+1": "Looks good to me, but someone else must approve", |
| 1451 | "+2": "Looks good to me, approved" |
| 1452 | } |
| 1453 | } |
| 1454 | }, |
| 1455 | "permitted_labels": { |
| 1456 | "Verified": [ |
| 1457 | "-1", |
| 1458 | " 0", |
| 1459 | "+1" |
| 1460 | ], |
| 1461 | "Code-Review": [ |
| 1462 | "-2", |
| 1463 | "-1", |
| 1464 | " 0", |
| 1465 | "+1", |
| 1466 | "+2" |
| 1467 | ] |
| 1468 | }, |
| 1469 | "removable_reviewers": [ |
| 1470 | { |
| 1471 | "_account_id": 1000096, |
| 1472 | "name": "John Doe", |
| 1473 | "email": "john.doe@example.com" |
| 1474 | }, |
| 1475 | { |
| 1476 | "_account_id": 1000097, |
| 1477 | "name": "Jane Roe", |
| 1478 | "email": "jane.roe@example.com" |
| 1479 | } |
| 1480 | ], |
| 1481 | "current_revision": "674ac754f91e64a0efb8087e59a176484bd534d1", |
| 1482 | "revisions": { |
| 1483 | "674ac754f91e64a0efb8087e59a176484bd534d1": { |
| 1484 | "_number": 2, |
| 1485 | "fetch": { |
| 1486 | "http": { |
| 1487 | "url": "http://gerrit/myProject", |
| 1488 | "ref": "refs/changes/65/3965/2" |
| 1489 | } |
| 1490 | } |
| 1491 | } |
| 1492 | } |
| 1493 | ---- |
| 1494 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 1495 | [[set-review]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1496 | === Set Review |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1497 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1498 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1499 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1500 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 1501 | Sets a review on a revision. |
| 1502 | |
| 1503 | The review must be provided in the request body as a |
| 1504 | link:#review-input[ReviewInput] entity. |
| 1505 | |
| 1506 | .Request |
| 1507 | ---- |
| 1508 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0 |
| 1509 | Content-Type: application/json;charset=UTF-8 |
| 1510 | |
| 1511 | { |
| 1512 | "message": "Some nits need to be fixed.", |
| 1513 | "labels": { |
| 1514 | "Code-Review": -1 |
| 1515 | }, |
| 1516 | "comments": { |
| 1517 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 1518 | { |
| 1519 | "line": 23, |
| 1520 | "message": "[nit] trailing whitespace" |
| 1521 | }, |
| 1522 | { |
| 1523 | "line": 49, |
| 1524 | "message": "[nit] s/conrtol/control" |
| 1525 | } |
| 1526 | ] |
| 1527 | } |
| 1528 | } |
| 1529 | ---- |
| 1530 | |
| 1531 | As response a link:#review-info[ReviewInfo] entity is returned that |
| 1532 | describes the applied labels. |
| 1533 | |
| 1534 | .Response |
| 1535 | ---- |
| 1536 | HTTP/1.1 200 OK |
| 1537 | Content-Disposition: attachment |
| 1538 | Content-Type: application/json;charset=UTF-8 |
| 1539 | |
| 1540 | )]}' |
| 1541 | { |
| 1542 | "labels": { |
| 1543 | "Code-Review": -1 |
| 1544 | } |
| 1545 | } |
| 1546 | ---- |
| 1547 | |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1548 | [[rebase-revision]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1549 | === Rebase Revision |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1550 | -- |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1551 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/rebase' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1552 | -- |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1553 | |
| 1554 | Rebases a revision. |
| 1555 | |
| 1556 | .Request |
| 1557 | ---- |
| 1558 | POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/rebase HTTP/1.0 |
| 1559 | ---- |
| 1560 | |
| 1561 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1562 | describes the rebased change. Information about the current patch set |
| 1563 | is included. |
| 1564 | |
| 1565 | .Response |
| 1566 | ---- |
| 1567 | HTTP/1.1 200 OK |
| 1568 | Content-Disposition: attachment |
| 1569 | Content-Type: application/json;charset=UTF-8 |
| 1570 | |
| 1571 | )]}' |
| 1572 | { |
| 1573 | "kind": "gerritcodereview#change", |
| 1574 | "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 1575 | "project": "myProject", |
| 1576 | "branch": "master", |
| 1577 | "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 1578 | "subject": "Implement Feature X", |
| 1579 | "status": "NEW", |
| 1580 | "created": "2013-02-01 09:59:32.126000000", |
| 1581 | "updated": "2013-02-21 11:16:36.775000000", |
| 1582 | "mergeable": false, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 1583 | "insertions": 21, |
| 1584 | "deletions": 21, |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1585 | "_sortkey": "0024cf9a000012bf", |
| 1586 | "_number": 4799, |
| 1587 | "owner": { |
| 1588 | "name": "John Doe" |
| 1589 | }, |
| 1590 | "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822", |
| 1591 | "revisions": { |
| 1592 | "27cc4558b5a3d3387dd11ee2df7a117e7e581822": { |
| 1593 | "_number": 2, |
| 1594 | "fetch": { |
| 1595 | "http": { |
| 1596 | "url": "http://gerrit:8080/myProject", |
| 1597 | "ref": "refs/changes/99/4799/2" |
| 1598 | } |
| 1599 | }, |
| 1600 | "commit": { |
| 1601 | "parents": [ |
| 1602 | { |
| 1603 | "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70", |
| 1604 | "subject": "Implement Feature A" |
| 1605 | } |
| 1606 | ], |
| 1607 | "author": { |
| 1608 | "name": "John Doe", |
| 1609 | "email": "john.doe@example.com", |
| 1610 | "date": "2013-05-07 15:21:27.000000000", |
| 1611 | "tz": 120 |
| 1612 | }, |
| 1613 | "committer": { |
| 1614 | "name": "Gerrit Code Review", |
| 1615 | "email": "gerrit-server@example.com", |
| 1616 | "date": "2013-05-07 15:35:43.000000000", |
| 1617 | "tz": 120 |
| 1618 | }, |
| 1619 | "subject": "Implement Feature X", |
| 1620 | "message": "Implement Feature X\n\nAdded feature X." |
| 1621 | } |
| 1622 | } |
| 1623 | } |
| 1624 | ---- |
| 1625 | |
| 1626 | If the revision cannot be rebased, e.g. due to conflicts, the response is |
| 1627 | "`409 Conflict`" and the error message is contained in the response |
| 1628 | body. |
| 1629 | |
| 1630 | .Response |
| 1631 | ---- |
| 1632 | HTTP/1.1 409 Conflict |
| 1633 | Content-Disposition: attachment |
| 1634 | Content-Type: text/plain;charset=UTF-8 |
| 1635 | |
| 1636 | The change could not be rebased due to a path conflict during merge. |
| 1637 | ---- |
| 1638 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 1639 | [[submit-revision]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1640 | === Submit Revision |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1641 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1642 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1643 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1644 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 1645 | Submits a revision. |
| 1646 | |
| 1647 | The request body only needs to include a link:#submit-input[ |
| 1648 | SubmitInput] entity if the request should wait for the merge to |
| 1649 | complete. |
| 1650 | |
| 1651 | .Request |
| 1652 | ---- |
| 1653 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/submit HTTP/1.0 |
| 1654 | Content-Type: application/json;charset=UTF-8 |
| 1655 | |
| 1656 | { |
| 1657 | "wait_for_merge": true |
| 1658 | } |
| 1659 | ---- |
| 1660 | |
| 1661 | As response a link:#submit-info[SubmitInfo] entity is returned that |
| 1662 | describes the status of the submitted change. |
| 1663 | |
| 1664 | .Response |
| 1665 | ---- |
| 1666 | HTTP/1.1 200 OK |
| 1667 | Content-Disposition: attachment |
| 1668 | Content-Type: application/json;charset=UTF-8 |
| 1669 | |
| 1670 | )]}' |
| 1671 | { |
| 1672 | "status": "MERGED" |
| 1673 | } |
| 1674 | ---- |
| 1675 | |
| 1676 | If the revision cannot be submitted, e.g. because the submit rule |
| 1677 | doesn't allow submitting the revision or the revision is not the |
| 1678 | current revision, the response is "`409 Conflict`" and the error |
| 1679 | message is contained in the response body. |
| 1680 | |
| 1681 | .Response |
| 1682 | ---- |
| 1683 | HTTP/1.1 409 Conflict |
| 1684 | Content-Type: text/plain;charset=UTF-8 |
| 1685 | |
| 1686 | "revision 674ac754f91e64a0efb8087e59a176484bd534d1 is not current revision" |
| 1687 | ---- |
| 1688 | |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 1689 | [[publish-draft-revision]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1690 | === Publish Draft Revision |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1691 | -- |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 1692 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/publish' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1693 | -- |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 1694 | |
| 1695 | Publishes a draft revision. |
| 1696 | |
| 1697 | .Request |
| 1698 | ---- |
| 1699 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/publish HTTP/1.0 |
| 1700 | Content-Type: application/json;charset=UTF-8 |
| 1701 | ---- |
| 1702 | |
| 1703 | .Response |
| 1704 | ---- |
| 1705 | HTTP/1.1 204 No Content |
| 1706 | ---- |
| 1707 | |
| 1708 | [[delete-draft-revision]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1709 | === Delete Draft Revision |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1710 | -- |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 1711 | 'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1712 | -- |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 1713 | |
| 1714 | Deletes a draft revision. |
| 1715 | |
| 1716 | .Request |
| 1717 | ---- |
| 1718 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1 HTTP/1.0 |
| 1719 | Content-Type: application/json;charset=UTF-8 |
| 1720 | ---- |
| 1721 | |
| 1722 | .Response |
| 1723 | ---- |
| 1724 | HTTP/1.1 204 No Content |
| 1725 | ---- |
| 1726 | |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 1727 | [[get-patch]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1728 | === Get Patch |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1729 | -- |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 1730 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/patch' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1731 | -- |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 1732 | |
| 1733 | Gets the formatted patch for one revision. |
| 1734 | |
| 1735 | .Request |
| 1736 | ---- |
| 1737 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/patch HTTP/1.0 |
| 1738 | ---- |
| 1739 | |
Shawn Pearce | 98361f7 | 2013-05-10 16:27:36 -0700 | [diff] [blame] | 1740 | The formatted patch is returned as text encoded inside base64: |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 1741 | |
| 1742 | .Response |
| 1743 | ---- |
| 1744 | HTTP/1.1 200 OK |
| 1745 | Content-Disposition: attachment |
Shawn Pearce | 98361f7 | 2013-05-10 16:27:36 -0700 | [diff] [blame] | 1746 | Content-Type: text/plain;charset=ISO-8859-1 |
| 1747 | X-FYI-Content-Encoding: base64 |
| 1748 | X-FYI-Content-Type: application/mbox |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 1749 | |
Shawn Pearce | 98361f7 | 2013-05-10 16:27:36 -0700 | [diff] [blame] | 1750 | RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY... |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 1751 | ---- |
| 1752 | |
David Ostrovsky | 973f38b | 2013-08-22 00:24:51 -0700 | [diff] [blame] | 1753 | Adding query parameter `zip` (for example `/changes/.../patch?zip`) |
| 1754 | returns the patch as a single file inside of a ZIP archive. Clients |
| 1755 | can expand the ZIP to obtain the plain text patch, avoiding the |
| 1756 | need for a base64 decoding step. This option implies `download`. |
| 1757 | |
| 1758 | Query parameter `download` (e.g. `/changes/.../patch?download`) |
| 1759 | will suggest the browser save the patch as `commitsha1.diff.base64`, |
| 1760 | for later processing by command line tools. |
| 1761 | |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 1762 | [[get-mergeable]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1763 | === Get Mergeable |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1764 | -- |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 1765 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergeable' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1766 | -- |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 1767 | |
| 1768 | Gets the method the server will use to submit (merge) the change and |
| 1769 | an indicator if the change is currently mergeable. |
| 1770 | |
| 1771 | .Request |
| 1772 | ---- |
| 1773 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable HTTP/1.0 |
| 1774 | ---- |
| 1775 | |
| 1776 | .Response |
| 1777 | ---- |
| 1778 | HTTP/1.1 200 OK |
| 1779 | Content-Disposition: attachment |
| 1780 | Content-Type: application/json;charset=UTF-8 |
| 1781 | |
| 1782 | )]}' |
| 1783 | { |
| 1784 | submit_type: "MERGE_IF_NECESSARY", |
| 1785 | mergeable: true, |
| 1786 | } |
| 1787 | ---- |
| 1788 | |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1789 | [[get-submit-type]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1790 | === Get Submit Type |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1791 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1792 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit_type' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1793 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1794 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 1795 | Gets the method the server will use to submit (merge) the change. |
| 1796 | |
| 1797 | .Request |
| 1798 | ---- |
| 1799 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/submit_type HTTP/1.0 |
| 1800 | ---- |
| 1801 | |
| 1802 | .Response |
| 1803 | ---- |
| 1804 | HTTP/1.1 200 OK |
| 1805 | Content-Disposition: attachment |
| 1806 | Content-Type: application/json;charset=UTF-8 |
| 1807 | |
| 1808 | )]}' |
| 1809 | "MERGE_IF_NECESSARY" |
| 1810 | ---- |
| 1811 | |
| 1812 | [[test-submit-type]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1813 | === Test Submit Type |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1814 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1815 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_type' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1816 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1817 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 1818 | Tests the submit_type Prolog rule in the project, or the one given. |
| 1819 | |
| 1820 | Request body may be either the Prolog code as `text/plain` or a |
| 1821 | link:#rule-input[RuleInput] object. The query parameter `filters` |
| 1822 | may be set to `SKIP` to bypass parent project filters while testing |
| 1823 | a project-specific rule. |
| 1824 | |
| 1825 | .Request |
| 1826 | ---- |
| 1827 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_type HTTP/1.0 |
| 1828 | Content-Type: text/plain;charset-UTF-8 |
| 1829 | |
| 1830 | submit_type(cherry_pick). |
| 1831 | ---- |
| 1832 | |
| 1833 | .Response |
| 1834 | ---- |
| 1835 | HTTP/1.1 200 OK |
| 1836 | Content-Disposition: attachment |
| 1837 | Content-Type: application/json;charset=UTF-8 |
| 1838 | |
| 1839 | )]}' |
Shawn Pearce | 7076f4e | 2013-08-20 22:11:51 -0700 | [diff] [blame] | 1840 | "CHERRY_PICK" |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 1841 | ---- |
| 1842 | |
| 1843 | [[test-submit-rule]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1844 | === Test Submit Rule |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1845 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1846 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_rule' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1847 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1848 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 1849 | Tests the submit_rule Prolog rule in the project, or the one given. |
| 1850 | |
| 1851 | Request body may be either the Prolog code as `text/plain` or a |
| 1852 | link:#rule-input[RuleInput] object. The query parameter `filters` |
| 1853 | may be set to `SKIP` to bypass parent project filters while testing |
| 1854 | a project-specific rule. |
| 1855 | |
| 1856 | .Request |
| 1857 | ---- |
| 1858 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_type?filters=SKIP HTTP/1.0 |
| 1859 | Content-Type: text/plain;charset-UTF-8 |
| 1860 | |
| 1861 | submit_rule(submit(R)) :- |
| 1862 | R = label('Any-Label-Name', reject(_)). |
| 1863 | ---- |
| 1864 | |
| 1865 | The response is a list of link:#submit-record[SubmitRecord] entries |
| 1866 | describing the permutations that satisfy the tested submit rule. |
| 1867 | |
| 1868 | .Response |
| 1869 | ---- |
| 1870 | HTTP/1.1 200 OK |
| 1871 | Content-Disposition: attachment |
| 1872 | Content-Type: application/json;charset=UTF-8 |
| 1873 | |
| 1874 | )]}' |
| 1875 | [ |
| 1876 | { |
| 1877 | "status": "NOT_READY", |
| 1878 | "reject": { |
| 1879 | "Any-Label-Name": {} |
| 1880 | } |
| 1881 | } |
| 1882 | ] |
| 1883 | ---- |
| 1884 | |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 1885 | [[list-drafts]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1886 | === List Drafts |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1887 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1888 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1889 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1890 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 1891 | Lists the draft comments of a revision that belong to the calling |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 1892 | user. |
| 1893 | |
| 1894 | As result a map is returned that maps the file path to a list of |
| 1895 | link:#comment-info[CommentInfo] entries. The entries in the map are |
| 1896 | sorted by file path. |
| 1897 | |
| 1898 | .Request |
| 1899 | ---- |
| 1900 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/ HTTP/1.0 |
| 1901 | ---- |
| 1902 | |
| 1903 | .Response |
| 1904 | ---- |
| 1905 | HTTP/1.1 200 OK |
| 1906 | Content-Disposition: attachment |
| 1907 | Content-Type: application/json;charset=UTF-8 |
| 1908 | |
| 1909 | )]}' |
| 1910 | { |
| 1911 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 1912 | { |
| 1913 | "kind": "gerritcodereview#comment", |
| 1914 | "id": "TvcXrmjM", |
| 1915 | "line": 23, |
| 1916 | "message": "[nit] trailing whitespace", |
| 1917 | "updated": "2013-02-26 15:40:43.986000000" |
| 1918 | }, |
| 1919 | { |
| 1920 | "kind": "gerritcodereview#comment", |
| 1921 | "id": "TveXwFiA", |
| 1922 | "line": 49, |
| 1923 | "in_reply_to": "TfYX-Iuo", |
| 1924 | "message": "Done", |
| 1925 | "updated": "2013-02-26 15:40:45.328000000" |
| 1926 | } |
| 1927 | ] |
| 1928 | } |
| 1929 | ---- |
| 1930 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 1931 | [[create-draft]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1932 | === Create Draft |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1933 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1934 | 'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1935 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1936 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 1937 | Creates a draft comment on a revision. |
| 1938 | |
| 1939 | The new draft comment must be provided in the request body inside a |
| 1940 | link:#comment-input[CommentInput] entity. |
| 1941 | |
| 1942 | .Request |
| 1943 | ---- |
| 1944 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts HTTP/1.0 |
| 1945 | Content-Type: application/json;charset=UTF-8 |
| 1946 | |
| 1947 | { |
| 1948 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 1949 | "line": 23, |
| 1950 | "message": "[nit] trailing whitespace" |
| 1951 | } |
| 1952 | ---- |
| 1953 | |
| 1954 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 1955 | describes the draft comment. |
| 1956 | |
| 1957 | .Response |
| 1958 | ---- |
| 1959 | HTTP/1.1 200 OK |
| 1960 | Content-Disposition: attachment |
| 1961 | Content-Type: application/json;charset=UTF-8 |
| 1962 | |
| 1963 | )]}' |
| 1964 | { |
| 1965 | "kind": "gerritcodereview#comment", |
| 1966 | "id": "TvcXrmjM", |
| 1967 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 1968 | "line": 23, |
| 1969 | "message": "[nit] trailing whitespace", |
| 1970 | "updated": "2013-02-26 15:40:43.986000000" |
| 1971 | } |
| 1972 | ---- |
| 1973 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 1974 | [[get-draft]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1975 | === Get Draft |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1976 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1977 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/link:#draft-id[\{draft-id\}]' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1978 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1979 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 1980 | Retrieves a draft comment of a revision that belongs to the calling |
| 1981 | user. |
| 1982 | |
| 1983 | .Request |
| 1984 | ---- |
| 1985 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
| 1986 | ---- |
| 1987 | |
| 1988 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 1989 | describes the draft comment. |
| 1990 | |
| 1991 | .Response |
| 1992 | ---- |
| 1993 | HTTP/1.1 200 OK |
| 1994 | Content-Disposition: attachment |
| 1995 | Content-Type: application/json;charset=UTF-8 |
| 1996 | |
| 1997 | )]}' |
| 1998 | { |
| 1999 | "kind": "gerritcodereview#comment", |
| 2000 | "id": "TvcXrmjM", |
| 2001 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 2002 | "line": 23, |
| 2003 | "message": "[nit] trailing whitespace", |
| 2004 | "updated": "2013-02-26 15:40:43.986000000" |
| 2005 | } |
| 2006 | ---- |
| 2007 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 2008 | [[update-draft]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2009 | === Update Draft |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2010 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 2011 | 'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/link:#draft-id[\{draft-id\}]' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2012 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 2013 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 2014 | Updates a draft comment on a revision. |
| 2015 | |
| 2016 | The new draft comment must be provided in the request body inside a |
| 2017 | link:#comment-input[CommentInput] entity. |
| 2018 | |
| 2019 | .Request |
| 2020 | ---- |
| 2021 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
| 2022 | Content-Type: application/json;charset=UTF-8 |
| 2023 | |
| 2024 | { |
| 2025 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 2026 | "line": 23, |
| 2027 | "message": "[nit] trailing whitespace" |
| 2028 | } |
| 2029 | ---- |
| 2030 | |
| 2031 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 2032 | describes the draft comment. |
| 2033 | |
| 2034 | .Response |
| 2035 | ---- |
| 2036 | HTTP/1.1 200 OK |
| 2037 | Content-Disposition: attachment |
| 2038 | Content-Type: application/json;charset=UTF-8 |
| 2039 | |
| 2040 | )]}' |
| 2041 | { |
| 2042 | "kind": "gerritcodereview#comment", |
| 2043 | "id": "TvcXrmjM", |
| 2044 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 2045 | "line": 23, |
| 2046 | "message": "[nit] trailing whitespace", |
| 2047 | "updated": "2013-02-26 15:40:43.986000000" |
| 2048 | } |
| 2049 | ---- |
| 2050 | |
| 2051 | [[delete-draft]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2052 | === Delete Draft |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2053 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 2054 | 'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/link:#draft-id[\{draft-id\}]' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2055 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 2056 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 2057 | Deletes a draft comment from a revision. |
| 2058 | |
| 2059 | .Request |
| 2060 | ---- |
| 2061 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
| 2062 | ---- |
| 2063 | |
| 2064 | .Response |
| 2065 | ---- |
| 2066 | HTTP/1.1 204 No Content |
| 2067 | ---- |
| 2068 | |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 2069 | [[list-comments]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2070 | === List Comments |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2071 | -- |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 2072 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2073 | -- |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 2074 | |
| 2075 | Lists the published comments of a revision. |
| 2076 | |
| 2077 | As result a map is returned that maps the file path to a list of |
| 2078 | link:#comment-info[CommentInfo] entries. The entries in the map are |
| 2079 | sorted by file path. |
| 2080 | |
| 2081 | .Request |
| 2082 | ---- |
| 2083 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/ HTTP/1.0 |
| 2084 | ---- |
| 2085 | |
| 2086 | .Response |
| 2087 | ---- |
| 2088 | HTTP/1.1 200 OK |
| 2089 | Content-Disposition: attachment |
| 2090 | Content-Type: application/json;charset=UTF-8 |
| 2091 | |
| 2092 | )]}' |
| 2093 | { |
| 2094 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 2095 | { |
| 2096 | "kind": "gerritcodereview#comment", |
| 2097 | "id": "TvcXrmjM", |
| 2098 | "line": 23, |
| 2099 | "message": "[nit] trailing whitespace", |
| 2100 | "updated": "2013-02-26 15:40:43.986000000", |
| 2101 | "author": { |
| 2102 | "_account_id": 1000096, |
| 2103 | "name": "John Doe", |
| 2104 | "email": "john.doe@example.com" |
| 2105 | } |
| 2106 | }, |
| 2107 | { |
| 2108 | "kind": "gerritcodereview#comment", |
| 2109 | "id": "TveXwFiA", |
| 2110 | "line": 49, |
| 2111 | "in_reply_to": "TfYX-Iuo", |
| 2112 | "message": "Done", |
| 2113 | "updated": "2013-02-26 15:40:45.328000000", |
| 2114 | "author": { |
| 2115 | "_account_id": 1000097, |
| 2116 | "name": "Jane Roe", |
| 2117 | "email": "jane.roe@example.com" |
| 2118 | } |
| 2119 | } |
| 2120 | ] |
| 2121 | } |
| 2122 | ---- |
| 2123 | |
| 2124 | [[get-comment]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2125 | === Get Comment |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2126 | -- |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 2127 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2128 | -- |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 2129 | |
| 2130 | Retrieves a published comment of a revision. |
| 2131 | |
| 2132 | .Request |
| 2133 | ---- |
| 2134 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM HTTP/1.0 |
| 2135 | ---- |
| 2136 | |
| 2137 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 2138 | describes the published comment. |
| 2139 | |
| 2140 | .Response |
| 2141 | ---- |
| 2142 | HTTP/1.1 200 OK |
| 2143 | Content-Disposition: attachment |
| 2144 | Content-Type: application/json;charset=UTF-8 |
| 2145 | |
| 2146 | )]}' |
| 2147 | { |
| 2148 | "kind": "gerritcodereview#comment", |
| 2149 | "id": "TvcXrmjM", |
| 2150 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 2151 | "line": 23, |
| 2152 | "message": "[nit] trailing whitespace", |
| 2153 | "updated": "2013-02-26 15:40:43.986000000", |
| 2154 | "author": { |
| 2155 | "_account_id": 1000096, |
| 2156 | "name": "John Doe", |
| 2157 | "email": "john.doe@example.com" |
| 2158 | } |
| 2159 | } |
| 2160 | ---- |
| 2161 | |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 2162 | [[list-files]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2163 | === List Files |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2164 | -- |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 2165 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2166 | -- |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 2167 | |
| 2168 | Lists the files that were modified, added or deleted in a revision. |
| 2169 | |
| 2170 | .Request |
| 2171 | ---- |
| 2172 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/ HTTP/1.0 |
| 2173 | ---- |
| 2174 | |
| 2175 | As result a map is returned that maps the file path to a list of |
| 2176 | link:#file-info[FileInfo] entries. The entries in the map are |
| 2177 | sorted by file path. |
| 2178 | |
| 2179 | .Response |
| 2180 | ---- |
| 2181 | HTTP/1.1 200 OK |
| 2182 | Content-Disposition: attachment |
| 2183 | Content-Type: application/json;charset=UTF-8 |
| 2184 | |
| 2185 | )]}' |
| 2186 | { |
| 2187 | "/COMMIT_MSG": { |
| 2188 | "status": "A", |
| 2189 | "lines_inserted": 7 |
| 2190 | }, |
| 2191 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": { |
| 2192 | "lines_inserted": 5, |
| 2193 | "lines_deleted": 3 |
| 2194 | } |
| 2195 | } |
| 2196 | ---- |
| 2197 | |
Shawn Pearce | 984747d | 2013-07-18 00:42:16 -0700 | [diff] [blame] | 2198 | The request parameter `reviewed` changes the response to return a list |
| 2199 | of the paths the caller has marked as reviewed. Clients that also |
| 2200 | need the FileInfo should make two requests. |
| 2201 | |
| 2202 | .Request |
| 2203 | ---- |
| 2204 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/?reviewed HTTP/1.0 |
| 2205 | ---- |
| 2206 | |
| 2207 | .Response |
| 2208 | ---- |
| 2209 | HTTP/1.1 200 OK |
| 2210 | Content-Disposition: attachment |
| 2211 | Content-Type: application/json;charset=UTF-8 |
| 2212 | |
| 2213 | )]}' |
| 2214 | [ |
| 2215 | "/COMMIT_MSG", |
| 2216 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 2217 | ] |
| 2218 | ---- |
| 2219 | |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 2220 | [[get-content]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2221 | === Get Content |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2222 | -- |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 2223 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/content' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2224 | -- |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 2225 | |
| 2226 | Gets the content of a file from a certain revision. |
| 2227 | |
| 2228 | .Request |
| 2229 | ---- |
| 2230 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0 |
| 2231 | ---- |
| 2232 | |
| 2233 | The content is returned as base64 encoded string. |
| 2234 | |
| 2235 | .Response |
| 2236 | ---- |
| 2237 | HTTP/1.1 200 OK |
| 2238 | Content-Disposition: attachment |
| 2239 | Content-Type: text/plain;charset=UTF-8 |
| 2240 | |
| 2241 | Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY... |
| 2242 | ---- |
| 2243 | |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 2244 | [[get-diff]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2245 | === Get Diff |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2246 | -- |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 2247 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/diff' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2248 | -- |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 2249 | |
| 2250 | Gets the diff of a file from a certain revision. |
| 2251 | |
| 2252 | .Request |
| 2253 | ---- |
| 2254 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff HTTP/1.0 |
| 2255 | ---- |
| 2256 | |
| 2257 | As response a link:#diff-info[DiffInfo] entity is returned that describes the diff. |
| 2258 | |
| 2259 | .Response |
| 2260 | ---- |
| 2261 | HTTP/1.1 200 OK |
| 2262 | Content-Disposition: attachment |
| 2263 | Content-Type: application/json;charset=UTF-8 |
| 2264 | |
| 2265 | )] |
| 2266 | { |
| 2267 | "meta_a": { |
| 2268 | "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
Shawn Pearce | d62a6a9 | 2013-12-05 12:45:32 -0800 | [diff] [blame] | 2269 | "content_type": "text/x-java-source", |
| 2270 | "lines": 372 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 2271 | }, |
| 2272 | "meta_b": { |
| 2273 | "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
Shawn Pearce | d62a6a9 | 2013-12-05 12:45:32 -0800 | [diff] [blame] | 2274 | "content_type": "text/x-java-source", |
| 2275 | "lines": 578 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 2276 | }, |
| 2277 | "change_type": "MODIFIED", |
| 2278 | "diff_header": [ |
| 2279 | "diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 2280 | "index 59b7670..9faf81c 100644", |
| 2281 | "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 2282 | "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java" |
| 2283 | ], |
| 2284 | "content": [ |
| 2285 | { |
| 2286 | "ab": [ |
| 2287 | "// Copyright (C) 2010 The Android Open Source Project", |
| 2288 | "//", |
| 2289 | "// Licensed under the Apache License, Version 2.0 (the \"License\");", |
| 2290 | "// you may not use this file except in compliance with the License.", |
| 2291 | "// You may obtain a copy of the License at", |
| 2292 | "//", |
| 2293 | "// http://www.apache.org/licenses/LICENSE-2.0", |
| 2294 | "//", |
| 2295 | "// Unless required by applicable law or agreed to in writing, software", |
| 2296 | "// distributed under the License is distributed on an \"AS IS\" BASIS,", |
| 2297 | "// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", |
| 2298 | "// See the License for the specific language governing permissions and", |
| 2299 | "// limitations under the License." |
| 2300 | ] |
| 2301 | }, |
| 2302 | { |
| 2303 | "b": [ |
| 2304 | "//", |
| 2305 | "// Add some more lines in the header." |
| 2306 | ] |
| 2307 | }, |
| 2308 | { |
| 2309 | "ab": [ |
| 2310 | "", |
| 2311 | "package com.google.gerrit.server.project;", |
| 2312 | "", |
| 2313 | "import com.google.common.collect.Maps;", |
| 2314 | ... |
| 2315 | ] |
| 2316 | } |
| 2317 | ... |
| 2318 | ] |
| 2319 | } |
| 2320 | ---- |
| 2321 | |
| 2322 | If the `intraline` parameter is specified, intraline differences are included in the diff. |
| 2323 | |
| 2324 | .Request |
| 2325 | ---- |
| 2326 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/b6b9c10649b9041884046119ab794374470a1b45/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff?intraline HTTP/1.0 |
| 2327 | ---- |
| 2328 | |
| 2329 | .Response |
| 2330 | ---- |
| 2331 | HTTP/1.1 200 OK |
| 2332 | Content-Disposition: attachment |
| 2333 | Content-Type: application/json;charset=UTF-8 |
| 2334 | |
| 2335 | )] |
| 2336 | { |
| 2337 | "meta_a": { |
| 2338 | "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
Shawn Pearce | d62a6a9 | 2013-12-05 12:45:32 -0800 | [diff] [blame] | 2339 | "content_type": "text/x-java-source", |
| 2340 | "lines": 372 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 2341 | }, |
| 2342 | "meta_b": { |
| 2343 | "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
Shawn Pearce | d62a6a9 | 2013-12-05 12:45:32 -0800 | [diff] [blame] | 2344 | "content_type": "text/x-java-source", |
| 2345 | "lines": 578 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 2346 | }, |
| 2347 | "change_type": "MODIFIED", |
| 2348 | "diff_header": [ |
| 2349 | "diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 2350 | "index 59b7670..9faf81c 100644", |
| 2351 | "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 2352 | "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java" |
| 2353 | ], |
| 2354 | "content": [ |
| 2355 | ... |
| 2356 | { |
| 2357 | "a": [ |
| 2358 | "/** Manages access control for Git references (aka branches, tags). */" |
| 2359 | ], |
| 2360 | "b": [ |
| 2361 | "/** Manages access control for the Git references (aka branches, tags). */" |
| 2362 | ], |
| 2363 | "edit_a": [], |
| 2364 | "edit_b": [ |
| 2365 | [ |
| 2366 | 31, |
| 2367 | 4 |
| 2368 | ] |
| 2369 | ] |
| 2370 | } |
| 2371 | ] |
| 2372 | } |
| 2373 | ---- |
| 2374 | |
| 2375 | The `base` parameter can be specified to control the base patch set from which the diff should |
| 2376 | be generated. |
| 2377 | |
| 2378 | .Request |
| 2379 | ---- |
| 2380 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/b6b9c10649b9041884046119ab794374470a1b45/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff?base=2 HTTP/1.0 |
| 2381 | ---- |
| 2382 | |
| 2383 | .Response |
| 2384 | ---- |
| 2385 | HTTP/1.1 200 OK |
| 2386 | Content-Disposition: attachment |
| 2387 | Content-Type: application/json;charset=UTF-8 |
| 2388 | |
| 2389 | )] |
| 2390 | { |
| 2391 | "meta_a": { |
| 2392 | "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
Shawn Pearce | d62a6a9 | 2013-12-05 12:45:32 -0800 | [diff] [blame] | 2393 | "content_type": "text/x-java-source", |
| 2394 | "lines": 578 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 2395 | }, |
| 2396 | "meta_b": { |
| 2397 | "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
Shawn Pearce | d62a6a9 | 2013-12-05 12:45:32 -0800 | [diff] [blame] | 2398 | "content_type": "text/x-java-source", |
| 2399 | "lines": 578 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 2400 | }, |
| 2401 | "change_type": "MODIFIED", |
| 2402 | "content": [ |
| 2403 | { |
| 2404 | "skip": 578 |
| 2405 | } |
| 2406 | ] |
| 2407 | } |
| 2408 | ---- |
| 2409 | |
| 2410 | The `ignore-whitespace` parameter can be specified to control how whitespace differences are |
| 2411 | reported in the result. Valid values are `NONE`, `TRAILING`, `CHANGED` or `ALL`. |
| 2412 | |
| 2413 | The `context` parameter can be specified to control the number of lines of surrounding context |
| 2414 | in the diff. Valid values are `ALL` or number of lines. |
| 2415 | |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 2416 | [[set-reviewed]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2417 | === Set Reviewed |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2418 | -- |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 2419 | 'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/reviewed' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2420 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 2421 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 2422 | Marks a file of a revision as reviewed by the calling user. |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 2423 | |
| 2424 | .Request |
| 2425 | ---- |
| 2426 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0 |
| 2427 | ---- |
| 2428 | |
| 2429 | .Response |
| 2430 | ---- |
| 2431 | HTTP/1.1 201 Created |
| 2432 | ---- |
| 2433 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 2434 | If the file was already marked as reviewed by the calling user the |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 2435 | response is "`200 OK`". |
| 2436 | |
| 2437 | [[delete-reviewed]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2438 | === Delete Reviewed |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2439 | -- |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 2440 | 'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/reviewed' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2441 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 2442 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 2443 | Deletes the reviewed flag of the calling user from a file of a revision. |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 2444 | |
| 2445 | .Request |
| 2446 | ---- |
| 2447 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0 |
| 2448 | ---- |
| 2449 | |
| 2450 | .Response |
| 2451 | ---- |
| 2452 | HTTP/1.1 204 No Content |
| 2453 | ---- |
| 2454 | |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 2455 | [[cherry-pick]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2456 | === Cherry Pick Revision |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2457 | -- |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 2458 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/cherrypick' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2459 | -- |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 2460 | |
| 2461 | Cherry picks a revision to a destination branch. |
| 2462 | |
| 2463 | The commit message and destination branch must be provided in the request body inside a |
| 2464 | link:#cherrypick-input[CherryPickInput] entity. |
| 2465 | |
| 2466 | .Request |
| 2467 | ---- |
| 2468 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/cherrypick HTTP/1.0 |
| 2469 | Content-Type: application/json;charset=UTF-8 |
| 2470 | |
| 2471 | { |
Gustaf Lundh | 98df5b5 | 2013-05-07 19:22:13 +0100 | [diff] [blame] | 2472 | "message" : "Implementing Feature X", |
| 2473 | "destination" : "release-branch" |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 2474 | } |
| 2475 | ---- |
| 2476 | |
| 2477 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 2478 | describes the resulting cherry picked change. |
| 2479 | |
| 2480 | .Response |
| 2481 | ---- |
| 2482 | HTTP/1.1 200 OK |
| 2483 | Content-Disposition: attachment |
| 2484 | Content-Type: application/json;charset=UTF-8 |
| 2485 | |
| 2486 | )]}' |
| 2487 | { |
| 2488 | "kind": "gerritcodereview#change", |
| 2489 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941", |
| 2490 | "project": "myProject", |
| 2491 | "branch": "release-branch", |
| 2492 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941", |
| 2493 | "subject": "Implementing Feature X", |
| 2494 | "status": "NEW", |
| 2495 | "created": "2013-02-01 09:59:32.126000000", |
| 2496 | "updated": "2013-02-21 11:16:36.775000000", |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 2497 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 2498 | "insertions": 12, |
| 2499 | "deletions": 11, |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 2500 | "_sortkey": "0023412400000f7d", |
| 2501 | "_number": 3965, |
| 2502 | "owner": { |
| 2503 | "name": "John Doe" |
| 2504 | } |
| 2505 | } |
| 2506 | ---- |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 2507 | |
David Ostrovsky | ae15e050 | 2013-08-19 08:06:07 +0200 | [diff] [blame] | 2508 | [[message]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2509 | === Edit Commit Message |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2510 | -- |
David Ostrovsky | ae15e050 | 2013-08-19 08:06:07 +0200 | [diff] [blame] | 2511 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/message' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2512 | -- |
David Ostrovsky | ae15e050 | 2013-08-19 08:06:07 +0200 | [diff] [blame] | 2513 | |
| 2514 | Edit commit message. |
| 2515 | |
| 2516 | The commit message must be provided in the request body inside a |
| 2517 | link:#cherrypick-input[CherryPickInput] entity. |
| 2518 | |
| 2519 | .Request |
| 2520 | ---- |
| 2521 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/message HTTP/1.0 |
| 2522 | Content-Type: application/json;charset=UTF-8 |
| 2523 | |
| 2524 | { |
| 2525 | "message" : "Reword Implementing Feature X", |
| 2526 | } |
| 2527 | ---- |
| 2528 | |
| 2529 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 2530 | describes the change. |
| 2531 | |
| 2532 | .Response |
| 2533 | ---- |
| 2534 | HTTP/1.1 200 OK |
| 2535 | Content-Disposition: attachment |
| 2536 | Content-Type: application/json;charset=UTF-8 |
| 2537 | |
| 2538 | )]}' |
| 2539 | { |
| 2540 | "kind": "gerritcodereview#change", |
| 2541 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941", |
| 2542 | "project": "myProject", |
| 2543 | "branch": "release-branch", |
| 2544 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941", |
| 2545 | "subject": "Reword Implementing Feature X", |
| 2546 | "status": "NEW", |
| 2547 | "created": "2013-02-01 09:59:32.126000000", |
| 2548 | "updated": "2013-02-21 11:16:36.775000000", |
David Ostrovsky | ae15e050 | 2013-08-19 08:06:07 +0200 | [diff] [blame] | 2549 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 2550 | "insertions": 261, |
| 2551 | "deletions": 101, |
David Ostrovsky | ae15e050 | 2013-08-19 08:06:07 +0200 | [diff] [blame] | 2552 | "_sortkey": "0023412400000f7d", |
| 2553 | "_number": 3965, |
| 2554 | "owner": { |
| 2555 | "name": "John Doe" |
| 2556 | } |
| 2557 | } |
| 2558 | ---- |
| 2559 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 2560 | [[ids]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2561 | == IDs |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 2562 | |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 2563 | [[account-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2564 | === link:rest-api-accounts.html#account-id[\{account-id\}] |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 2565 | -- |
| 2566 | -- |
| 2567 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 2568 | [[change-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2569 | === \{change-id\} |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 2570 | Identifier that uniquely identifies one change. |
| 2571 | |
| 2572 | This can be: |
| 2573 | |
| 2574 | * an ID of the change in the format "'$$<project>~<branch>~<Change-Id>$$'", |
| 2575 | where for the branch the `refs/heads/` prefix can be omitted |
| 2576 | ("$$myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940$$") |
| 2577 | * a Change-Id if it uniquely identifies one change |
| 2578 | ("I8473b95934b5732ac55d26311a706c9c2bde9940") |
| 2579 | * a legacy numeric change ID ("4247") |
| 2580 | |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 2581 | [[comment-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2582 | === \{comment-id\} |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 2583 | UUID of a published comment. |
| 2584 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 2585 | [[draft-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2586 | === \{draft-id\} |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 2587 | UUID of a draft comment. |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 2588 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 2589 | [[file-id]] |
| 2590 | \{file-id\} |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 2591 | ~~~~~~~~~~~~ |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 2592 | The path of the file. |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 2593 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 2594 | [[revision-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2595 | === \{revision-id\} |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 2596 | Identifier that uniquely identifies one revision of a change. |
| 2597 | |
| 2598 | This can be: |
| 2599 | |
Shawn Pearce | 9c0722a | 2013-03-02 15:30:31 -0800 | [diff] [blame] | 2600 | * the literal `current` to name the current patch set/revision |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 2601 | * a commit ID ("674ac754f91e64a0efb8087e59a176484bd534d1") |
| 2602 | * an abbreviated commit ID that uniquely identifies one revision of the |
| 2603 | change ("674ac754"), at least 4 digits are required |
| 2604 | * a legacy numeric patch number ("1" for first patch set of the change) |
| 2605 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2606 | [[json-entities]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2607 | == JSON Entities |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2608 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 2609 | [[abandon-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2610 | === AbandonInput |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 2611 | The `AbandonInput` entity contains information for abandoning a change. |
| 2612 | |
| 2613 | [options="header",width="50%",cols="1,^1,5"] |
| 2614 | |=========================== |
| 2615 | |Field Name ||Description |
| 2616 | |`message` |optional| |
| 2617 | Message to be added as review comment to the change when abandoning the |
| 2618 | change. |
| 2619 | |=========================== |
| 2620 | |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 2621 | [[action-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2622 | === ActionInfo |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 2623 | The `ActionInfo` entity describes a REST API call the client can |
| 2624 | make to manipulate a resource. These are frequently implemented by |
| 2625 | plugins and may be discovered at runtime. |
| 2626 | |
| 2627 | [options="header",width="50%",cols="1,^1,5"] |
| 2628 | |==================================== |
| 2629 | |Field Name ||Description |
| 2630 | |`method` |optional| |
| 2631 | HTTP method to use with the action. Most actions use `POST`, `PUT` |
| 2632 | or `DELETE` to cause state changes. |
| 2633 | |`label` |optional| |
| 2634 | Short title to display to a user describing the action. In the |
| 2635 | Gerrit web interface the label is used as the text on the button |
| 2636 | presented in the UI. |
| 2637 | |`title` |optional| |
| 2638 | Longer text to display describing the action. In a web UI this |
| 2639 | should be the title attribute of the element, displaying when |
| 2640 | the user hovers the mouse. |
| 2641 | |`enabled` |optional| |
| 2642 | If true the action is permitted at this time and the caller is |
| 2643 | likely allowed to execute it. This may change if state is updated |
| 2644 | at the server or permissions are modified. Not present if false. |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 2645 | |==================================== |
| 2646 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 2647 | [[add-reviewer-result]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2648 | === AddReviewerResult |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 2649 | The `AddReviewerResult` entity describes the result of adding a |
| 2650 | reviewer to a change. |
| 2651 | |
| 2652 | [options="header",width="50%",cols="1,^1,5"] |
| 2653 | |=========================== |
| 2654 | |Field Name ||Description |
| 2655 | |`reviewers` |optional| |
| 2656 | The newly added reviewers as a list of link:#reviewer-info[ |
| 2657 | ReviewerInfo] entities. |
| 2658 | |`error` |optional| |
| 2659 | Error message explaining why the reviewer could not be added. + |
| 2660 | If a group was specified in the input and an error is returned, it |
| 2661 | means that none of the members were added as reviewer. |
| 2662 | |`confirm` |`false` if not set| |
| 2663 | Whether adding the reviewer requires confirmation. |
| 2664 | |=========================== |
| 2665 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2666 | [[approval-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2667 | === ApprovalInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2668 | The `ApprovalInfo` entity contains information about an approval from a |
| 2669 | user for a label on a change. |
| 2670 | |
Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 2671 | `ApprovalInfo` has the same fields as |
| 2672 | link:rest-api-accounts.html#account-info[AccountInfo]. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2673 | In addition `ApprovalInfo` has the following fields: |
| 2674 | |
| 2675 | [options="header",width="50%",cols="1,^1,5"] |
| 2676 | |=========================== |
| 2677 | |Field Name ||Description |
Dave Borowitz | a30db91 | 2013-03-22 14:20:33 -0700 | [diff] [blame] | 2678 | |`value` |optional| |
| 2679 | The vote that the user has given for the label. If present and zero, the |
| 2680 | user is permitted to vote on the label. If absent, the user is not |
| 2681 | permitted to vote on that label. |
Gustaf Lundh | 2e07d502 | 2013-05-08 17:07:42 +0100 | [diff] [blame] | 2682 | |`date` |optional| |
| 2683 | The time and date describing when the approval was made. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2684 | |=========================== |
| 2685 | |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 2686 | [[group-base-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2687 | === GroupBaseInfo |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 2688 | The `GroupBaseInfo` entity contains base information about the group. |
| 2689 | |
| 2690 | [options="header",width="50%",cols="1,6"] |
| 2691 | |========================== |
| 2692 | |Field Name |Description |
| 2693 | |`id` |The id of the group. |
| 2694 | |`name` |The name of the group. |
| 2695 | |========================== |
| 2696 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2697 | [[change-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2698 | === ChangeInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2699 | The `ChangeInfo` entity contains information about a change. |
| 2700 | |
| 2701 | [options="header",width="50%",cols="1,^1,5"] |
| 2702 | |================================== |
| 2703 | |Field Name ||Description |
| 2704 | |`kind` ||`gerritcodereview#change` |
| 2705 | |`id` || |
| 2706 | The ID of the change in the format "'<project>\~<branch>~<Change-Id>'", |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 2707 | where 'project', 'branch' and 'Change-Id' are URL encoded. For 'branch' the |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2708 | `refs/heads/` prefix is omitted. |
| 2709 | |`project` ||The name of the project. |
| 2710 | |`branch` || |
| 2711 | The name of the target branch. + |
| 2712 | The `refs/heads/` prefix is omitted. |
Edwin Kempin | cd6c01a1 | 2013-02-21 14:58:52 +0100 | [diff] [blame] | 2713 | |`topic` |optional|The topic to which this change belongs. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2714 | |`change_id` ||The Change-Id of the change. |
| 2715 | |`subject` || |
| 2716 | The subject of the change (header line of the commit message). |
| 2717 | |`status` || |
| 2718 | The status of the change (`NEW`, `SUBMITTED`, `MERGED`, `ABANDONED`, |
| 2719 | `DRAFT`). |
| 2720 | |`created` || |
| 2721 | The link:rest-api.html#timestamp[timestamp] of when the change was |
| 2722 | created. |
| 2723 | |`updated` || |
| 2724 | The link:rest-api.html#timestamp[timestamp] of when the change was last |
| 2725 | updated. |
| 2726 | |`starred` |not set if `false`| |
| 2727 | Whether the calling user has starred this change. |
| 2728 | |`reviewed` |not set if `false`| |
| 2729 | Whether the change was reviewed by the calling user. |
Shawn Pearce | 414c5ff | 2013-09-06 21:51:02 -0700 | [diff] [blame] | 2730 | Only set if link:#reviewed[reviewed] is requested. |
Edwin Kempin | baf70e1 | 2013-02-27 10:36:13 +0100 | [diff] [blame] | 2731 | |`mergeable` |optional| |
| 2732 | Whether the change is mergeable. + |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 2733 | Not set for merged changes. |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 2734 | |`insertions` || |
| 2735 | Number of inserted lines. |
| 2736 | |`deletions` || |
| 2737 | Number of deleted lines. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2738 | |`_sortkey` ||The sortkey of the change. |
| 2739 | |`_number` ||The legacy numeric ID of the change. |
| 2740 | |`owner` || |
Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 2741 | The owner of the change as an link:rest-api-accounts.html#account-info[ |
| 2742 | AccountInfo] entity. |
Shawn Pearce | 12e5159 | 2013-07-13 22:08:40 -0700 | [diff] [blame] | 2743 | |`actions` |optional| |
| 2744 | Actions the caller might be able to perform on this revision. The |
| 2745 | information is a map of view name to link:#action-info[ActionInfo] |
| 2746 | entities. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2747 | |`labels` |optional| |
| 2748 | The labels of the change as a map that maps the label names to |
| 2749 | link:#label-info[LabelInfo] entries. + |
| 2750 | Only set if link:#labels[labels] or link:#detailed-labels[detailed |
| 2751 | labels] are requested. |
| 2752 | |`permitted_labels` |optional| |
| 2753 | A map of the permitted labels that maps a label name to the list of |
| 2754 | values that are allowed for that label. + |
| 2755 | Only set if link:#detailed-labels[detailed labels] are requested. |
| 2756 | |`removable_reviewers`|optional| |
| 2757 | The reviewers that can be removed by the calling user as a list of |
Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 2758 | link:rest-api-accounts.html#account-info[AccountInfo] entities. + |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2759 | Only set if link:#detailed-labels[detailed labels] are requested. |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 2760 | |`messages`|optional| |
Shawn Pearce | 414c5ff | 2013-09-06 21:51:02 -0700 | [diff] [blame] | 2761 | Messages associated with the change as a list of |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 2762 | link:#change-message-info[ChangeMessageInfo] entities. + |
| 2763 | Only set if link:#messages[messages] are requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2764 | |`current_revision` |optional| |
| 2765 | The commit ID of the current patch set of this change. + |
| 2766 | Only set if link:#current-revision[the current revision] is requested |
| 2767 | or if link:#all-revisions[all revisions] are requested. |
| 2768 | |`revisions` |optional| |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 2769 | All patch sets of this change as a map that maps the commit ID of the |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2770 | patch set to a link:#revision-info[RevisionInfo] entity. + |
Dave Borowitz | 0adf270 | 2014-01-22 10:41:52 -0800 | [diff] [blame] | 2771 | Only set if link:#current-revision[the current revision] is requested |
| 2772 | (in which case it will only contain a key for the current revision) or |
| 2773 | if link:#all-revisions[all revisions] are requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2774 | |`_more_changes` |optional, not set if `false`| |
| 2775 | Whether the query would deliver more results if not limited. + |
| 2776 | Only set on either the last or the first change that is returned. |
| 2777 | |================================== |
| 2778 | |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 2779 | [[change-message-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2780 | === ChangeMessageInfo |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 2781 | The `ChangeMessageInfo` entity contains information about a message |
| 2782 | attached to a change. |
| 2783 | |
| 2784 | [options="header",width="50%",cols="1,^1,5"] |
| 2785 | |================================== |
| 2786 | |Field Name ||Description |
| 2787 | |`id` ||The ID of the message. |
| 2788 | |`author` |optional| |
| 2789 | Author of the message as an |
| 2790 | link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
| 2791 | Unset if written by the Gerrit system. |
| 2792 | |`date` || |
| 2793 | The link:rest-api.html#timestamp[timestamp] this message was posted. |
| 2794 | |`message` ||The text left by the user. |
| 2795 | |`_revision_number` |optional| |
| 2796 | Which patchset (if any) generated this message. |
| 2797 | |================================== |
| 2798 | |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 2799 | [[cherrypick-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2800 | === CherryPickInput |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 2801 | The `CherryPickInput` entity contains information for cherry-picking a change to a new branch. |
| 2802 | |
| 2803 | [options="header",width="50%",cols="1,6"] |
| 2804 | |=========================== |
| 2805 | |Field Name |Description |
| 2806 | |`message` |Commit message for the cherry-picked change |
| 2807 | |`destination` |Destination Branch |
| 2808 | |=========================== |
| 2809 | |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 2810 | [[comment-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2811 | === CommentInfo |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 2812 | The `CommentInfo` entity contains information about an inline comment. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 2813 | |
| 2814 | [options="header",width="50%",cols="1,^1,5"] |
| 2815 | |=========================== |
| 2816 | |Field Name ||Description |
| 2817 | |`kind` ||`gerritcodereview#comment` |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 2818 | |`id` ||The URL encoded UUID of the comment. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 2819 | |`path` |optional| |
| 2820 | The path of the file for which the inline comment was done. + |
| 2821 | Not set if returned in a map where the key is the file path. |
| 2822 | |`side` |optional| |
| 2823 | The side on which the comment was added. + |
| 2824 | Allowed values are `REVISION` and `PARENT`. + |
| 2825 | If not set, the default is `REVISION`. |
| 2826 | |`line` |optional| |
| 2827 | The number of the line for which the comment was done. + |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 2828 | If range is set, this equals the end line of the range. + |
| 2829 | If neither line nor range is set, it's a file comment. |
| 2830 | |`range` |optional| |
| 2831 | The range of the comment as a link:rest-api.html#comment-range[CommentRange] |
| 2832 | entity. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 2833 | |`in_reply_to` |optional| |
| 2834 | The URL encoded UUID of the comment to which this comment is a reply. |
| 2835 | |`message` |optional|The comment message. |
| 2836 | |`updated` || |
| 2837 | The link:rest-api.html#timestamp[timestamp] of when this comment was |
| 2838 | written. |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 2839 | |`author` |optional| |
David Pursehouse | c633a57 | 2013-08-26 14:01:59 +0900 | [diff] [blame] | 2840 | The author of the message as an |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 2841 | link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
| 2842 | Unset for draft comments, assumed to be the calling user. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 2843 | |=========================== |
| 2844 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 2845 | [[comment-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2846 | === CommentInput |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 2847 | The `CommitInput` entity contains information for creating an inline |
| 2848 | comment. |
| 2849 | |
| 2850 | [options="header",width="50%",cols="1,^1,5"] |
| 2851 | |=========================== |
| 2852 | |Field Name ||Description |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 2853 | |`kind` |optional| |
| 2854 | Must be `gerritcodereview#comment` if provided. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 2855 | |`id` |optional| |
Edwin Kempin | c09826d7 | 2013-02-26 16:10:39 +0100 | [diff] [blame] | 2856 | The URL encoded UUID of the comment if an existing draft comment should |
| 2857 | be updated. |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 2858 | |`path` |optional| |
| 2859 | The path of the file for which the inline comment should be added. + |
| 2860 | Doesn't need to be set if contained in a map where the key is the file |
| 2861 | path. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 2862 | |`side` |optional| |
| 2863 | The side on which the comment should be added. + |
| 2864 | Allowed values are `REVISION` and `PARENT`. + |
| 2865 | If not set, the default is `REVISION`. |
| 2866 | |`line` |optional| |
| 2867 | The number of the line for which the comment should be added. + |
| 2868 | `0` if it is a file comment. + |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 2869 | If neither line nor range is set, a file comment is added. + |
| 2870 | If range is set, this should equal the end line of the range. |
| 2871 | |`range` |optional| |
| 2872 | The range of the comment as a link:rest-api.html#comment-range[CommentRange] |
| 2873 | entity. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 2874 | |`in_reply_to` |optional| |
| 2875 | The URL encoded UUID of the comment to which this comment is a reply. |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 2876 | |`updated` |optional| |
| 2877 | The link:rest-api.html#timestamp[timestamp] of this comment. + |
| 2878 | Accepted but ignored. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 2879 | |`message` |optional| |
| 2880 | The comment message. + |
| 2881 | If not set and an existing draft comment is updated, the existing draft |
| 2882 | comment is deleted. |
| 2883 | |=========================== |
| 2884 | |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 2885 | [[comment-range]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2886 | === CommentRange |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 2887 | The `CommentRange` entity describes the range of an inline comment. |
| 2888 | |
| 2889 | [options="header",width="50%",cols="1,^1,5"] |
| 2890 | |=========================== |
| 2891 | |Field Name ||Description |
| 2892 | |`start_line` ||The start line number of the range. |
| 2893 | |`start_character` ||The character position in the start line. |
| 2894 | |`end_line` ||The end line number of the range. |
| 2895 | |`end_character` ||The character position in the end line. |
| 2896 | |=========================== |
| 2897 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2898 | [[commit-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2899 | === CommitInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2900 | The `CommitInfo` entity contains information about a commit. |
| 2901 | |
| 2902 | [options="header",width="50%",cols="1,6"] |
| 2903 | |========================== |
| 2904 | |Field Name |Description |
| 2905 | |`commit` |The commit ID. |
| 2906 | |`parent` | |
| 2907 | The parent commits of this commit as a list of |
Shawn Pearce | ad055fd | 2013-07-11 17:01:27 -0700 | [diff] [blame] | 2908 | link:#commit-info[CommitInfo] entities. In parent |
| 2909 | only `commit` and `subject` fields are populated. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2910 | |`author` |The author of the commit as a |
| 2911 | link:#git-person-info[GitPersonInfo] entity. |
| 2912 | |`committer` |The committer of the commit as a |
| 2913 | link:#git-person-info[GitPersonInfo] entity. |
| 2914 | |`subject` | |
| 2915 | The subject of the commit (header line of the commit message). |
| 2916 | |`message` |The commit message. |
| 2917 | |========================== |
| 2918 | |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 2919 | [[diff-content]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2920 | === DiffContent |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 2921 | The `DiffContent` entity contains information about the content differences |
| 2922 | in a file. |
| 2923 | |
| 2924 | [options="header",width="50%",cols="1,^1,5"] |
| 2925 | |========================== |
| 2926 | |Field Name ||Description |
| 2927 | |`a` |optional|Content only in the file on side A (deleted in B). |
| 2928 | |`b` |optional|Content only in the file on side B (added in B). |
| 2929 | |`ab` |optional|Content in the file on both sides (unchanged). |
| 2930 | |`edit_a` |only present during a replace, i.e. both `a` and `b` are present| |
| 2931 | Text sections deleted from side A as a |
| 2932 | link:#diff-intraline-info[DiffIntralineInfo] entity. |
| 2933 | |`edit_b` |only present during a replace, i.e. both `a` and `b` are present| |
| 2934 | Text sections inserted in side B as a |
| 2935 | link:#diff-intraline-info[DiffIntralineInfo] entity. |
| 2936 | |`skip` |optional|count of lines skipped on both sides when the file is |
| 2937 | too large to include all common lines. |
Shawn Pearce | 425a2be | 2014-01-02 16:00:58 -0800 | [diff] [blame] | 2938 | |`common` |optional|Set to `true` if the region is common according |
| 2939 | to the requested ignore-whitespace parameter, but a and b contain |
| 2940 | differing amounts of whitespace. When present and true a and b are |
| 2941 | used instead of ab. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 2942 | |========================== |
| 2943 | |
| 2944 | [[diff-file-meta-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2945 | === DiffFileMetaInfo |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 2946 | The `DiffFileMetaInfo` entity contains meta information about a file diff. |
| 2947 | |
| 2948 | [options="header",width="50%",cols="1,6"] |
| 2949 | |========================== |
| 2950 | |Field Name |Description |
| 2951 | |`name` |The name of the file. |
| 2952 | |`content_type`|The content type of the file. |
Shawn Pearce | d62a6a9 | 2013-12-05 12:45:32 -0800 | [diff] [blame] | 2953 | |`lines` |The total number of lines in the file. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 2954 | |========================== |
| 2955 | |
| 2956 | [[diff-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2957 | === DiffInfo |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 2958 | The `DiffInfo` entity contains information about the diff of a file |
| 2959 | in a revision. |
| 2960 | |
| 2961 | [options="header",width="50%",cols="1,^1,5"] |
| 2962 | |========================== |
| 2963 | |Field Name ||Description |
| 2964 | |`meta_a` |not present when the file is added| |
| 2965 | Meta information about the file on side A as a |
| 2966 | link:#diff-file-meta-info[DiffFileMetaInfo] entity. |
| 2967 | |`meta_b` |not present when the file is deleted| |
| 2968 | Meta information about the file on side B as a |
| 2969 | link:#diff-file-meta-info[DiffFileMetaInfo] entity. |
| 2970 | |`change_type` ||The type of change (`ADDED`, `MODIFIED`, `DELETED`, `RENAMED` |
| 2971 | `COPIED`, `REWRITE`). |
| 2972 | |`intraline_status`|only set when the `intraline` parameter was specified in the request| |
| 2973 | Intraline status (`OK`, `ERROR`, `TIMEOUT`). |
| 2974 | |`diff_header` ||A list of strings representing the patch set diff header. |
| 2975 | |`content` ||The content differences in the file as a list of |
| 2976 | link:#diff-content[DiffContent] entities. |
| 2977 | |========================== |
| 2978 | |
| 2979 | [[diff-intraline-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2980 | === DiffIntralineInfo |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 2981 | The `DiffIntralineInfo` entity contains information about intraline edits in a |
| 2982 | file. |
| 2983 | |
David Pursehouse | 31203f5 | 2013-06-08 17:05:45 +0900 | [diff] [blame] | 2984 | The information consists of a list of `<skip length, mark length>` pairs, where |
| 2985 | the skip length is the number of characters between the end of the previous edit |
| 2986 | and the start of this edit, and the mark length is the number of edited characters |
| 2987 | following the skip. The start of the edits is from the beginning of the related |
| 2988 | diff content lines. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 2989 | |
David Pursehouse | 31203f5 | 2013-06-08 17:05:45 +0900 | [diff] [blame] | 2990 | Note that the implied newline character at the end of each line is included in |
Colby Ranger | 4c29275 | 2013-06-07 11:11:00 -0700 | [diff] [blame] | 2991 | the length calculation, and thus it is possible for the edits to span newlines. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 2992 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2993 | [[fetch-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2994 | === FetchInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2995 | The `FetchInfo` entity contains information about how to fetch a patch |
| 2996 | set via a certain protocol. |
| 2997 | |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 2998 | [options="header",width="50%",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2999 | |========================== |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 3000 | |Field Name ||Description |
| 3001 | |`url` ||The URL of the project. |
| 3002 | |`ref` ||The ref of the patch set. |
| 3003 | |`commands` |optional| |
| 3004 | The download commands for this patch set as a map that maps the command |
| 3005 | names to the commands. + |
| 3006 | Only set if link:#download_commands[download commands] are requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 3007 | |========================== |
| 3008 | |
| 3009 | [[file-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3010 | === FileInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 3011 | The `FileInfo` entity contains information about a file in a patch set. |
| 3012 | |
| 3013 | [options="header",width="50%",cols="1,^1,5"] |
| 3014 | |============================= |
| 3015 | |Field Name ||Description |
| 3016 | |`status` |optional| |
| 3017 | The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed, |
| 3018 | "`C`"=Copied, "`W`"=Rewritten). + |
| 3019 | Not set if the file was Modified ("`M`"). |
| 3020 | |`binary` |not set if `false`|Whether the file is binary. |
| 3021 | |`old_path` |optional| |
| 3022 | The old file path. + |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 3023 | Only set if the file was renamed or copied. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 3024 | |`lines_inserted`|optional| |
| 3025 | Number of inserted lines. + |
| 3026 | Not set for binary files or if no lines were inserted. |
| 3027 | |`lines_deleted` |optional| |
| 3028 | Number of deleted lines. + |
| 3029 | Not set for binary files or if no lines were deleted. |
| 3030 | |============================= |
| 3031 | |
| 3032 | [[git-person-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3033 | === GitPersonInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 3034 | The `GitPersonInfo` entity contains information about the |
| 3035 | author/committer of a commit. |
| 3036 | |
| 3037 | [options="header",width="50%",cols="1,6"] |
| 3038 | |========================== |
| 3039 | |Field Name |Description |
| 3040 | |`name` |The name of the author/committer. |
| 3041 | |`email` |The email address of the author/committer. |
| 3042 | |`date` |The link:rest-api.html#timestamp[timestamp] of when |
| 3043 | this identity was constructed. |
| 3044 | |`tz` |The timezone offset from UTC of when this identity was |
| 3045 | constructed. |
| 3046 | |========================== |
| 3047 | |
| 3048 | [[label-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3049 | === LabelInfo |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 3050 | The `LabelInfo` entity contains information about a label on a change, always |
| 3051 | corresponding to the current patch set. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 3052 | |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 3053 | There are two options that control the contents of `LabelInfo`: |
Dave Borowitz | 7d6aa01 | 2013-06-14 16:53:48 -0700 | [diff] [blame] | 3054 | link:#labels[`LABELS`] and link:#detailed-labels[`DETAILED_LABELS`]. |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 3055 | |
| 3056 | * For a quick summary of the state of labels, use `LABELS`. |
| 3057 | * For detailed information about labels, including exact numeric votes for all |
| 3058 | users and the allowed range of votes for the current user, use `DETAILED_LABELS`. |
| 3059 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3060 | ==== Common fields |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 3061 | [options="header",width="50%",cols="1,^1,5"] |
| 3062 | |=========================== |
| 3063 | |Field Name ||Description |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 3064 | |`optional` |not set if `false`| |
| 3065 | Whether the label is optional. Optional means the label may be set, but |
| 3066 | it's neither necessary for submission nor does it block submission if |
| 3067 | set. |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 3068 | |=========================== |
| 3069 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3070 | ==== Fields set by `LABELS` |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 3071 | [options="header",width="50%",cols="1,^1,5"] |
| 3072 | |=========================== |
| 3073 | |Field Name ||Description |
| 3074 | |`approved` |optional|One user who approved this label on the change |
| 3075 | (voted the maximum value) as an |
| 3076 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 3077 | |`rejected` |optional|One user who rejected this label on the change |
| 3078 | (voted the minimum value) as an |
| 3079 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 3080 | |`recommended` |optional|One user who recommended this label on the |
| 3081 | change (voted positively, but not the maximum value) as an |
| 3082 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 3083 | |`disliked` |optional|One user who disliked this label on the change |
| 3084 | (voted negatively, but not the minimum value) as an |
| 3085 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 3086 | |`value` |optional|The voting value of the user who |
| 3087 | recommended/disliked this label on the change if it is not |
| 3088 | "`+1`"/"`-1`". |
| 3089 | |=========================== |
| 3090 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3091 | ==== Fields set by `DETAILED_LABELS` |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 3092 | [options="header",width="50%",cols="1,^1,5"] |
| 3093 | |=========================== |
| 3094 | |Field Name ||Description |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 3095 | |`all` |optional|List of all approvals for this label as a list |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 3096 | of link:#approval-info[ApprovalInfo] entities. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 3097 | |`values` |optional|A map of all values that are allowed for this |
| 3098 | label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`") |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 3099 | to the value descriptions. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 3100 | |=========================== |
| 3101 | |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 3102 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 3103 | [[restore-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3104 | === RestoreInput |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 3105 | The `RestoreInput` entity contains information for restoring a change. |
| 3106 | |
| 3107 | [options="header",width="50%",cols="1,^1,5"] |
| 3108 | |=========================== |
| 3109 | |Field Name ||Description |
| 3110 | |`message` |optional| |
| 3111 | Message to be added as review comment to the change when restoring the |
| 3112 | change. |
| 3113 | |=========================== |
| 3114 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 3115 | [[revert-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3116 | === RevertInput |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 3117 | The `RevertInput` entity contains information for reverting a change. |
| 3118 | |
| 3119 | [options="header",width="50%",cols="1,^1,5"] |
| 3120 | |=========================== |
| 3121 | |Field Name ||Description |
| 3122 | |`message` |optional| |
| 3123 | Message to be added as review comment to the change when reverting the |
| 3124 | change. |
| 3125 | |=========================== |
| 3126 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 3127 | [[review-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3128 | === ReviewInfo |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 3129 | The `ReviewInfo` entity contains information about a review. |
| 3130 | |
| 3131 | [options="header",width="50%",cols="1,6"] |
| 3132 | |=========================== |
| 3133 | |Field Name |Description |
| 3134 | |`labels` | |
| 3135 | The labels of the review as a map that maps the label names to the |
| 3136 | voting values. |
| 3137 | |=========================== |
| 3138 | |
| 3139 | [[review-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3140 | === ReviewInput |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 3141 | The `ReviewInput` entity contains information for adding a review to a |
| 3142 | revision. |
| 3143 | |
| 3144 | [options="header",width="50%",cols="1,^1,5"] |
| 3145 | |============================ |
| 3146 | |Field Name ||Description |
| 3147 | |`message` |optional| |
| 3148 | The message to be added as review comment. |
| 3149 | |`labels` |optional| |
| 3150 | The votes that should be added to the revision as a map that maps the |
| 3151 | label names to the voting values. |
| 3152 | |`comments` |optional| |
| 3153 | The comments that should be added as a map that maps a file path to a |
| 3154 | list of link:#comment-input[CommentInput] entities. |
| 3155 | |`strict_labels`|`true` if not set| |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 3156 | Whether all labels are required to be within the user's permitted ranges |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 3157 | based on access controls. + |
| 3158 | If `true`, attempting to use a label not granted to the user will fail |
| 3159 | the entire modify operation early. + |
| 3160 | If `false`, the operation will execute anyway, but the proposed labels |
| 3161 | will be modified to be the "best" value allowed by the access controls. |
| 3162 | |`drafts` |optional| |
| 3163 | Draft handling that defines how draft comments are handled that are |
| 3164 | already in the database but that were not also described in this |
| 3165 | input. + |
| 3166 | Allowed values are `DELETE`, `PUBLISH` and `KEEP`. + |
| 3167 | If not set, the default is `DELETE`. |
| 3168 | |`notify` |optional| |
| 3169 | Notify handling that defines to whom email notifications should be sent |
| 3170 | after the review is stored. + |
| 3171 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 3172 | If not set, the default is `ALL`. |
Shawn Pearce | 9d78312 | 2013-06-11 18:18:03 -0700 | [diff] [blame] | 3173 | |`on_behalf_of`|optional| |
| 3174 | link:rest-api-accounts.html#account-id[\{account-id\}] the review |
| 3175 | should be posted on behalf of. To use this option the caller must |
| 3176 | have been granted `labelAs-NAME` permission for all keys of labels. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 3177 | |============================ |
| 3178 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3179 | [[reviewer-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3180 | === ReviewerInfo |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3181 | The `ReviewerInfo` entity contains information about a reviewer and its |
| 3182 | votes on a change. |
| 3183 | |
Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 3184 | `ReviewerInfo` has the same fields as |
| 3185 | link:rest-api-accounts.html#account-info[AccountInfo] and includes |
| 3186 | link:#detailed-accounts[detailed account information]. |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3187 | In addition `ReviewerInfo` has the following fields: |
| 3188 | |
| 3189 | [options="header",width="50%",cols="1,6"] |
| 3190 | |========================== |
| 3191 | |Field Name |Description |
| 3192 | |`kind` |`gerritcodereview#reviewer` |
| 3193 | |`approvals` | |
| 3194 | The approvals of the reviewer as a map that maps the label names to the |
| 3195 | approval values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`"). |
| 3196 | |========================== |
| 3197 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3198 | [[reviewer-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3199 | === ReviewerInput |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3200 | The `ReviewerInput` entity contains information for adding a reviewer |
| 3201 | to a change. |
| 3202 | |
| 3203 | [options="header",width="50%",cols="1,^1,5"] |
| 3204 | |=========================== |
| 3205 | |Field Name ||Description |
| 3206 | |`reviewer` || |
| 3207 | The link:rest-api-accounts.html#account-id[ID] of one account that |
| 3208 | should be added as reviewer or the link:rest-api-groups.html#group-id[ |
| 3209 | ID] of one group for which all members should be added as reviewers. + |
| 3210 | If an ID identifies both an account and a group, only the account is |
| 3211 | added as reviewer to the change. |
| 3212 | |`confirmed` |optional| |
| 3213 | Whether adding the reviewer is confirmed. + |
| 3214 | The Gerrit server may be configured to |
| 3215 | link:config-gerrit.html#addreviewer.maxWithoutConfirmation[require a |
| 3216 | confirmation] when adding a group as reviewer that has many members. |
| 3217 | |=========================== |
| 3218 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 3219 | [[revision-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3220 | === RevisionInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 3221 | The `RevisionInfo` entity contains information about a patch set. |
| 3222 | |
| 3223 | [options="header",width="50%",cols="1,^1,5"] |
| 3224 | |=========================== |
| 3225 | |Field Name ||Description |
| 3226 | |`draft` |not set if `false`|Whether the patch set is a draft. |
David Ostrovsky | 17d0d33 | 2013-09-30 21:36:09 +0200 | [diff] [blame] | 3227 | |`has_draft_comments` |not set if `false`|Whether the patch |
| 3228 | set has one or more draft comments by the calling user. Only set if |
| 3229 | link:#draft_comments[draft comments] is requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 3230 | |`_number` ||The patch set number. |
| 3231 | |`fetch` || |
| 3232 | Information about how to fetch this patch set. The fetch information is |
| 3233 | provided as a map that maps the protocol name ("`git`", "`http`", |
| 3234 | "`ssh`") to link:#fetch-info[FetchInfo] entities. |
Shawn Pearce | 12e5159 | 2013-07-13 22:08:40 -0700 | [diff] [blame] | 3235 | |`commit` |optional|The commit of the patch set as |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 3236 | link:#commit-info[CommitInfo] entity. |
Shawn Pearce | 12e5159 | 2013-07-13 22:08:40 -0700 | [diff] [blame] | 3237 | |`files` |optional| |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 3238 | The files of the patch set as a map that maps the file names to |
| 3239 | link:#file-info[FileInfo] entities. |
Shawn Pearce | 12e5159 | 2013-07-13 22:08:40 -0700 | [diff] [blame] | 3240 | |`actions` |optional| |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 3241 | Actions the caller might be able to perform on this revision. The |
| 3242 | information is a map of view name to link:#action-info[ActionInfo] |
| 3243 | entities. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 3244 | |=========================== |
| 3245 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 3246 | [[rule-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3247 | === RuleInput |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 3248 | The `RuleInput` entity contains information to test a Prolog rule. |
| 3249 | |
| 3250 | [options="header",width="50%",cols="1,^1,5"] |
| 3251 | |=========================== |
| 3252 | |Field Name ||Description |
| 3253 | |`rule`|| |
| 3254 | Prolog code to execute instead of the code in `refs/meta/config`. |
| 3255 | |`filters`|`RUN` if not set| |
| 3256 | When `RUN` filter rules in the parent projects are called to |
| 3257 | post-process the results of the project specific rule. This |
| 3258 | behavior matches how the rule will execute if installed. + |
| 3259 | If `SKIP` the parent filters are not called, allowing the test |
| 3260 | to return results from the input rule. |
| 3261 | |=========================== |
| 3262 | |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3263 | [[suggested-reviewer-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3264 | === SuggestedReviewerInfo |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3265 | The `SuggestedReviewerInfo` entity contains information about a reviewer |
| 3266 | that can be added to a change (an account or a group). |
| 3267 | |
| 3268 | `SuggestedReviewerInfo` has either the `account` field that contains |
| 3269 | the link:rest-api-accounts.html#account-info[AccountInfo] entity, or |
| 3270 | the `group` field that contains the |
| 3271 | link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity. |
| 3272 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 3273 | [[submit-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3274 | === SubmitInfo |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 3275 | The `SubmitInfo` entity contains information about the change status |
| 3276 | after submitting. |
| 3277 | |
| 3278 | [options="header",width="50%",cols="1,6"] |
| 3279 | |========================== |
| 3280 | |Field Name |Description |
| 3281 | |`status` | |
| 3282 | The status of the change after submitting, can be `MERGED` or |
| 3283 | `SUBMITTED`. + |
| 3284 | If `wait_for_merge` in the link:#submit-input[SubmitInput] was set to |
| 3285 | `false` the returned status is `SUBMITTED` and the caller can't know |
| 3286 | whether the change could be merged successfully. |
| 3287 | |========================== |
| 3288 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 3289 | [[submit-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3290 | === SubmitInput |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 3291 | The `SubmitInput` entity contains information for submitting a change. |
| 3292 | |
| 3293 | [options="header",width="50%",cols="1,^1,5"] |
| 3294 | |=========================== |
| 3295 | |Field Name ||Description |
| 3296 | |`wait_for_merge`|`false` if not set| |
| 3297 | Whether the request should wait for the merge to complete. + |
| 3298 | If `false` the request returns immediately after the change has been |
| 3299 | added to the merge queue and the caller can't know whether the change |
| 3300 | could be merged successfully. |
| 3301 | |=========================== |
| 3302 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 3303 | [[submit-record]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3304 | === SubmitRecord |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 3305 | The `SubmitRecord` entity describes results from a submit_rule. |
| 3306 | |
| 3307 | [options="header",width="50%",cols="1,^1,5"] |
| 3308 | |=========================== |
| 3309 | |Field Name ||Description |
| 3310 | |`status`|| |
| 3311 | `OK`, the change can be submitted. + |
| 3312 | `NOT_READY`, additional labels are required before submit. + |
| 3313 | `CLOSED`, closed changes cannot be submitted. + |
| 3314 | `RULE_ERROR`, rule code failed with an error. |
| 3315 | |`ok`|optional| |
Edwin Kempin | fe29b81 | 2013-03-05 14:52:54 +0100 | [diff] [blame] | 3316 | Map of labels that are approved; an |
| 3317 | link:rest-api-accounts.html#account-info[AccountInfo] identifies the |
| 3318 | voter chosen by the rule. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 3319 | |`reject`|optional| |
Edwin Kempin | fe29b81 | 2013-03-05 14:52:54 +0100 | [diff] [blame] | 3320 | Map of labels that are preventing submit; |
| 3321 | link:rest-api-accounts.html#account-info[AccountInfo] identifies voter. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 3322 | |`need`|optional| |
| 3323 | Map of labels that need to be given to submit. The value is |
| 3324 | currently an empty object. |
| 3325 | |`may`|optional| |
| 3326 | Map of labels that can be used, but do not affect submit. |
Edwin Kempin | fe29b81 | 2013-03-05 14:52:54 +0100 | [diff] [blame] | 3327 | link:rest-api-accounts.html#account-info[AccountInfo] identifies voter, |
| 3328 | if the label has been applied. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 3329 | |`impossible`|optional| |
| 3330 | Map of labels that should have been in `need` but cannot be |
| 3331 | used by any user because of access restrictions. The value |
| 3332 | is currently an empty object. |
| 3333 | |`error_message`|optional| |
| 3334 | When status is RULE_ERROR this message provides some text describing |
| 3335 | the failure of the rule predicate. |
| 3336 | |=========================== |
| 3337 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 3338 | [[topic-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3339 | === TopicInput |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 3340 | The `TopicInput` entity contains information for setting a topic. |
| 3341 | |
| 3342 | [options="header",width="50%",cols="1,^1,5"] |
| 3343 | |=========================== |
| 3344 | |Field Name ||Description |
| 3345 | |`topic` |optional|The topic. + |
| 3346 | The topic will be deleted if not set. |
| 3347 | |`message` |optional| |
| 3348 | Message to be added as review comment to the change when setting the |
| 3349 | topic. |
| 3350 | |=========================== |
| 3351 | |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 3352 | [[included-in-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3353 | === IncludedInInfo |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 3354 | The `IncludedInInfo` entity contains information about the branches a |
| 3355 | change was merged into and tags it was tagged with. |
| 3356 | |
| 3357 | [options="header",width="50%",cols="1,6"] |
| 3358 | |========================== |
| 3359 | |Field Name |Description |
| 3360 | |`kind` |`gerritcodereview#includedininfo` |
| 3361 | |`branches` | The list of branches this change was merged into. |
| 3362 | Each branch is listed without the 'refs/head/' prefix. |
| 3363 | |`tags` | The list of tags this change was tagged with. |
| 3364 | Each tag is listed without the 'refs/tags/' prefix. |
| 3365 | |========================== |
| 3366 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 3367 | |
| 3368 | GERRIT |
| 3369 | ------ |
| 3370 | Part of link:index.html[Gerrit Code Review] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 3371 | |
| 3372 | SEARCHBOX |
| 3373 | --------- |