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