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