blob: 750bb2ac53ccba8fbe5054e80cc7ac8ee3ae70f8 [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= Gerrit Code Review - /changes/ REST API
Edwin Kempind0a63922013-01-23 16:32:59 +01002
3This page describes the change related REST endpoints.
4Please also take note of the general information on the
5link:rest-api.html[REST API].
6
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01007[[change-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008== Change Endpoints
Edwin Kempind0a63922013-01-23 16:32:59 +01009
David Ostrovsky837c0ee2014-04-27 12:54:20 +020010[[create-change]]
11=== Create Change
12--
13'POST /changes'
14--
15
16The change info link:#change-info[ChangeInfo] entity must be provided in the
17request body. Only the following attributes are honored: `project`,
18`branch`, `subject`, `status` and `topic`. The first three attributes are
19mandatory. 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
35As response a link:#change-info[ChangeInfo] entity is returned that describes
36the 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 Ostrovsky837c0ee2014-04-27 12:54:20 +020046 "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 Kempin76202742013-02-15 13:51:50 +010066[[list-changes]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080067=== Query Changes
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080068--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010069'GET /changes/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080070--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010071
Saša Živkovdd804022014-06-23 16:44:03 +020072Queries changes visible to the caller. The
73link:user-search.html#_search_operators[query string] must be provided
74by the `q` parameter. The `n` parameter can be used to limit the
75returned results.
Edwin Kempind0a63922013-01-23 16:32:59 +010076
Edwin Kempine3446292013-02-19 16:40:14 +010077As result a list of link:#change-info[ChangeInfo] entries is returned.
78The change output is sorted by the last update time, most recently
79updated to oldest updated.
80
Edwin Kempind0a63922013-01-23 16:32:59 +010081Query for open changes of watched projects:
Edwin Kempin37440832013-02-06 11:36:00 +010082
83.Request
Edwin Kempind0a63922013-01-23 16:32:59 +010084----
Edwin Kempin2091edb2013-01-23 19:07:38 +010085 GET /changes/?q=status:open+is:watched&n=2 HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +010086----
Edwin Kempind0a63922013-01-23 16:32:59 +010087
Edwin Kempin37440832013-02-06 11:36:00 +010088.Response
89----
Edwin Kempind0a63922013-01-23 16:32:59 +010090 HTTP/1.1 200 OK
91 Content-Disposition: attachment
92 Content-Type: application/json;charset=UTF-8
93
94 )]}'
John Spurlockd25fad12013-03-09 11:48:49 -050095 [
96 {
John Spurlockd25fad12013-03-09 11:48:49 -050097 "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 Spurlockd25fad12013-03-09 11:48:49 -0500105 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100106 "insertions": 26,
107 "deletions": 10,
John Spurlockd25fad12013-03-09 11:48:49 -0500108 "_sortkey": "001e7057000006dc",
109 "_number": 1756,
110 "owner": {
111 "name": "John Doe"
112 },
Edwin Kempind0a63922013-01-23 16:32:59 +0100113 },
John Spurlockd25fad12013-03-09 11:48:49 -0500114 {
John Spurlockd25fad12013-03-09 11:48:49 -0500115 "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 Kempina6b6eaf2013-11-23 11:05:58 +0100124 "insertions": 12,
125 "deletions": 18,
John Spurlockd25fad12013-03-09 11:48:49 -0500126 "_sortkey": "001e7056000006dd",
127 "_number": 1757,
128 "owner": {
129 "name": "John Doe"
130 },
131 "_more_changes": true
132 }
133 ]
Edwin Kempind0a63922013-01-23 16:32:59 +0100134----
135
Edwin Kempind0a63922013-01-23 16:32:59 +0100136If the `n` query parameter is supplied and additional changes exist
137that match the query beyond the end, the last change object has a
David Pursehouse025ea3e2014-09-03 10:47:34 +0900138`_more_changes: true` JSON field set.
139
140The `S` or `start` query parameter can be supplied to skip a number
141of changes from the list.
Edwin Kempind0a63922013-01-23 16:32:59 +0100142
143Clients are allowed to specify more than one query by setting the `q`
144parameter multiple times. In this case the result is an array of
145arrays, one per query in the same order the queries were given in.
146
Edwin Kempina64c4b92013-01-23 11:30:40 +0100147.Query for the 25 most recent open changes of the projects that you watch
148****
149get::/changes/?q=status:open+is:watched&n=25
150****
151
Edwin Kempind0a63922013-01-23 16:32:59 +0100152Query that retrieves changes for a user's dashboard:
Edwin Kempin37440832013-02-06 11:36:00 +0100153
154.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100155----
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 Kempin37440832013-02-06 11:36:00 +0100157----
Edwin Kempind0a63922013-01-23 16:32:59 +0100158
Edwin Kempin37440832013-02-06 11:36:00 +0100159.Response
160----
Edwin Kempind0a63922013-01-23 16:32:59 +0100161 HTTP/1.1 200 OK
162 Content-Disposition: attachment
163 Content-Type: application/json;charset=UTF-8
164
165 )]}'
166 [
167 [
168 {
Edwin Kempind0a63922013-01-23 16:32:59 +0100169 "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 Kempindb1f0b82013-02-21 15:07:00 +0100177 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100178 "insertions": 4,
179 "deletions": 7,
Edwin Kempind0a63922013-01-23 16:32:59 +0100180 "_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 Kempina64c4b92013-01-23 11:30:40 +0100196.Query the changes for your user dashboard
197****
198get::/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 Kempind0a63922013-01-23 16:32:59 +0100201Additional fields can be obtained by adding `o` parameters, each
202option requires more database lookups and slows down the query
203response time to the client so they are generally disabled by
204default. Optional fields are:
205
Edwin Kempine3446292013-02-19 16:40:14 +0100206[[labels]]
207--
Edwin Kempind0a63922013-01-23 16:32:59 +0100208* `LABELS`: a summary of each label required for submit, and
209 approvers that have granted (or rejected) with that label.
Edwin Kempine3446292013-02-19 16:40:14 +0100210--
Edwin Kempind0a63922013-01-23 16:32:59 +0100211
Edwin Kempine3446292013-02-19 16:40:14 +0100212[[detailed-labels]]
213--
Dave Borowitz4c7231a2013-01-30 16:18:59 -0800214* `DETAILED_LABELS`: detailed label information, including numeric
Dave Borowitz992ddd72013-02-13 11:53:17 -0800215 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 Kempine3446292013-02-19 16:40:14 +0100218--
Dave Borowitz4c7231a2013-01-30 16:18:59 -0800219
Edwin Kempine3446292013-02-19 16:40:14 +0100220[[current-revision]]
221--
Edwin Kempind0a63922013-01-23 16:32:59 +0100222* `CURRENT_REVISION`: describe the current revision (patch set)
223 of the change, including the commit SHA-1 and URLs to fetch from.
Edwin Kempine3446292013-02-19 16:40:14 +0100224--
Edwin Kempind0a63922013-01-23 16:32:59 +0100225
Edwin Kempine3446292013-02-19 16:40:14 +0100226[[all-revisions]]
227--
Edwin Kempind0a63922013-01-23 16:32:59 +0100228* `ALL_REVISIONS`: describe all revisions, not just current.
Edwin Kempine3446292013-02-19 16:40:14 +0100229--
Edwin Kempind0a63922013-01-23 16:32:59 +0100230
Edwin Kempinea621482013-10-16 12:58:24 +0200231[[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 Ostrovsky17d0d332013-09-30 21:36:09 +0200238[[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 Borowitz685bad92013-10-03 11:24:07 -0700243--
David Ostrovsky17d0d332013-09-30 21:36:09 +0200244
Edwin Kempine3446292013-02-19 16:40:14 +0100245[[current-commit]]
246--
Edwin Kempind0a63922013-01-23 16:32:59 +0100247* `CURRENT_COMMIT`: parse and output all header fields from the
David Pursehouse98006e82013-10-02 10:15:52 +0900248 commit object, including message. Only valid when the
249 `CURRENT_REVISION` or `ALL_REVISIONS` option is selected.
Edwin Kempine3446292013-02-19 16:40:14 +0100250--
Edwin Kempind0a63922013-01-23 16:32:59 +0100251
Edwin Kempine3446292013-02-19 16:40:14 +0100252[[all-commits]]
253--
Edwin Kempind0a63922013-01-23 16:32:59 +0100254* `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 Kempine3446292013-02-19 16:40:14 +0100257--
Edwin Kempind0a63922013-01-23 16:32:59 +0100258
Edwin Kempine3446292013-02-19 16:40:14 +0100259[[current-files]]
260--
Edwin Kempind0a63922013-01-23 16:32:59 +0100261* `CURRENT_FILES`: list files modified by the commit, including
262 basic line counts inserted/deleted per file. Only valid when
David Pursehouse98006e82013-10-02 10:15:52 +0900263 the `CURRENT_REVISION` or `ALL_REVISIONS` option is selected.
Edwin Kempine3446292013-02-19 16:40:14 +0100264--
Edwin Kempind0a63922013-01-23 16:32:59 +0100265
Edwin Kempine3446292013-02-19 16:40:14 +0100266[[all-files]]
267--
Edwin Kempind0a63922013-01-23 16:32:59 +0100268* `ALL_FILES`: list files modified by the commit, including
269 basic line counts inserted/deleted per file. If only the
David Pursehouse98006e82013-10-02 10:15:52 +0900270 `CURRENT_REVISION` was requested then only that commit's
Edwin Kempind0a63922013-01-23 16:32:59 +0100271 modified files will be output.
Edwin Kempine3446292013-02-19 16:40:14 +0100272--
Edwin Kempind0a63922013-01-23 16:32:59 +0100273
Edwin Kempine3446292013-02-19 16:40:14 +0100274[[detailed-accounts]]
275--
Edwin Kempin4a00e222013-10-16 14:34:24 +0200276* `DETAILED_ACCOUNTS`: include `_account_id`, `email` and `username`
277 fields when referencing accounts.
Edwin Kempine3446292013-02-19 16:40:14 +0100278--
Dave Borowitz8926a882013-02-01 14:32:48 -0800279
John Spurlock74a70cc2013-03-23 16:41:50 -0400280[[messages]]
281--
282* `MESSAGES`: include messages associated with the change.
283--
284
Shawn Pearcedc4a9b22013-07-12 10:54:38 -0700285[[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 Pearce414c5ff2013-09-06 21:51:02 -0700292[[reviewed]]
293--
294* `REVIEWED`: include the `reviewed` field if the caller is
295 authenticated and has commented on the current revision.
296--
297
Khai Do2a23ec82014-09-19 16:33:02 -0700298[[web-links]]
Sven Selbergae1a10c2014-02-14 14:24:29 +0100299--
Khai Do2a23ec82014-09-19 16:33:02 -0700300* `WEB_LINKS`: include the `web_links` field.
Sven Selbergae1a10c2014-02-14 14:24:29 +0100301--
302
Dave Borowitz4c46c242014-12-03 16:46:45 -0800303[[check]]
304--
305* `CHECK`: include potential problems with the change.
306--
307
Edwin Kempin37440832013-02-06 11:36:00 +0100308.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100309----
Edwin Kempinea621482013-10-16 12:58:24 +0200310 GET /changes/?q=97&o=CURRENT_REVISION&o=CURRENT_COMMIT&o=CURRENT_FILES&o=DOWNLOAD_COMMANDS HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +0100311----
Edwin Kempind0a63922013-01-23 16:32:59 +0100312
Edwin Kempin37440832013-02-06 11:36:00 +0100313.Response
314----
Edwin Kempind0a63922013-01-23 16:32:59 +0100315 HTTP/1.1 200 OK
316 Content-Disposition: attachment
317 Content-Type: application/json;charset=UTF-8
318
319 )]}'
320 [
321 {
David Pursehousec3be6ad2014-07-18 12:03:06 +0900322 "id": "gerrit~master~I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a",
Edwin Kempind0a63922013-01-23 16:32:59 +0100323 "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 Kempindb1f0b82013-02-21 15:07:00 +0100330 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100331 "insertions": 16,
332 "deletions": 7,
Edwin Kempind0a63922013-01-23 16:32:59 +0100333 "_sortkey": "001c9bf400000061",
334 "_number": 97,
335 "owner": {
336 "name": "Shawn Pearce"
337 },
338 "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c",
339 "revisions": {
340 "184ebe53805e102605d11f6b143486d15c23a09c": {
341 "_number": 1,
Edwin Kempin4569ced2014-11-25 16:45:05 +0100342 "ref": "refs/changes/97/97/1",
Edwin Kempind0a63922013-01-23 16:32:59 +0100343 "fetch": {
344 "git": {
345 "url": "git://localhost/gerrit",
Edwin Kempinea621482013-10-16 12:58:24 +0200346 "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 Kempind0a63922013-01-23 16:32:59 +0100353 },
354 "http": {
Edwin Kempinea621482013-10-16 12:58:24 +0200355 "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 Kempind0a63922013-01-23 16:32:59 +0100373 }
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 Kempinff9e6e32013-02-21 13:07:11 +0100430[[get-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800431=== Get Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800432--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100433'GET /changes/link:#change-id[\{change-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800434--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100435
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100436Retrieves a change.
437
Dave Borowitz0314f732013-10-03 09:34:30 -0700438Additional fields can be obtained by adding `o` parameters, each
439option requires more database lookups and slows down the query
440response time to the client so they are generally disabled by
441default. Fields are described in link:#list-changes[Query Changes].
442
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100443.Request
444----
445 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
446----
447
448As response a link:#change-info[ChangeInfo] entity is returned that
449describes 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 Kempinff9e6e32013-02-21 13:07:11 +0100459 "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 Kempinff9e6e32013-02-21 13:07:11 +0100467 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100468 "insertions": 34,
469 "deletions": 101,
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100470 "_sortkey": "0023412400000f7d",
471 "_number": 3965,
472 "owner": {
473 "name": "John Doe"
474 }
475 }
476----
477
Edwin Kempin8e492202013-02-21 15:38:25 +0100478[[get-change-detail]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800479=== Get Change Detail
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800480--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100481'GET /changes/link:#change-id[\{change-id\}]/detail'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800482--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100483
Edwin Kempin8e492202013-02-21 15:38:25 +0100484Retrieves a change with link:#labels[labels], link:#detailed-labels[
John Spurlock74a70cc2013-03-23 16:41:50 -0400485detailed labels], link:#detailed-accounts[detailed accounts], and
486link:#messages[messages].
Edwin Kempin8e492202013-02-21 15:38:25 +0100487
Shawn Pearce7f3dccf2013-07-06 19:24:29 -0700488Additional fields can be obtained by adding `o` parameters, each
489option requires more database lookups and slows down the query
490response time to the client so they are generally disabled by
491default. Fields are described in link:#list-changes[Query Changes].
492
Edwin Kempin8e492202013-02-21 15:38:25 +0100493.Request
494----
495 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/detail HTTP/1.0
496----
497
498As response a link:#change-info[ChangeInfo] entity is returned that
Khai Doad632012014-06-22 08:29:57 -0700499describes the change. This response will contain all votes for each
500label and include one combined vote. The combined label vote is
501calculated in the following order (from highest to lowest):
502REJECTED > APPROVED > DISLIKED > RECOMMENDED.
Edwin Kempin8e492202013-02-21 15:38:25 +0100503
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 Kempin8e492202013-02-21 15:38:25 +0100512 "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 Kempin8e492202013-02-21 15:38:25 +0100520 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100521 "insertions": 126,
522 "deletions": 11,
Edwin Kempin8e492202013-02-21 15:38:25 +0100523 "_sortkey": "0023412400000f7d",
524 "_number": 3965,
525 "owner": {
526 "_account_id": 1000096,
527 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200528 "email": "john.doe@example.com",
529 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100530 },
531 "labels": {
532 "Verified": {
533 "all": [
534 {
535 "value": 0,
536 "_account_id": 1000096,
537 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200538 "email": "john.doe@example.com",
539 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100540 },
541 {
542 "value": 0,
543 "_account_id": 1000097,
544 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200545 "email": "jane.roe@example.com",
546 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100547 }
548 ],
549 "values": {
550 "-1": "Fails",
551 " 0": "No score",
552 "+1": "Verified"
553 }
554 },
555 "Code-Review": {
Edwin Kempin8e492202013-02-21 15:38:25 +0100556 "disliked": {
557 "_account_id": 1000096,
558 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200559 "email": "john.doe@example.com",
560 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100561 },
562 "all": [
563 {
564 "value": -1,
565 "_account_id": 1000096,
566 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200567 "email": "john.doe@example.com",
568 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100569 },
570 {
571 "value": 1,
572 "_account_id": 1000097,
573 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200574 "email": "jane.roe@example.com",
575 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100576 }
577 ]
578 "values": {
Paul Fertser2474e522014-01-23 10:00:59 +0400579 "-2": "This shall not be merged",
580 "-1": "I would prefer this is not merged as is",
Edwin Kempin8e492202013-02-21 15:38:25 +0100581 " 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 Kempin65886f02013-10-16 15:03:17 +0200605 "email": "john.doe@example.com",
606 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100607 },
608 {
609 "_account_id": 1000097,
610 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200611 "email": "jane.roe@example.com",
612 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100613 }
John Spurlock74a70cc2013-03-23 16:41:50 -0400614 ],
615 "messages": [
616 {
617 "id": "YH-egE",
618 "author": {
619 "_account_id": 1000096,
620 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200621 "email": "john.doe@example.com",
622 "username": "jdoe"
John Spurlock74a70cc2013-03-23 16:41:50 -0400623 },
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 Kempin65886f02013-10-16 15:03:17 +0200633 "email": "jane.roe@example.com",
634 "username": "jroe"
John Spurlock74a70cc2013-03-23 16:41:50 -0400635 },
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 Kempin8e492202013-02-21 15:38:25 +0100640 ]
641 }
642----
643
Edwin Kempin64006bb2013-02-22 08:17:04 +0100644[[get-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800645=== Get Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800646--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100647'GET /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800648--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100649
Edwin Kempin64006bb2013-02-22 08:17:04 +0100650Retrieves 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
667If the change does not have a topic an empty string is returned.
668
669[[set-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800670=== Set Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800671--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100672'PUT /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800673--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100674
Edwin Kempin64006bb2013-02-22 08:17:04 +0100675Sets the topic of a change.
676
677The new topic must be provided in the request body inside a
678link:#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
690As 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
702If the topic was deleted the response is "`204 No Content`".
703
704[[delete-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800705=== Delete Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800706--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100707'DELETE /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800708--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100709
Edwin Kempin64006bb2013-02-22 08:17:04 +0100710Deletes the topic of a change.
711
712The request body does not need to include a link:#topic-input[
713TopicInput] entity if no review comment is added.
714
715Please note that some proxies prohibit request bodies for DELETE
716requests. In this case, if you want to specify a commit message, use
717link:#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 Kempined5364b2013-02-22 10:39:33 +0100729[[abandon-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800730=== Abandon Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800731--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100732'POST /changes/link:#change-id[\{change-id\}]/abandon'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800733--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100734
Edwin Kempined5364b2013-02-22 10:39:33 +0100735Abandons a change.
736
737The request body does not need to include a link:#abandon-input[
738AbandonInput] entity if no review comment is added.
739
740.Request
741----
742 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/abandon HTTP/1.0
743----
744
745As response a link:#change-info[ChangeInfo] entity is returned that
746describes 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 Kempined5364b2013-02-22 10:39:33 +0100756 "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 Kempined5364b2013-02-22 10:39:33 +0100764 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100765 "insertions": 3,
766 "deletions": 310,
Edwin Kempined5364b2013-02-22 10:39:33 +0100767 "_sortkey": "0023412400000f7d",
768 "_number": 3965,
769 "owner": {
770 "name": "John Doe"
771 }
772 }
773----
774
775If the change cannot be abandoned because the change state doesn't
776allow abandoning of the change, the response is "`409 Conflict`" and
777the 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' Wang61698b12013-12-20 12:55:51 -0800789=== Restore Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800790--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100791'POST /changes/link:#change-id[\{change-id\}]/restore'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800792--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100793
Edwin Kempined5364b2013-02-22 10:39:33 +0100794Restores a change.
795
796The request body does not need to include a link:#restore-input[
797RestoreInput] entity if no review comment is added.
798
799.Request
800----
801 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/restore HTTP/1.0
802----
803
804As response a link:#change-info[ChangeInfo] entity is returned that
805describes 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 Kempined5364b2013-02-22 10:39:33 +0100815 "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 Kempined5364b2013-02-22 10:39:33 +0100823 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100824 "insertions": 2,
825 "deletions": 13,
Edwin Kempined5364b2013-02-22 10:39:33 +0100826 "_sortkey": "0023412400000f7d",
827 "_number": 3965,
828 "owner": {
829 "name": "John Doe"
830 }
831 }
832----
833
834If the change cannot be restored because the change state doesn't
835allow restoring the change, the response is "`409 Conflict`" and
836the 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 Kempincdae63b2013-03-15 15:06:59 +0100847[[rebase-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800848=== Rebase Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800849--
Edwin Kempincdae63b2013-03-15 15:06:59 +0100850'POST /changes/link:#change-id[\{change-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800851--
Edwin Kempincdae63b2013-03-15 15:06:59 +0100852
853Rebases a change.
854
855.Request
856----
857 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/rebase HTTP/1.0
858----
859
860As response a link:#change-info[ChangeInfo] entity is returned that
861describes the rebased change. Information about the current patch set
862is 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 Kempincdae63b2013-03-15 15:06:59 +0100872 "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 Kempina6b6eaf2013-11-23 11:05:58 +0100881 "insertions": 33,
882 "deletions": 9,
Edwin Kempincdae63b2013-03-15 15:06:59 +0100883 "_sortkey": "0024cf9a000012bf",
884 "_number": 4799,
885 "owner": {
886 "name": "John Doe"
887 },
888 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
889 "revisions": {
890 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
891 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +0100892 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +0100893 "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
925If 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
927body.
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 Kempind2ec4152013-02-22 12:17:19 +0100938[[revert-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800939=== Revert Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800940--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100941'POST /changes/link:#change-id[\{change-id\}]/revert'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800942--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100943
Edwin Kempind2ec4152013-02-22 12:17:19 +0100944Reverts a change.
945
946The request body does not need to include a link:#revert-input[
947RevertInput] entity if no review comment is added.
948
949.Request
950----
951 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revert HTTP/1.0
952----
953
954As response a link:#change-info[ChangeInfo] entity is returned that
955describes 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 Kempind2ec4152013-02-22 12:17:19 +0100965 "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 Kempind2ec4152013-02-22 12:17:19 +0100973 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100974 "insertions": 6,
975 "deletions": 4,
Edwin Kempind2ec4152013-02-22 12:17:19 +0100976 "_sortkey": "0023412400000f7d",
977 "_number": 3965,
978 "owner": {
979 "name": "John Doe"
980 }
981 }
982----
983
984If the change cannot be reverted because the change state doesn't
985allow reverting the change, the response is "`409 Conflict`" and
986the 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 Kempin0eddba02013-02-22 15:30:12 +0100997[[submit-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800998=== Submit Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800999--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001000'POST /changes/link:#change-id[\{change-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001001--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001002
Edwin Kempin0eddba02013-02-22 15:30:12 +01001003Submits a change.
1004
1005The request body only needs to include a link:#submit-input[
1006SubmitInput] entity if the request should wait for the merge to
1007complete.
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
1019As response a link:#change-info[ChangeInfo] entity is returned that
1020describes 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 Kempin0eddba02013-02-22 15:30:12 +01001030 "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 Kempin0eddba02013-02-22 15:30:12 +01001038 "_sortkey": "0023412400000f7d",
1039 "_number": 3965,
1040 "owner": {
1041 "name": "John Doe"
1042 }
1043 }
1044----
1045
1046If the change cannot be submitted because the submit rule doesn't allow
1047submitting the change, the response is "`409 Conflict`" and the error
1048message 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 Ostrovsky0d69c232013-09-10 23:10:23 +02001059[[publish-draft-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001060=== Publish Draft Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001061--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001062'POST /changes/link:#change-id[\{change-id\}]/publish'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001063--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001064
1065Publishes 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' Wang61698b12013-12-20 12:55:51 -08001079=== Delete Draft Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001080--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001081'DELETE /changes/link:#change-id[\{change-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001082--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001083
1084Deletes 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 Ostrovsky83e8aee2013-09-30 22:37:26 +02001097[[get-included-in]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001098=== Get Included In
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001099--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001100'GET /changes/link:#change-id[\{change-id\}]/in'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001101--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001102
1103Retrieves the branches and tags in which a change is included. As result
1104an 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 Ostrovsky83e8aee2013-09-30 22:37:26 +02001119 "branches": [
1120 "master"
1121 ],
1122 "tags": []
1123 }
1124----
1125
David Pursehouse4e38b972014-05-30 10:36:40 +09001126[[index-change]]
1127=== Index Change
1128--
1129'POST /changes/link:#change-id[\{change-id\}]/index'
1130--
1131
1132Adds 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 Borowitzfd508ca2014-11-06 15:24:04 -08001144[[check-change]]
1145=== Check change
1146--
1147'GET /changes/link:#change-id[\{change-id\}]/check'
1148--
1149
1150Performs consistency checks on the change, and returns a
Dave Borowitz5c894d42014-11-25 17:43:06 -05001151link:#change-info[ChangeInfo] entity with the `problems` field set to a
1152list of link:#problem-info[ProblemInfo] entities.
1153
1154Depending on the type of problem, some fields not marked optional may be
1155missing from the result. At least `id`, `project`, `branch`, and
1156`_number` will be present.
Dave Borowitzfd508ca2014-11-06 15:24:04 -08001157
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 Borowitz5c894d42014-11-25 17:43:06 -05001171 "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 Borowitzfd508ca2014-11-06 15:24:04 -08001186 },
Dave Borowitz5c894d42014-11-25 17:43:06 -05001187 "problems": [
1188 {
1189 "message": "Current patch set 1 not found"
1190 }
Dave Borowitzfd508ca2014-11-06 15:24:04 -08001191 ]
1192 }
1193----
1194
Dave Borowitz3be39d02014-12-03 17:57:38 -08001195[[fix-change]]
1196=== Fix change
1197--
1198'POST /changes/link:#change-id[\{change-id\}]/check'
1199--
1200
1201Performs consistency checks on the change as with link:#check-change[GET
1202/check], and additionally fixes any problems that can be fixed
1203automatically. The returned field values reflect any fixes.
1204
1205Only 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 Ostrovsky1a49f622014-07-29 00:40:02 +02001249[[edit-endpoints]]
1250== Change Edit Endpoints
1251
1252These endpoints are considered to be unstable and can be changed in
1253backwards 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
1261Retrieves a change edit details.
1262
1263.Request
1264----
1265 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
1266----
1267
1268As response an link:#edit-info[EditInfo] entity is returned that
1269describes the change edit, or "`204 No Content`" when change edit doesn't
1270exist for this change. Change edits are stored on special branches and there
1271can be max one edit per user per change. Edits aren't tracked in the database.
David Ostrovsky5d98e342014-08-01 09:23:28 +02001272When request parameter `list` is provided the response also includes the file
1273list. When `base` request parameter is provided the file list is computed
David Ostrovsky5562fe52014-08-12 22:36:27 +02001274against this base revision. When request parameter `download-commands` is
1275provided fetch info map is also included.
David Ostrovsky1a49f622014-07-29 00:40:02 +02001276
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 Pursehouse4e38b972014-05-30 10:36:40 +09001308
David Ostrovskya5ab8292014-08-01 02:11:39 +02001309[[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
1315Put 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
1322When change edit doesn't exist for this change yet it is created. When file
1323content 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 Ostrovsky138edb42014-08-15 21:31:43 +02001331[[post-edit]]
1332=== Restore file content in Change Edit
1333--
1334'POST /changes/link:#change-id[\{change-id\}]/edit
1335--
1336
1337Creates empty change edit or restores file content in change edit. The
1338request body needs to include a link:#change-edit-input[ChangeEditInput]
1339entity 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 Ostrovskybd12e172014-08-21 23:08:15 +02001347 "restore_path": "foo"
David Ostrovsky138edb42014-08-15 21:31:43 +02001348 }
1349----
1350
1351When change edit doesn't exist for this change yet it is created. When path
1352and restore flag are provided in request body, this file is restored. As
1353response "`204 No Content`" is returned.
1354
1355.Response
1356----
1357 HTTP/1.1 204 No Content
1358----
1359
David Ostrovskyc967e152014-10-24 17:36:16 +02001360[[put-change-edit-message]]
1361=== Change commit message in Change Edit
1362--
1363'PUT /changes/link:#change-id[\{change-id\}]/edit:message
1364--
1365
1366Modify commit message. The request body needs to include a
1367link:#change-edit-message-input[ChangeEditMessageInput]
1368entity.
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
1380If a change edit doesn't exist for this change yet, it is created. As
1381response "`204 No Content`" is returned.
1382
1383.Response
1384----
1385 HTTP/1.1 204 No Content
1386----
1387
David Ostrovsky2830c292014-08-01 02:24:31 +02001388[[delete-edit-file]]
1389=== Delete file in Change Edit
1390--
1391'DELETE /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile'
1392--
1393
1394Deletes a file from a change edit. This deletes the file from the repository
1395completely. This is not the same as reverting or restoring a file to its
1396previous contents.
1397
1398.Request
1399----
1400 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
1401----
1402
1403When 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 Ostrovskyfd6c1752014-08-01 19:43:21 +02001410[[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
1416Retrieves 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
1423The content of the file is returned as text encoded inside base64. When
1424specified 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 Ostrovskyb75de182014-11-13 22:05:06 +01001436[[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
1442Retrieves 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 Ostrovsky3d2c0702014-10-28 23:44:27 +01001459[[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 Ostrovsky25ad15e2014-12-15 21:18:59 +01001465Retrieves commit message from change edit.
David Ostrovsky3d2c0702014-10-28 23:44:27 +01001466
1467.Request
1468----
1469 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
1470----
1471
1472The commit message is returned as base64 encoded string.
1473
1474.Response
1475----
1476 HTTP/1.1 200 OK
1477
1478 VGhpcyBpcyBhIGNvbW1pdCBtZXNzYWdlCgpDaGFuZ2UtSWQ6IElhYzhmZGM1MGRlZjFiYWUzYjAz
1479M2JhNjcxZTk0OTBmNzUxNDU5ZGUzCg==
1480----
1481
David Ostrovskye9988f92014-08-01 09:56:34 +02001482[[publish-edit]]
1483=== Publish Change Edit
1484--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01001485'POST /changes/link:#change-id[\{change-id\}]/edit:publish
David Ostrovskye9988f92014-08-01 09:56:34 +02001486--
1487
1488Promotes change edit to a regular patch set.
1489
1490.Request
1491----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01001492 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:publish HTTP/1.0
David Ostrovskye9988f92014-08-01 09:56:34 +02001493----
1494
1495As response "`204 No Content`" is returned.
1496
1497.Response
1498----
1499 HTTP/1.1 204 No Content
1500----
1501
David Ostrovsky46999d22014-08-16 02:19:13 +02001502[[rebase-edit]]
1503=== Rebase Change Edit
1504--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01001505'POST /changes/link:#change-id[\{change-id\}]/edit:rebase
David Ostrovsky46999d22014-08-16 02:19:13 +02001506--
1507
1508Rebases change edit on top of latest patch set.
1509
1510.Request
1511----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01001512 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:rebase HTTP/1.0
David Ostrovsky46999d22014-08-16 02:19:13 +02001513----
1514
1515When change was rebased on top of latest patch set, response
1516"`204 No Content`" is returned. When change edit is aready
1517based 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 Ostrovsky8e75f502014-08-10 00:36:31 +02001525[[delete-edit]]
1526=== Delete Change Edit
1527--
1528'DELETE /changes/link:#change-id[\{change-id\}]/edit'
1529--
1530
1531Deletes change edit.
1532
1533.Request
1534----
1535 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
1536----
1537
1538As response "`204 No Content`" is returned.
1539
1540.Response
1541----
1542 HTTP/1.1 204 No Content
1543----
1544
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01001545[[reviewer-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001546== Reviewer Endpoints
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01001547
1548[[list-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001549=== List Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001550--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001551'GET /changes/link:#change-id[\{change-id\}]/reviewers/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001552--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001553
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01001554Lists the reviewers of a change.
1555
1556As 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 Kempin1dbe19e2013-02-22 16:18:58 +01001572 "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 Kempin1dbe19e2013-02-22 16:18:58 +01001581 "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 Ostrovsky8c5f80a2013-09-02 20:22:39 +02001592[[suggest-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001593=== Suggest Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001594--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02001595'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001596--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02001597
1598Suggest the reviewers for a given query `q` and result limit `n`. If result
1599limit is not passed, then the default 10 is used.
1600
1601As 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 Ostrovsky8c5f80a2013-09-02 20:22:39 +02001617 "account": {
1618 "_account_id": 1000097,
1619 "name": "Jane Roe",
1620 "email": "jane.roe@example.com"
1621 }
1622 },
1623 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02001624 "group": {
1625 "id": "4fd581c0657268f2bdcc26699fbf9ddb76e3a279",
1626 "name": "Joiner"
1627 }
1628 }
1629 ]
1630----
1631
Edwin Kempina3d02ef2013-02-22 16:31:53 +01001632[[get-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001633=== Get Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001634--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001635'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001636--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001637
Edwin Kempina3d02ef2013-02-22 16:31:53 +01001638Retrieves a reviewer of a change.
1639
1640As response a link:#reviewer-info[ReviewerInfo] entity is returned that
1641describes 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 Kempina3d02ef2013-02-22 16:31:53 +01001656 "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 Kempin392328e2013-02-25 12:50:03 +01001666[[add-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001667=== Add Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001668--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001669'POST /changes/link:#change-id[\{change-id\}]/reviewers'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001670--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001671
Edwin Kempin392328e2013-02-25 12:50:03 +01001672Adds one user or all members of one group as reviewer to the change.
1673
1674The reviewer to be added to the change must be provided in the request
1675body 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
1687As response an link:#add-reviewer-result[AddReviewerResult] entity is
1688returned 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 Kempin392328e2013-02-25 12:50:03 +01001700 "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
1712If a group is specified, adding the group members as reviewers is an
1713atomic operation. This means if an error is returned, none of the
1714members are added as reviewer.
1715
1716If a group with many members is added as reviewer a confirmation may be
1717required.
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
1742To confirm the addition of the reviewers, resend the request with the
Edwin Kempin08da43d2013-02-26 11:06:58 +01001743`confirmed` flag being set.
Edwin Kempin392328e2013-02-25 12:50:03 +01001744
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 Kempin08da43d2013-02-26 11:06:58 +01001752 "confirmed": true
Edwin Kempin392328e2013-02-25 12:50:03 +01001753 }
1754----
1755
Edwin Kempin53301072013-02-25 12:57:07 +01001756[[delete-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001757=== Delete Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001758--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001759'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001760--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001761
Edwin Kempin53301072013-02-25 12:57:07 +01001762Deletes 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 Kempinda6e5fa2013-02-25 14:48:12 +01001774[[revision-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001775== Revision Endpoints
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01001776
Shawn Pearce728ba882013-07-08 23:13:08 -07001777[[get-commit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001778=== Get Commit
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001779--
Shawn Pearce728ba882013-07-08 23:13:08 -07001780'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/commit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001781--
Shawn Pearce728ba882013-07-08 23:13:08 -07001782
1783Retrieves a parsed commit of a revision.
1784
1785.Request
1786----
1787 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/commit HTTP/1.0
1788----
1789
1790As response a link:#commit-info[CommitInfo] entity is returned that
1791describes 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 Pearce728ba882013-07-08 23:13:08 -07001801 "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 Kempinda6e5fa2013-02-25 14:48:12 +01001825[[get-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001826=== Get Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001827--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001828'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001829--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001830
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01001831Retrieves a review of a revision.
1832
1833.Request
1834----
1835 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
1836----
1837
1838As response a link:#change-info[ChangeInfo] entity with
1839link:#detailed-labels[detailed labels] and link:#detailed-accounts[
1840detailed accounts] is returned that describes the review of the
1841revision. The revision for which the review is retrieved is contained
1842in the `revisions` field. In addition the `current_revision` field is
John Spurlockd25fad12013-03-09 11:48:49 -05001843set if the revision for which the review is retrieved is the current
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01001844revision of the change. Please note that the returned labels are always
1845for 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 Kempinda6e5fa2013-02-25 14:48:12 +01001855 "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 Kempinda6e5fa2013-02-25 14:48:12 +01001863 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001864 "insertions": 34,
1865 "deletions": 45,
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01001866 "_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 Fertser2474e522014-01-23 10:00:59 +04001911 "-2": "This shall not be merged",
1912 "-1": "I would prefer this is not merged as is",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01001913 " 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 Kempin4569ced2014-11-25 16:45:05 +01001949 "ref": "refs/changes/65/3965/2",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01001950 "fetch": {
1951 "http": {
1952 "url": "http://gerrit/myProject",
1953 "ref": "refs/changes/65/3965/2"
1954 }
1955 }
1956 }
1957 }
1958----
1959
David Pursehouse669f2512014-07-18 11:41:42 +09001960[[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
1966Retrieves related changes of a revision. Related changes are changes that either
1967depend 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
1974As result a link:#related-changes-info[RelatedChangesInfo] entity is returned
1975describing 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 Kempin67498de2013-02-25 16:15:34 +01002033[[set-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002034=== Set Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002035--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002036'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002037--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002038
Edwin Kempin67498de2013-02-25 16:15:34 +01002039Sets a review on a revision.
2040
2041The review must be provided in the request body as a
2042link:#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 Pursehouseb53c1f62014-08-26 14:51:33 +09002063 },
2064 {
2065 "range": {
2066 "start_line": 50,
2067 "start_character": 0,
2068 "end_line": 55,
2069 "end_character": 20
2070 },
David Pursehouseb53c1f62014-08-26 14:51:33 +09002071 "message": "Incorrect indentation"
Edwin Kempin67498de2013-02-25 16:15:34 +01002072 }
2073 ]
2074 }
2075 }
2076----
2077
2078As response a link:#review-info[ReviewInfo] entity is returned that
2079describes 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 Kempincdae63b2013-03-15 15:06:59 +01002095[[rebase-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002096=== Rebase Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002097--
Edwin Kempincdae63b2013-03-15 15:06:59 +01002098'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002099--
Edwin Kempincdae63b2013-03-15 15:06:59 +01002100
2101Rebases a revision.
2102
2103.Request
2104----
2105 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/rebase HTTP/1.0
2106----
2107
2108As response a link:#change-info[ChangeInfo] entity is returned that
2109describes the rebased change. Information about the current patch set
2110is 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 Kempincdae63b2013-03-15 15:06:59 +01002120 "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 Kempina6b6eaf2013-11-23 11:05:58 +01002129 "insertions": 21,
2130 "deletions": 21,
Edwin Kempincdae63b2013-03-15 15:06:59 +01002131 "_sortkey": "0024cf9a000012bf",
2132 "_number": 4799,
2133 "owner": {
2134 "name": "John Doe"
2135 },
2136 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
2137 "revisions": {
2138 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
2139 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01002140 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +01002141 "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
2173If 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
2175body.
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 Kempin14b58112013-02-26 16:30:19 +01002186[[submit-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002187=== Submit Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002188--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002189'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002190--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002191
Edwin Kempin14b58112013-02-26 16:30:19 +01002192Submits a revision.
2193
2194The request body only needs to include a link:#submit-input[
2195SubmitInput] entity if the request should wait for the merge to
2196complete.
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
2208As response a link:#submit-info[SubmitInfo] entity is returned that
2209describes 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
2223If the revision cannot be submitted, e.g. because the submit rule
2224doesn't allow submitting the revision or the revision is not the
2225current revision, the response is "`409 Conflict`" and the error
2226message 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 Ostrovsky0d69c232013-09-10 23:10:23 +02002236[[publish-draft-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002237=== Publish Draft Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002238--
David Ostrovsky0d69c232013-09-10 23:10:23 +02002239'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/publish'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002240--
David Ostrovsky0d69c232013-09-10 23:10:23 +02002241
2242Publishes 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' Wang61698b12013-12-20 12:55:51 -08002256=== Delete Draft Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002257--
David Ostrovsky0d69c232013-09-10 23:10:23 +02002258'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002259--
David Ostrovsky0d69c232013-09-10 23:10:23 +02002260
2261Deletes 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 Kempin257d70f2013-03-28 14:31:14 +01002274[[get-patch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002275=== Get Patch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002276--
Edwin Kempin257d70f2013-03-28 14:31:14 +01002277'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/patch'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002278--
Edwin Kempin257d70f2013-03-28 14:31:14 +01002279
2280Gets 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 Pearce98361f72013-05-10 16:27:36 -07002287The formatted patch is returned as text encoded inside base64:
Edwin Kempin257d70f2013-03-28 14:31:14 +01002288
2289.Response
2290----
2291 HTTP/1.1 200 OK
2292 Content-Disposition: attachment
Shawn Pearce98361f72013-05-10 16:27:36 -07002293 Content-Type: text/plain;charset=ISO-8859-1
2294 X-FYI-Content-Encoding: base64
2295 X-FYI-Content-Type: application/mbox
Edwin Kempin257d70f2013-03-28 14:31:14 +01002296
Shawn Pearce98361f72013-05-10 16:27:36 -07002297 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
Edwin Kempin257d70f2013-03-28 14:31:14 +01002298----
2299
David Ostrovsky973f38b2013-08-22 00:24:51 -07002300Adding query parameter `zip` (for example `/changes/.../patch?zip`)
2301returns the patch as a single file inside of a ZIP archive. Clients
2302can expand the ZIP to obtain the plain text patch, avoiding the
2303need for a base64 decoding step. This option implies `download`.
2304
2305Query parameter `download` (e.g. `/changes/.../patch?download`)
2306will suggest the browser save the patch as `commitsha1.diff.base64`,
2307for later processing by command line tools.
2308
Shawn Pearce3a2a2472013-07-17 16:40:45 -07002309[[get-mergeable]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002310=== Get Mergeable
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002311--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07002312'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergeable'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002313--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07002314
2315Gets the method the server will use to submit (merge) the change and
2316an 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 Živkov499873f2014-05-05 13:34:18 +02002323As response a link:#mergeable-info[MergeableInfo] entity is returned.
2324
Shawn Pearce3a2a2472013-07-17 16:40:45 -07002325.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 Živkov697cab22014-04-29 16:46:50 +02002338If the `other-branches` parameter is specified, the mergeability will also be
2339checked for all other branches.
2340
2341.Request
2342----
2343 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable?other-branches HTTP/1.0
2344----
2345
2346The response will then contain a list of all other branches where this changes
2347could 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 Kempin50d3d9b2013-03-06 16:38:26 +01002366[[get-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002367=== Get Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002368--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002369'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002370--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002371
Shawn Pearceb1f730b2013-03-04 07:54:09 -08002372Gets 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' Wang61698b12013-12-20 12:55:51 -08002390=== Test Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002391--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002392'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002393--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002394
Shawn Pearceb1f730b2013-03-04 07:54:09 -08002395Tests the submit_type Prolog rule in the project, or the one given.
2396
2397Request body may be either the Prolog code as `text/plain` or a
2398link:#rule-input[RuleInput] object. The query parameter `filters`
2399may be set to `SKIP` to bypass parent project filters while testing
2400a 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 Pearce7076f4e2013-08-20 22:11:51 -07002417 "CHERRY_PICK"
Shawn Pearceb1f730b2013-03-04 07:54:09 -08002418----
2419
2420[[test-submit-rule]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002421=== Test Submit Rule
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002422--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002423'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_rule'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002424--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002425
Shawn Pearceb1f730b2013-03-04 07:54:09 -08002426Tests the submit_rule Prolog rule in the project, or the one given.
2427
2428Request body may be either the Prolog code as `text/plain` or a
2429link:#rule-input[RuleInput] object. The query parameter `filters`
2430may be set to `SKIP` to bypass parent project filters while testing
2431a project-specific rule.
2432
2433.Request
2434----
Shawn Pearcea3cce712014-03-21 08:16:11 -07002435 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_rule?filters=SKIP HTTP/1.0
Shawn Pearceb1f730b2013-03-04 07:54:09 -08002436 Content-Type: text/plain;charset-UTF-8
2437
2438 submit_rule(submit(R)) :-
2439 R = label('Any-Label-Name', reject(_)).
2440----
2441
2442The response is a list of link:#submit-record[SubmitRecord] entries
2443describing 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 Kempincb6724a2013-02-26 16:58:51 +01002462[[list-drafts]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002463=== List Drafts
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002464--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002465'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002466--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002467
Edwin Kempin3ca57192013-02-27 07:44:01 +01002468Lists the draft comments of a revision that belong to the calling
Edwin Kempincb6724a2013-02-26 16:58:51 +01002469user.
2470
2471As result a map is returned that maps the file path to a list of
2472link:#comment-info[CommentInfo] entries. The entries in the map are
2473sorted 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 Kempincb6724a2013-02-26 16:58:51 +01002490 "id": "TvcXrmjM",
2491 "line": 23,
2492 "message": "[nit] trailing whitespace",
2493 "updated": "2013-02-26 15:40:43.986000000"
2494 },
2495 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01002496 "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 Kempin7faf41e2013-02-27 08:17:02 +01002506[[create-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002507=== Create Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002508--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002509'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002510--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002511
Edwin Kempin7faf41e2013-02-27 08:17:02 +01002512Creates a draft comment on a revision.
2513
2514The new draft comment must be provided in the request body inside a
2515link:#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
2529As response a link:#comment-info[CommentInfo] entity is returned that
2530describes 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 Kempin7faf41e2013-02-27 08:17:02 +01002540 "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 Kempin3ca57192013-02-27 07:44:01 +01002548[[get-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002549=== Get Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002550--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002551'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/link:#draft-id[\{draft-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002552--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002553
Edwin Kempin3ca57192013-02-27 07:44:01 +01002554Retrieves a draft comment of a revision that belongs to the calling
2555user.
2556
2557.Request
2558----
2559 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
2560----
2561
2562As response a link:#comment-info[CommentInfo] entity is returned that
2563describes 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 Kempin3ca57192013-02-27 07:44:01 +01002573 "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 Kempin7faf41e2013-02-27 08:17:02 +01002581[[update-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002582=== Update Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002583--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002584'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/link:#draft-id[\{draft-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002585--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002586
Edwin Kempin7faf41e2013-02-27 08:17:02 +01002587Updates a draft comment on a revision.
2588
2589The new draft comment must be provided in the request body inside a
2590link:#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
2604As response a link:#comment-info[CommentInfo] entity is returned that
2605describes 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 Kempin7faf41e2013-02-27 08:17:02 +01002615 "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' Wang61698b12013-12-20 12:55:51 -08002624=== Delete Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002625--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002626'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/link:#draft-id[\{draft-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002627--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002628
Edwin Kempin7faf41e2013-02-27 08:17:02 +01002629Deletes 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 Spurlock5e402f02013-03-24 11:35:04 -04002641[[list-comments]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002642=== List Comments
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002643--
John Spurlock5e402f02013-03-24 11:35:04 -04002644'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002645--
John Spurlock5e402f02013-03-24 11:35:04 -04002646
2647Lists the published comments of a revision.
2648
2649As result a map is returned that maps the file path to a list of
2650link:#comment-info[CommentInfo] entries. The entries in the map are
Khai Do23845a12014-06-02 11:28:16 -07002651sorted by file path and only include file (or inline) comments. Use
2652the link:#get-change-detail[Get Change Detail] endpoint to retrieve
2653the general change message (or comment).
John Spurlock5e402f02013-03-24 11:35:04 -04002654
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 Spurlock5e402f02013-03-24 11:35:04 -04002670 "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 Spurlock5e402f02013-03-24 11:35:04 -04002681 "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' Wang61698b12013-12-20 12:55:51 -08002697=== Get Comment
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002698--
John Spurlock5e402f02013-03-24 11:35:04 -04002699'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002700--
John Spurlock5e402f02013-03-24 11:35:04 -04002701
2702Retrieves 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
2709As response a link:#comment-info[CommentInfo] entity is returned that
2710describes 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 Spurlock5e402f02013-03-24 11:35:04 -04002720 "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 Kempin682ac712013-05-14 13:40:46 +02002733[[list-files]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002734=== List Files
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002735--
Edwin Kempin682ac712013-05-14 13:40:46 +02002736'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002737--
Edwin Kempin682ac712013-05-14 13:40:46 +02002738
2739Lists 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
2746As result a map is returned that maps the file path to a list of
2747link:#file-info[FileInfo] entries. The entries in the map are
2748sorted 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 Pearce984747d2013-07-18 00:42:16 -07002769The request parameter `reviewed` changes the response to return a list
2770of the paths the caller has marked as reviewed. Clients that also
2771need 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 Kempinaef44b02013-05-07 16:15:55 +02002791[[get-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002792=== Get Content
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002793--
Edwin Kempinbea55a52013-05-14 13:53:39 +02002794'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/content'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002795--
Edwin Kempinaef44b02013-05-07 16:15:55 +02002796
2797Gets 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
2804The 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 Ostrovsky88b27672014-11-13 22:25:39 +01002815[[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
2821Gets 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 Pursehouse4cd92502014-12-15 18:10:32 +09002828The content MIME type is returned as string. The content type for the commit
2829message (`/COMMIT_MSG`) is always returned as "text/plain".
David Ostrovsky88b27672014-11-13 22:25:39 +01002830
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 Pursehouse882aef22013-06-05 10:56:37 +09002841[[get-diff]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002842=== Get Diff
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002843--
David Pursehouse882aef22013-06-05 10:56:37 +09002844'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/diff'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002845--
David Pursehouse882aef22013-06-05 10:56:37 +09002846
2847Gets 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
2854As 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 Pearced62a6a92013-12-05 12:45:32 -08002866 "content_type": "text/x-java-source",
2867 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09002868 },
2869 "meta_b": {
2870 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08002871 "content_type": "text/x-java-source",
2872 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09002873 },
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
2919If 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 Pearced62a6a92013-12-05 12:45:32 -08002936 "content_type": "text/x-java-source",
2937 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09002938 },
2939 "meta_b": {
2940 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08002941 "content_type": "text/x-java-source",
2942 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09002943 },
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
2972The `base` parameter can be specified to control the base patch set from which the diff should
2973be generated.
2974
Edwin Kempin8cdce502014-12-06 10:55:38 +01002975[[weblinks-only]]
2976If the `weblinks-only` parameter is specified, only the diff web links are returned.
2977
David Pursehouse882aef22013-06-05 10:56:37 +09002978.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 Pearced62a6a92013-12-05 12:45:32 -08002993 "content_type": "text/x-java-source",
2994 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09002995 },
2996 "meta_b": {
2997 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08002998 "content_type": "text/x-java-source",
2999 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09003000 },
3001 "change_type": "MODIFIED",
3002 "content": [
3003 {
3004 "skip": 578
3005 }
3006 ]
3007 }
3008----
3009
3010The `ignore-whitespace` parameter can be specified to control how whitespace differences are
3011reported in the result. Valid values are `NONE`, `TRAILING`, `CHANGED` or `ALL`.
3012
3013The `context` parameter can be specified to control the number of lines of surrounding context
3014in the diff. Valid values are `ALL` or number of lines.
3015
Edwin Kempin9300e4c2013-02-27 08:42:06 +01003016[[set-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003017=== Set Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003018--
Edwin Kempinbea55a52013-05-14 13:53:39 +02003019'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/reviewed'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003020--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003021
Edwin Kempinbea55a52013-05-14 13:53:39 +02003022Marks a file of a revision as reviewed by the calling user.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01003023
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 Kempinbea55a52013-05-14 13:53:39 +02003034If the file was already marked as reviewed by the calling user the
Edwin Kempin9300e4c2013-02-27 08:42:06 +01003035response is "`200 OK`".
3036
3037[[delete-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003038=== Delete Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003039--
Edwin Kempinbea55a52013-05-14 13:53:39 +02003040'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/reviewed'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003041--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003042
Edwin Kempinbea55a52013-05-14 13:53:39 +02003043Deletes the reviewed flag of the calling user from a file of a revision.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01003044
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 Lundh019fb262012-11-28 14:20:22 +01003055[[cherry-pick]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003056=== Cherry Pick Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003057--
Gustaf Lundh019fb262012-11-28 14:20:22 +01003058'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/cherrypick'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003059--
Gustaf Lundh019fb262012-11-28 14:20:22 +01003060
3061Cherry picks a revision to a destination branch.
3062
3063The commit message and destination branch must be provided in the request body inside a
3064link:#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 Lundh98df5b52013-05-07 19:22:13 +01003072 "message" : "Implementing Feature X",
3073 "destination" : "release-branch"
Gustaf Lundh019fb262012-11-28 14:20:22 +01003074 }
3075----
3076
3077As response a link:#change-info[ChangeInfo] entity is returned that
3078describes 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 Lundh019fb262012-11-28 14:20:22 +01003088 "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 Lundh019fb262012-11-28 14:20:22 +01003096 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01003097 "insertions": 12,
3098 "deletions": 11,
Gustaf Lundh019fb262012-11-28 14:20:22 +01003099 "_sortkey": "0023412400000f7d",
3100 "_number": 3965,
3101 "owner": {
3102 "name": "John Doe"
3103 }
3104 }
3105----
Edwin Kempinff9e6e32013-02-21 13:07:11 +01003106
David Ostrovskyae15e0502013-08-19 08:06:07 +02003107[[message]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003108=== Edit Commit Message
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003109--
David Ostrovskyae15e0502013-08-19 08:06:07 +02003110'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/message'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003111--
David Ostrovskyae15e0502013-08-19 08:06:07 +02003112
David Ostrovsky65b2c4e2014-10-29 00:14:21 +01003113Edit commit message. *Warning*: as of Gerrit 2.11 this REST endpoint is
3114deprecated and will be removed in a future version.
3115Use link:#put-change-edit-message[put commit message] and
3116link:#publish-edit[publish edit] instead.
David Ostrovskyae15e0502013-08-19 08:06:07 +02003117
3118The commit message must be provided in the request body inside a
3119link:#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
3131As response a link:#change-info[ChangeInfo] entity is returned that
3132describes 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 Ostrovskyae15e0502013-08-19 08:06:07 +02003142 "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 Ostrovskyae15e0502013-08-19 08:06:07 +02003150 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01003151 "insertions": 261,
3152 "deletions": 101,
David Ostrovskyae15e0502013-08-19 08:06:07 +02003153 "_sortkey": "0023412400000f7d",
3154 "_number": 3965,
3155 "owner": {
3156 "name": "John Doe"
3157 }
3158 }
3159----
3160
Edwin Kempinff9e6e32013-02-21 13:07:11 +01003161[[ids]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003162== IDs
Edwin Kempinff9e6e32013-02-21 13:07:11 +01003163
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003164[[account-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003165=== link:rest-api-accounts.html#account-id[\{account-id\}]
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003166--
3167--
3168
Edwin Kempinff9e6e32013-02-21 13:07:11 +01003169[[change-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003170=== \{change-id\}
Edwin Kempinff9e6e32013-02-21 13:07:11 +01003171Identifier that uniquely identifies one change.
3172
3173This 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 Spurlock5e402f02013-03-24 11:35:04 -04003182[[comment-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003183=== \{comment-id\}
John Spurlock5e402f02013-03-24 11:35:04 -04003184UUID of a published comment.
3185
Edwin Kempin3ca57192013-02-27 07:44:01 +01003186[[draft-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003187=== \{draft-id\}
Edwin Kempin3ca57192013-02-27 07:44:01 +01003188UUID of a draft comment.
Edwin Kempinff9e6e32013-02-21 13:07:11 +01003189
Edwin Kempinbea55a52013-05-14 13:53:39 +02003190[[file-id]]
3191\{file-id\}
Edwin Kempin9300e4c2013-02-27 08:42:06 +01003192~~~~~~~~~~~~
Edwin Kempinbea55a52013-05-14 13:53:39 +02003193The path of the file.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01003194
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003195[[revision-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003196=== \{revision-id\}
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003197Identifier that uniquely identifies one revision of a change.
3198
3199This can be:
3200
Shawn Pearce9c0722a2013-03-02 15:30:31 -08003201* the literal `current` to name the current patch set/revision
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003202* 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 Kempine3446292013-02-19 16:40:14 +01003207[[json-entities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003208== JSON Entities
Edwin Kempine3446292013-02-19 16:40:14 +01003209
Edwin Kempined5364b2013-02-22 10:39:33 +01003210[[abandon-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003211=== AbandonInput
Edwin Kempined5364b2013-02-22 10:39:33 +01003212The `AbandonInput` entity contains information for abandoning a change.
3213
David Pursehouseae367192014-11-25 17:24:47 +09003214[options="header",cols="1,^1,5"]
Edwin Kempined5364b2013-02-22 10:39:33 +01003215|===========================
3216|Field Name ||Description
3217|`message` |optional|
3218Message to be added as review comment to the change when abandoning the
3219change.
3220|===========================
3221
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07003222[[action-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003223=== ActionInfo
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07003224The `ActionInfo` entity describes a REST API call the client can
3225make to manipulate a resource. These are frequently implemented by
3226plugins and may be discovered at runtime.
3227
David Pursehouseae367192014-11-25 17:24:47 +09003228[options="header",cols="1,^1,5"]
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07003229|====================================
3230|Field Name ||Description
3231|`method` |optional|
3232HTTP method to use with the action. Most actions use `POST`, `PUT`
3233or `DELETE` to cause state changes.
3234|`label` |optional|
3235Short title to display to a user describing the action. In the
3236Gerrit web interface the label is used as the text on the button
3237presented in the UI.
3238|`title` |optional|
3239Longer text to display describing the action. In a web UI this
3240should be the title attribute of the element, displaying when
3241the user hovers the mouse.
3242|`enabled` |optional|
3243If true the action is permitted at this time and the caller is
3244likely allowed to execute it. This may change if state is updated
3245at the server or permissions are modified. Not present if false.
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07003246|====================================
3247
Edwin Kempin392328e2013-02-25 12:50:03 +01003248[[add-reviewer-result]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003249=== AddReviewerResult
Edwin Kempin392328e2013-02-25 12:50:03 +01003250The `AddReviewerResult` entity describes the result of adding a
3251reviewer to a change.
3252
David Pursehouseae367192014-11-25 17:24:47 +09003253[options="header",cols="1,^1,5"]
Edwin Kempin392328e2013-02-25 12:50:03 +01003254|===========================
3255|Field Name ||Description
3256|`reviewers` |optional|
3257The newly added reviewers as a list of link:#reviewer-info[
3258ReviewerInfo] entities.
3259|`error` |optional|
3260Error message explaining why the reviewer could not be added. +
3261If a group was specified in the input and an error is returned, it
3262means that none of the members were added as reviewer.
3263|`confirm` |`false` if not set|
3264Whether adding the reviewer requires confirmation.
3265|===========================
3266
Edwin Kempine3446292013-02-19 16:40:14 +01003267[[approval-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003268=== ApprovalInfo
Edwin Kempine3446292013-02-19 16:40:14 +01003269The `ApprovalInfo` entity contains information about an approval from a
3270user for a label on a change.
3271
Edwin Kempin963dfd02013-02-27 12:39:32 +01003272`ApprovalInfo` has the same fields as
3273link:rest-api-accounts.html#account-info[AccountInfo].
Edwin Kempine3446292013-02-19 16:40:14 +01003274In addition `ApprovalInfo` has the following fields:
3275
David Pursehouseae367192014-11-25 17:24:47 +09003276[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01003277|===========================
3278|Field Name ||Description
Dave Borowitza30db912013-03-22 14:20:33 -07003279|`value` |optional|
3280The vote that the user has given for the label. If present and zero, the
3281user is permitted to vote on the label. If absent, the user is not
3282permitted to vote on that label.
Gustaf Lundh2e07d5022013-05-08 17:07:42 +01003283|`date` |optional|
3284The time and date describing when the approval was made.
Edwin Kempine3446292013-02-19 16:40:14 +01003285|===========================
3286
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003287[[group-base-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003288=== GroupBaseInfo
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003289The `GroupBaseInfo` entity contains base information about the group.
3290
David Pursehouseae367192014-11-25 17:24:47 +09003291[options="header",cols="1,6"]
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003292|==========================
3293|Field Name |Description
3294|`id` |The id of the group.
3295|`name` |The name of the group.
3296|==========================
3297
Edwin Kempine3446292013-02-19 16:40:14 +01003298[[change-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003299=== ChangeInfo
Edwin Kempine3446292013-02-19 16:40:14 +01003300The `ChangeInfo` entity contains information about a change.
3301
David Pursehouseae367192014-11-25 17:24:47 +09003302[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01003303|==================================
3304|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01003305|`id` ||
3306The ID of the change in the format "'<project>\~<branch>~<Change-Id>'",
John Spurlockd25fad12013-03-09 11:48:49 -05003307where 'project', 'branch' and 'Change-Id' are URL encoded. For 'branch' the
Edwin Kempine3446292013-02-19 16:40:14 +01003308`refs/heads/` prefix is omitted.
3309|`project` ||The name of the project.
3310|`branch` ||
3311The name of the target branch. +
3312The `refs/heads/` prefix is omitted.
Edwin Kempincd6c01a12013-02-21 14:58:52 +01003313|`topic` |optional|The topic to which this change belongs.
Edwin Kempine3446292013-02-19 16:40:14 +01003314|`change_id` ||The Change-Id of the change.
3315|`subject` ||
3316The subject of the change (header line of the commit message).
3317|`status` ||
3318The status of the change (`NEW`, `SUBMITTED`, `MERGED`, `ABANDONED`,
3319`DRAFT`).
3320|`created` ||
3321The link:rest-api.html#timestamp[timestamp] of when the change was
3322created.
3323|`updated` ||
3324The link:rest-api.html#timestamp[timestamp] of when the change was last
3325updated.
3326|`starred` |not set if `false`|
3327Whether the calling user has starred this change.
3328|`reviewed` |not set if `false`|
3329Whether the change was reviewed by the calling user.
Shawn Pearce414c5ff2013-09-06 21:51:02 -07003330Only set if link:#reviewed[reviewed] is requested.
Edwin Kempinbaf70e12013-02-27 10:36:13 +01003331|`mergeable` |optional|
3332Whether the change is mergeable. +
Dave Borowitze5fbeeb2014-06-27 09:47:49 -07003333Not set for merged changes, or if the change has not yet been tested.
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01003334|`insertions` ||
3335Number of inserted lines.
3336|`deletions` ||
3337Number of deleted lines.
Edwin Kempine3446292013-02-19 16:40:14 +01003338|`_sortkey` ||The sortkey of the change.
3339|`_number` ||The legacy numeric ID of the change.
3340|`owner` ||
Edwin Kempin963dfd02013-02-27 12:39:32 +01003341The owner of the change as an link:rest-api-accounts.html#account-info[
3342AccountInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07003343|`actions` |optional|
3344Actions the caller might be able to perform on this revision. The
3345information is a map of view name to link:#action-info[ActionInfo]
3346entities.
Edwin Kempine3446292013-02-19 16:40:14 +01003347|`labels` |optional|
3348The labels of the change as a map that maps the label names to
3349link:#label-info[LabelInfo] entries. +
3350Only set if link:#labels[labels] or link:#detailed-labels[detailed
3351labels] are requested.
3352|`permitted_labels` |optional|
3353A map of the permitted labels that maps a label name to the list of
3354values that are allowed for that label. +
3355Only set if link:#detailed-labels[detailed labels] are requested.
3356|`removable_reviewers`|optional|
3357The reviewers that can be removed by the calling user as a list of
Edwin Kempin963dfd02013-02-27 12:39:32 +01003358link:rest-api-accounts.html#account-info[AccountInfo] entities. +
Edwin Kempine3446292013-02-19 16:40:14 +01003359Only set if link:#detailed-labels[detailed labels] are requested.
John Spurlock74a70cc2013-03-23 16:41:50 -04003360|`messages`|optional|
Shawn Pearce414c5ff2013-09-06 21:51:02 -07003361Messages associated with the change as a list of
John Spurlock74a70cc2013-03-23 16:41:50 -04003362link:#change-message-info[ChangeMessageInfo] entities. +
3363Only set if link:#messages[messages] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01003364|`current_revision` |optional|
3365The commit ID of the current patch set of this change. +
3366Only set if link:#current-revision[the current revision] is requested
3367or if link:#all-revisions[all revisions] are requested.
3368|`revisions` |optional|
John Spurlockd25fad12013-03-09 11:48:49 -05003369All patch sets of this change as a map that maps the commit ID of the
Edwin Kempine3446292013-02-19 16:40:14 +01003370patch set to a link:#revision-info[RevisionInfo] entity. +
Dave Borowitz0adf2702014-01-22 10:41:52 -08003371Only 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
3373if link:#all-revisions[all revisions] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01003374|`_more_changes` |optional, not set if `false`|
3375Whether the query would deliver more results if not limited. +
3376Only set on either the last or the first change that is returned.
Dave Borowitz5c894d42014-11-25 17:43:06 -05003377|`problems` |optional|
3378A list of link:#problem-info[ProblemInfo] entities describing potential
Dave Borowitz4c46c242014-12-03 16:46:45 -08003379problems with this change. Only set if link:#check[CHECK] is set.
Edwin Kempine3446292013-02-19 16:40:14 +01003380|==================================
3381
David Pursehouse669f2512014-07-18 11:41:42 +09003382[[related-changes-info]]
3383=== RelatedChangesInfo
3384The `RelatedChangesInfo` entity contains information about related
3385changes.
3386
David Pursehouseae367192014-11-25 17:24:47 +09003387[options="header",cols="1,6"]
David Pursehouse669f2512014-07-18 11:41:42 +09003388|===========================
3389|Field Name |Description
3390|`changes` |A list of
3391link:#related-change-and-commit-info[RelatedChangeAndCommitInfo] entities
3392describing the related changes. Sorted by git commit order, newest to
3393oldest. Empty if there are no related changes.
3394|===========================
3395
3396[[related-change-and-commit-info]]
3397=== RelatedChangeAndCommitInfo
3398
3399The `RelatedChangeAndCommitInfo` entity contains information about
3400a related change and commit.
3401
David Pursehouseae367192014-11-25 17:24:47 +09003402[options="header",cols="1,^1,5"]
David Pursehouse669f2512014-07-18 11:41:42 +09003403|===========================
3404|Field Name ||Description
3405|`change_id` |optional|The Change-Id of the change.
3406|`commit` ||The commit as a
3407link:#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 Spurlock74a70cc2013-03-23 16:41:50 -04003413[[change-message-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003414=== ChangeMessageInfo
John Spurlock74a70cc2013-03-23 16:41:50 -04003415The `ChangeMessageInfo` entity contains information about a message
3416attached to a change.
3417
David Pursehouseae367192014-11-25 17:24:47 +09003418[options="header",cols="1,^1,5"]
John Spurlock74a70cc2013-03-23 16:41:50 -04003419|==================================
3420|Field Name ||Description
3421|`id` ||The ID of the message.
3422|`author` |optional|
Khai Do23845a12014-06-02 11:28:16 -07003423Author of the message as an
John Spurlock74a70cc2013-03-23 16:41:50 -04003424link:rest-api-accounts.html#account-info[AccountInfo] entity. +
3425Unset if written by the Gerrit system.
3426|`date` ||
3427The link:rest-api.html#timestamp[timestamp] this message was posted.
3428|`message` ||The text left by the user.
3429|`_revision_number` |optional|
3430Which patchset (if any) generated this message.
3431|==================================
3432
Gustaf Lundh019fb262012-11-28 14:20:22 +01003433[[cherrypick-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003434=== CherryPickInput
Gustaf Lundh019fb262012-11-28 14:20:22 +01003435The `CherryPickInput` entity contains information for cherry-picking a change to a new branch.
3436
David Pursehouseae367192014-11-25 17:24:47 +09003437[options="header",cols="1,6"]
Gustaf Lundh019fb262012-11-28 14:20:22 +01003438|===========================
3439|Field Name |Description
3440|`message` |Commit message for the cherry-picked change
David Ostrovsky9345ebc2014-04-28 23:19:55 +02003441|`destination` |Destination branch
Gustaf Lundh019fb262012-11-28 14:20:22 +01003442|===========================
3443
Edwin Kempincb6724a2013-02-26 16:58:51 +01003444[[comment-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003445=== CommentInfo
John Spurlockd25fad12013-03-09 11:48:49 -05003446The `CommentInfo` entity contains information about an inline comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01003447
David Pursehouseae367192014-11-25 17:24:47 +09003448[options="header",cols="1,^1,5"]
Edwin Kempincb6724a2013-02-26 16:58:51 +01003449|===========================
3450|Field Name ||Description
John Spurlock5e402f02013-03-24 11:35:04 -04003451|`id` ||The URL encoded UUID of the comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01003452|`path` |optional|
3453The path of the file for which the inline comment was done. +
3454Not set if returned in a map where the key is the file path.
3455|`side` |optional|
3456The side on which the comment was added. +
3457Allowed values are `REVISION` and `PARENT`. +
3458If not set, the default is `REVISION`.
3459|`line` |optional|
3460The number of the line for which the comment was done. +
Michael Zhou596c7682013-08-25 05:43:34 -04003461If range is set, this equals the end line of the range. +
3462If neither line nor range is set, it's a file comment.
3463|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09003464The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04003465entity.
Edwin Kempincb6724a2013-02-26 16:58:51 +01003466|`in_reply_to` |optional|
3467The URL encoded UUID of the comment to which this comment is a reply.
3468|`message` |optional|The comment message.
3469|`updated` ||
3470The link:rest-api.html#timestamp[timestamp] of when this comment was
3471written.
John Spurlock5e402f02013-03-24 11:35:04 -04003472|`author` |optional|
David Pursehousec633a572013-08-26 14:01:59 +09003473The author of the message as an
John Spurlock5e402f02013-03-24 11:35:04 -04003474link:rest-api-accounts.html#account-info[AccountInfo] entity. +
3475Unset for draft comments, assumed to be the calling user.
Edwin Kempincb6724a2013-02-26 16:58:51 +01003476|===========================
3477
Edwin Kempin67498de2013-02-25 16:15:34 +01003478[[comment-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003479=== CommentInput
Orgad Shanehc99da3a2014-06-13 14:57:54 +03003480The `CommentInput` entity contains information for creating an inline
Edwin Kempin67498de2013-02-25 16:15:34 +01003481comment.
3482
David Pursehouseae367192014-11-25 17:24:47 +09003483[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01003484|===========================
3485|Field Name ||Description
3486|`id` |optional|
Edwin Kempinc09826d72013-02-26 16:10:39 +01003487The URL encoded UUID of the comment if an existing draft comment should
3488be updated.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003489|`path` |optional|
3490The path of the file for which the inline comment should be added. +
3491Doesn't need to be set if contained in a map where the key is the file
3492path.
Edwin Kempin67498de2013-02-25 16:15:34 +01003493|`side` |optional|
3494The side on which the comment should be added. +
3495Allowed values are `REVISION` and `PARENT`. +
3496If not set, the default is `REVISION`.
3497|`line` |optional|
3498The number of the line for which the comment should be added. +
3499`0` if it is a file comment. +
Michael Zhou596c7682013-08-25 05:43:34 -04003500If neither line nor range is set, a file comment is added. +
David Pursehouse4a159a12014-08-26 15:45:14 +09003501If range is set, this value is ignored in favor of the `end_line` of the range.
Michael Zhou596c7682013-08-25 05:43:34 -04003502|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09003503The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04003504entity.
Edwin Kempin67498de2013-02-25 16:15:34 +01003505|`in_reply_to` |optional|
3506The URL encoded UUID of the comment to which this comment is a reply.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003507|`updated` |optional|
3508The link:rest-api.html#timestamp[timestamp] of this comment. +
3509Accepted but ignored.
Edwin Kempin67498de2013-02-25 16:15:34 +01003510|`message` |optional|
3511The comment message. +
3512If not set and an existing draft comment is updated, the existing draft
3513comment is deleted.
3514|===========================
3515
Michael Zhou596c7682013-08-25 05:43:34 -04003516[[comment-range]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003517=== CommentRange
Michael Zhou596c7682013-08-25 05:43:34 -04003518The `CommentRange` entity describes the range of an inline comment.
3519
David Pursehouseae367192014-11-25 17:24:47 +09003520[options="header",cols="1,^1,5"]
Michael Zhou596c7682013-08-25 05:43:34 -04003521|===========================
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 Kempine3446292013-02-19 16:40:14 +01003529[[commit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003530=== CommitInfo
Edwin Kempine3446292013-02-19 16:40:14 +01003531The `CommitInfo` entity contains information about a commit.
3532
David Pursehouseae367192014-11-25 17:24:47 +09003533[options="header",cols="1,6"]
Edwin Kempine3446292013-02-19 16:40:14 +01003534|==========================
3535|Field Name |Description
3536|`commit` |The commit ID.
Edwin Kempinb89b0c82014-04-09 12:51:18 +02003537|`parents` |
Edwin Kempine3446292013-02-19 16:40:14 +01003538The parent commits of this commit as a list of
Edwin Kempincecf90a2014-04-09 14:58:35 +02003539link:#commit-info[CommitInfo] entities. In each parent
3540only the `commit` and `subject` fields are populated.
Edwin Kempine3446292013-02-19 16:40:14 +01003541|`author` |The author of the commit as a
3542link:#git-person-info[GitPersonInfo] entity.
3543|`committer` |The committer of the commit as a
3544link:#git-person-info[GitPersonInfo] entity.
3545|`subject` |
3546The subject of the commit (header line of the commit message).
3547|`message` |The commit message.
3548|==========================
3549
David Pursehouse882aef22013-06-05 10:56:37 +09003550[[diff-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003551=== DiffContent
David Pursehouse882aef22013-06-05 10:56:37 +09003552The `DiffContent` entity contains information about the content differences
3553in a file.
3554
David Pursehouseae367192014-11-25 17:24:47 +09003555[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09003556|==========================
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|
3562Text sections deleted from side A as a
3563link:#diff-intraline-info[DiffIntralineInfo] entity.
3564|`edit_b` |only present during a replace, i.e. both `a` and `b` are present|
3565Text sections inserted in side B as a
3566link:#diff-intraline-info[DiffIntralineInfo] entity.
3567|`skip` |optional|count of lines skipped on both sides when the file is
3568too large to include all common lines.
Shawn Pearce425a2be2014-01-02 16:00:58 -08003569|`common` |optional|Set to `true` if the region is common according
3570to the requested ignore-whitespace parameter, but a and b contain
3571differing amounts of whitespace. When present and true a and b are
3572used instead of ab.
David Pursehouse882aef22013-06-05 10:56:37 +09003573|==========================
3574
3575[[diff-file-meta-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003576=== DiffFileMetaInfo
David Pursehouse882aef22013-06-05 10:56:37 +09003577The `DiffFileMetaInfo` entity contains meta information about a file diff.
3578
David Pursehouseae367192014-11-25 17:24:47 +09003579[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09003580|==========================
Sven Selberge7f3f0a2014-10-21 11:04:42 +02003581|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 Kempin26c95a42014-11-25 16:29:47 +01003585|`web_links` |optional|
Sven Selberge7f3f0a2014-10-21 11:04:42 +02003586Links to the file in external sites as a list of
Shawn Pearceb62414c2014-10-16 22:48:33 -07003587link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
David Pursehouse882aef22013-06-05 10:56:37 +09003588|==========================
3589
3590[[diff-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003591=== DiffInfo
David Pursehouse882aef22013-06-05 10:56:37 +09003592The `DiffInfo` entity contains information about the diff of a file
3593in a revision.
3594
Edwin Kempin8cdce502014-12-06 10:55:38 +01003595If the link:#weblinks-only[weblinks-only] parameter is specified, only
3596the `web_links` field is set.
3597
David Pursehouseae367192014-11-25 17:24:47 +09003598[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09003599|==========================
3600|Field Name ||Description
3601|`meta_a` |not present when the file is added|
3602Meta information about the file on side A as a
3603link:#diff-file-meta-info[DiffFileMetaInfo] entity.
3604|`meta_b` |not present when the file is deleted|
3605Meta information about the file on side B as a
3606link:#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|
3610Intraline 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
3613link:#diff-content[DiffContent] entities.
Edwin Kempin8cdce502014-12-06 10:55:38 +01003614|`web_links` |optional|
3615Links to the file diff in external sites as a list of
3616link:rest-api-changes.html#diff-web-link-info[DiffWebLinkInfo] entries.
David Pursehouse882aef22013-06-05 10:56:37 +09003617|==========================
3618
3619[[diff-intraline-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003620=== DiffIntralineInfo
David Pursehouse882aef22013-06-05 10:56:37 +09003621The `DiffIntralineInfo` entity contains information about intraline edits in a
3622file.
3623
David Pursehouse31203f52013-06-08 17:05:45 +09003624The information consists of a list of `<skip length, mark length>` pairs, where
3625the skip length is the number of characters between the end of the previous edit
3626and the start of this edit, and the mark length is the number of edited characters
3627following the skip. The start of the edits is from the beginning of the related
3628diff content lines.
David Pursehouse882aef22013-06-05 10:56:37 +09003629
David Pursehouse31203f52013-06-08 17:05:45 +09003630Note that the implied newline character at the end of each line is included in
Colby Ranger4c292752013-06-07 11:11:00 -07003631the length calculation, and thus it is possible for the edits to span newlines.
David Pursehouse882aef22013-06-05 10:56:37 +09003632
Edwin Kempin8cdce502014-12-06 10:55:38 +01003633[[diff-web-link-info]]
3634=== DiffWebLinkInfo
3635The `DiffWebLinkInfo` entity describes a link on a diff screen to an
3636external 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|
3645Whether the web link should be shown on the side-by-side diff screen.
3646|show_on_unified_diff_view|
3647Whether the web link should be shown on the unified diff screen.
3648|=======================
3649
Edwin Kempine3446292013-02-19 16:40:14 +01003650[[fetch-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003651=== FetchInfo
Edwin Kempine3446292013-02-19 16:40:14 +01003652The `FetchInfo` entity contains information about how to fetch a patch
3653set via a certain protocol.
3654
David Pursehouseae367192014-11-25 17:24:47 +09003655[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01003656|==========================
Edwin Kempinea621482013-10-16 12:58:24 +02003657|Field Name ||Description
3658|`url` ||The URL of the project.
3659|`ref` ||The ref of the patch set.
3660|`commands` |optional|
3661The download commands for this patch set as a map that maps the command
3662names to the commands. +
3663Only set if link:#download_commands[download commands] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01003664|==========================
3665
3666[[file-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003667=== FileInfo
Edwin Kempine3446292013-02-19 16:40:14 +01003668The `FileInfo` entity contains information about a file in a patch set.
3669
David Pursehouseae367192014-11-25 17:24:47 +09003670[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01003671|=============================
3672|Field Name ||Description
3673|`status` |optional|
3674The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed,
3675"`C`"=Copied, "`W`"=Rewritten). +
3676Not set if the file was Modified ("`M`").
3677|`binary` |not set if `false`|Whether the file is binary.
3678|`old_path` |optional|
3679The old file path. +
John Spurlockd25fad12013-03-09 11:48:49 -05003680Only set if the file was renamed or copied.
Edwin Kempine3446292013-02-19 16:40:14 +01003681|`lines_inserted`|optional|
3682Number of inserted lines. +
3683Not set for binary files or if no lines were inserted.
3684|`lines_deleted` |optional|
3685Number of deleted lines. +
3686Not set for binary files or if no lines were deleted.
3687|=============================
3688
3689[[git-person-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003690=== GitPersonInfo
Edwin Kempine3446292013-02-19 16:40:14 +01003691The `GitPersonInfo` entity contains information about the
3692author/committer of a commit.
3693
David Pursehouseae367192014-11-25 17:24:47 +09003694[options="header",cols="1,6"]
Edwin Kempine3446292013-02-19 16:40:14 +01003695|==========================
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
3700this identity was constructed.
3701|`tz` |The timezone offset from UTC of when this identity was
3702constructed.
3703|==========================
3704
3705[[label-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003706=== LabelInfo
Dave Borowitz88159512013-06-14 14:21:50 -07003707The `LabelInfo` entity contains information about a label on a change, always
3708corresponding to the current patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01003709
Dave Borowitz88159512013-06-14 14:21:50 -07003710There are two options that control the contents of `LabelInfo`:
Dave Borowitz7d6aa012013-06-14 16:53:48 -07003711link:#labels[`LABELS`] and link:#detailed-labels[`DETAILED_LABELS`].
Dave Borowitz88159512013-06-14 14:21:50 -07003712
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' Wang61698b12013-12-20 12:55:51 -08003717==== Common fields
David Pursehouseae367192014-11-25 17:24:47 +09003718[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01003719|===========================
3720|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01003721|`optional` |not set if `false`|
3722Whether the label is optional. Optional means the label may be set, but
3723it's neither necessary for submission nor does it block submission if
3724set.
Dave Borowitz88159512013-06-14 14:21:50 -07003725|===========================
3726
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003727==== Fields set by `LABELS`
David Pursehouseae367192014-11-25 17:24:47 +09003728[options="header",cols="1,^1,5"]
Dave Borowitz88159512013-06-14 14:21:50 -07003729|===========================
3730|Field Name ||Description
3731|`approved` |optional|One user who approved this label on the change
3732(voted the maximum value) as an
3733link: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
3736link:rest-api-accounts.html#account-info[AccountInfo] entity.
3737|`recommended` |optional|One user who recommended this label on the
3738change (voted positively, but not the maximum value) as an
3739link: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
3742link:rest-api-accounts.html#account-info[AccountInfo] entity.
David Ostrovsky5292fd72014-02-27 21:56:35 +01003743|`blocking` |optional|If `true`, the label blocks submit operation.
3744If not set, the default is false.
Dave Borowitz88159512013-06-14 14:21:50 -07003745|`value` |optional|The voting value of the user who
3746recommended/disliked this label on the change if it is not
3747"`+1`"/"`-1`".
Khai Do4c91b002014-04-06 23:27:43 -07003748|`default_value`|optional|The default voting value for the label.
3749This value may be outside the range specified in permitted_labels.
Dave Borowitz88159512013-06-14 14:21:50 -07003750|===========================
3751
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003752==== Fields set by `DETAILED_LABELS`
David Pursehouseae367192014-11-25 17:24:47 +09003753[options="header",cols="1,^1,5"]
Dave Borowitz88159512013-06-14 14:21:50 -07003754|===========================
3755|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01003756|`all` |optional|List of all approvals for this label as a list
Dave Borowitz88159512013-06-14 14:21:50 -07003757of link:#approval-info[ApprovalInfo] entities.
Edwin Kempine3446292013-02-19 16:40:14 +01003758|`values` |optional|A map of all values that are allowed for this
3759label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`")
Dave Borowitz88159512013-06-14 14:21:50 -07003760to the value descriptions.
Edwin Kempine3446292013-02-19 16:40:14 +01003761|===========================
3762
Saša Živkov499873f2014-05-05 13:34:18 +02003763[[mergeable-info]]
3764=== MergeableInfo
3765The `MergeableInfo` entity contains information about the mergeability of a
3766change.
3767
David Pursehouseae367192014-11-25 17:24:47 +09003768[options="header",cols="1,^1,5"]
Saša Živkov499873f2014-05-05 13:34:18 +02003769|============================
Saša Živkov697cab22014-04-29 16:46:50 +02003770|Field Name ||Description
3771|`submit_type` ||
Saša Živkov499873f2014-05-05 13:34:18 +02003772Submit 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 Živkov697cab22014-04-29 16:46:50 +02003775|`mergeable` ||
Saša Živkov499873f2014-05-05 13:34:18 +02003776`true` if this change is cleanly mergeable, `false` otherwise
Saša Živkov697cab22014-04-29 16:46:50 +02003777|`mergeable_into`|optional|
3778A list of other branch names where this change could merge cleanly
Saša Živkov76bab292014-05-08 14:29:12 +02003779|============================
Dave Borowitz88159512013-06-14 14:21:50 -07003780
Edwin Kempined5364b2013-02-22 10:39:33 +01003781[[restore-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003782=== RestoreInput
Edwin Kempined5364b2013-02-22 10:39:33 +01003783The `RestoreInput` entity contains information for restoring a change.
3784
David Pursehouseae367192014-11-25 17:24:47 +09003785[options="header",cols="1,^1,5"]
Edwin Kempined5364b2013-02-22 10:39:33 +01003786|===========================
3787|Field Name ||Description
3788|`message` |optional|
3789Message to be added as review comment to the change when restoring the
3790change.
3791|===========================
3792
Edwin Kempind2ec4152013-02-22 12:17:19 +01003793[[revert-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003794=== RevertInput
Edwin Kempind2ec4152013-02-22 12:17:19 +01003795The `RevertInput` entity contains information for reverting a change.
3796
David Pursehouseae367192014-11-25 17:24:47 +09003797[options="header",cols="1,^1,5"]
Edwin Kempind2ec4152013-02-22 12:17:19 +01003798|===========================
3799|Field Name ||Description
3800|`message` |optional|
3801Message to be added as review comment to the change when reverting the
3802change.
3803|===========================
3804
Edwin Kempin67498de2013-02-25 16:15:34 +01003805[[review-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003806=== ReviewInfo
Edwin Kempin67498de2013-02-25 16:15:34 +01003807The `ReviewInfo` entity contains information about a review.
3808
David Pursehouseae367192014-11-25 17:24:47 +09003809[options="header",cols="1,6"]
Edwin Kempin67498de2013-02-25 16:15:34 +01003810|===========================
3811|Field Name |Description
3812|`labels` |
3813The labels of the review as a map that maps the label names to the
3814voting values.
3815|===========================
3816
3817[[review-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003818=== ReviewInput
Edwin Kempin67498de2013-02-25 16:15:34 +01003819The `ReviewInput` entity contains information for adding a review to a
3820revision.
3821
David Pursehouseae367192014-11-25 17:24:47 +09003822[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01003823|============================
3824|Field Name ||Description
3825|`message` |optional|
3826The message to be added as review comment.
3827|`labels` |optional|
3828The votes that should be added to the revision as a map that maps the
3829label names to the voting values.
3830|`comments` |optional|
3831The comments that should be added as a map that maps a file path to a
3832list of link:#comment-input[CommentInput] entities.
3833|`strict_labels`|`true` if not set|
John Spurlockd25fad12013-03-09 11:48:49 -05003834Whether all labels are required to be within the user's permitted ranges
Edwin Kempin67498de2013-02-25 16:15:34 +01003835based on access controls. +
3836If `true`, attempting to use a label not granted to the user will fail
3837the entire modify operation early. +
3838If `false`, the operation will execute anyway, but the proposed labels
3839will be modified to be the "best" value allowed by the access controls.
3840|`drafts` |optional|
3841Draft handling that defines how draft comments are handled that are
3842already in the database but that were not also described in this
3843input. +
3844Allowed values are `DELETE`, `PUBLISH` and `KEEP`. +
3845If not set, the default is `DELETE`.
3846|`notify` |optional|
3847Notify handling that defines to whom email notifications should be sent
3848after the review is stored. +
3849Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
3850If not set, the default is `ALL`.
Shawn Pearce9d783122013-06-11 18:18:03 -07003851|`on_behalf_of`|optional|
3852link:rest-api-accounts.html#account-id[\{account-id\}] the review
3853should be posted on behalf of. To use this option the caller must
3854have been granted `labelAs-NAME` permission for all keys of labels.
Edwin Kempin67498de2013-02-25 16:15:34 +01003855|============================
3856
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003857[[reviewer-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003858=== ReviewerInfo
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003859The `ReviewerInfo` entity contains information about a reviewer and its
3860votes on a change.
3861
Edwin Kempin963dfd02013-02-27 12:39:32 +01003862`ReviewerInfo` has the same fields as
3863link:rest-api-accounts.html#account-info[AccountInfo] and includes
3864link:#detailed-accounts[detailed account information].
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003865In addition `ReviewerInfo` has the following fields:
3866
David Pursehouseae367192014-11-25 17:24:47 +09003867[options="header",cols="1,6"]
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003868|==========================
3869|Field Name |Description
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003870|`approvals` |
3871The approvals of the reviewer as a map that maps the label names to the
David Pursehouse778fefc2014-09-01 14:32:52 +09003872approval values ("`-2`", "`-1`", "`0`", "`+1`", "`+2`").
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003873|==========================
3874
Edwin Kempin392328e2013-02-25 12:50:03 +01003875[[reviewer-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003876=== ReviewerInput
Edwin Kempin392328e2013-02-25 12:50:03 +01003877The `ReviewerInput` entity contains information for adding a reviewer
3878to a change.
3879
David Pursehouseae367192014-11-25 17:24:47 +09003880[options="header",cols="1,^1,5"]
Edwin Kempin392328e2013-02-25 12:50:03 +01003881|===========================
3882|Field Name ||Description
3883|`reviewer` ||
3884The link:rest-api-accounts.html#account-id[ID] of one account that
3885should be added as reviewer or the link:rest-api-groups.html#group-id[
3886ID] of one group for which all members should be added as reviewers. +
3887If an ID identifies both an account and a group, only the account is
3888added as reviewer to the change.
3889|`confirmed` |optional|
3890Whether adding the reviewer is confirmed. +
3891The Gerrit server may be configured to
3892link:config-gerrit.html#addreviewer.maxWithoutConfirmation[require a
3893confirmation] when adding a group as reviewer that has many members.
3894|===========================
3895
Edwin Kempine3446292013-02-19 16:40:14 +01003896[[revision-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003897=== RevisionInfo
Edwin Kempine3446292013-02-19 16:40:14 +01003898The `RevisionInfo` entity contains information about a patch set.
Khai Dob3139b7532014-09-19 15:13:04 -07003899Not all fields are returned by default. Additional fields can
3900be obtained by adding `o` parameters as described in
3901link:#list-changes[Query Changes].
Edwin Kempine3446292013-02-19 16:40:14 +01003902
David Pursehouseae367192014-11-25 17:24:47 +09003903[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01003904|===========================
3905|Field Name ||Description
3906|`draft` |not set if `false`|Whether the patch set is a draft.
David Ostrovsky17d0d332013-09-30 21:36:09 +02003907|`has_draft_comments` |not set if `false`|Whether the patch
3908set has one or more draft comments by the calling user. Only set if
Khai Dob3139b7532014-09-19 15:13:04 -07003909link:#draft_comments[DRAFT_COMMENTS] option is requested.
Edwin Kempine3446292013-02-19 16:40:14 +01003910|`_number` ||The patch set number.
Edwin Kempin4569ced2014-11-25 16:45:05 +01003911|`ref` ||The Git reference for the patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01003912|`fetch` ||
3913Information about how to fetch this patch set. The fetch information is
3914provided as a map that maps the protocol name ("`git`", "`http`",
Khai Dob3139b7532014-09-19 15:13:04 -07003915"`ssh`") to link:#fetch-info[FetchInfo] entities. This information is
3916only included if a plugin implementing the
3917link:intro-project-owner.html#download-commands[download commands]
3918interface is installed.
Shawn Pearce12e51592013-07-13 22:08:40 -07003919|`commit` |optional|The commit of the patch set as
Edwin Kempine3446292013-02-19 16:40:14 +01003920link:#commit-info[CommitInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07003921|`files` |optional|
Edwin Kempine3446292013-02-19 16:40:14 +01003922The files of the patch set as a map that maps the file names to
Khai Dob3139b7532014-09-19 15:13:04 -07003923link:#file-info[FileInfo] entities. Only set if
3924link:#current-files[CURRENT_FILES] or link:#all-files[ALL_FILES]
3925option is requested.
Shawn Pearce12e51592013-07-13 22:08:40 -07003926|`actions` |optional|
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07003927Actions the caller might be able to perform on this revision. The
3928information is a map of view name to link:#action-info[ActionInfo]
3929entities.
Khai Dob3139b7532014-09-19 15:13:04 -07003930|`reviewed` |optional|
3931Indicates whether the caller is authenticated and has commented on the
3932current revision. Only set if link:#reviewed[REVIEWED] option is requested.
Edwin Kempin26c95a42014-11-25 16:29:47 +01003933|`web_links` |optional|
Edwin Kempinbd885ff2014-04-11 16:11:56 +02003934Links to the patch set in external sites as a list of
Khai Dob3139b7532014-09-19 15:13:04 -07003935link:#web-link-info[WebLinkInfo] entities. Only set if
3936link:#web-links[WEB_LINKS] option is requested.
Edwin Kempine3446292013-02-19 16:40:14 +01003937|===========================
3938
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003939[[rule-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003940=== RuleInput
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003941The `RuleInput` entity contains information to test a Prolog rule.
3942
David Pursehouseae367192014-11-25 17:24:47 +09003943[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003944|===========================
3945|Field Name ||Description
3946|`rule`||
3947Prolog code to execute instead of the code in `refs/meta/config`.
3948|`filters`|`RUN` if not set|
3949When `RUN` filter rules in the parent projects are called to
3950post-process the results of the project specific rule. This
3951behavior matches how the rule will execute if installed. +
3952If `SKIP` the parent filters are not called, allowing the test
3953to return results from the input rule.
3954|===========================
3955
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003956[[suggested-reviewer-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003957=== SuggestedReviewerInfo
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003958The `SuggestedReviewerInfo` entity contains information about a reviewer
3959that can be added to a change (an account or a group).
3960
3961`SuggestedReviewerInfo` has either the `account` field that contains
3962the link:rest-api-accounts.html#account-info[AccountInfo] entity, or
3963the `group` field that contains the
3964link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity.
3965
Edwin Kempin14b58112013-02-26 16:30:19 +01003966[[submit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003967=== SubmitInfo
Edwin Kempin14b58112013-02-26 16:30:19 +01003968The `SubmitInfo` entity contains information about the change status
3969after submitting.
3970
David Pursehouseae367192014-11-25 17:24:47 +09003971[options="header",cols="1,6"]
Edwin Kempin14b58112013-02-26 16:30:19 +01003972|==========================
3973|Field Name |Description
3974|`status` |
3975The status of the change after submitting, can be `MERGED` or
3976`SUBMITTED`. +
3977If `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
3979whether the change could be merged successfully.
David Ostrovsky868e3412014-01-30 19:50:57 +01003980|`on_behalf_of`|optional|
3981The link:rest-api-accounts.html#account-id[\{account-id\}] of the user on
3982whose behalf the action should be done. To use this option the caller must
David Pursehouse22bd6f92014-02-20 21:11:01 +09003983have been granted both `Submit` and `Submit (On Behalf Of)` permissions.
3984The user named by `on_behalf_of` does not need to be granted the `Submit`
3985permission. This feature is aimed for CI solutions: the CI account can be
3986granted both permssions, so individual users don't need `Submit` permission
3987themselves. Still the changes can be submited on behalf of real users and
3988not with the identity of the CI account.
Edwin Kempin14b58112013-02-26 16:30:19 +01003989|==========================
3990
Edwin Kempin0eddba02013-02-22 15:30:12 +01003991[[submit-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003992=== SubmitInput
Edwin Kempin0eddba02013-02-22 15:30:12 +01003993The `SubmitInput` entity contains information for submitting a change.
3994
David Pursehouseae367192014-11-25 17:24:47 +09003995[options="header",cols="1,^1,5"]
Edwin Kempin0eddba02013-02-22 15:30:12 +01003996|===========================
3997|Field Name ||Description
3998|`wait_for_merge`|`false` if not set|
3999Whether the request should wait for the merge to complete. +
4000If `false` the request returns immediately after the change has been
4001added to the merge queue and the caller can't know whether the change
4002could be merged successfully.
4003|===========================
4004
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004005[[submit-record]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004006=== SubmitRecord
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004007The `SubmitRecord` entity describes results from a submit_rule.
4008
David Pursehouseae367192014-11-25 17:24:47 +09004009[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004010|===========================
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 Kempinfe29b812013-03-05 14:52:54 +01004018Map of labels that are approved; an
4019link:rest-api-accounts.html#account-info[AccountInfo] identifies the
4020voter chosen by the rule.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004021|`reject`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01004022Map of labels that are preventing submit;
4023link:rest-api-accounts.html#account-info[AccountInfo] identifies voter.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004024|`need`|optional|
4025Map of labels that need to be given to submit. The value is
4026currently an empty object.
4027|`may`|optional|
4028Map of labels that can be used, but do not affect submit.
Edwin Kempinfe29b812013-03-05 14:52:54 +01004029link:rest-api-accounts.html#account-info[AccountInfo] identifies voter,
4030if the label has been applied.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004031|`impossible`|optional|
4032Map of labels that should have been in `need` but cannot be
4033used by any user because of access restrictions. The value
4034is currently an empty object.
4035|`error_message`|optional|
4036When status is RULE_ERROR this message provides some text describing
4037the failure of the rule predicate.
4038|===========================
4039
Edwin Kempin64006bb2013-02-22 08:17:04 +01004040[[topic-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004041=== TopicInput
Edwin Kempin64006bb2013-02-22 08:17:04 +01004042The `TopicInput` entity contains information for setting a topic.
4043
David Pursehouseae367192014-11-25 17:24:47 +09004044[options="header",cols="1,^1,5"]
Edwin Kempin64006bb2013-02-22 08:17:04 +01004045|===========================
4046|Field Name ||Description
4047|`topic` |optional|The topic. +
4048The topic will be deleted if not set.
Edwin Kempin64006bb2013-02-22 08:17:04 +01004049|===========================
4050
David Ostrovsky83e8aee2013-09-30 22:37:26 +02004051[[included-in-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004052=== IncludedInInfo
David Ostrovsky83e8aee2013-09-30 22:37:26 +02004053The `IncludedInInfo` entity contains information about the branches a
4054change was merged into and tags it was tagged with.
4055
David Pursehouseae367192014-11-25 17:24:47 +09004056[options="header",cols="1,6"]
David Ostrovsky83e8aee2013-09-30 22:37:26 +02004057|==========================
4058|Field Name |Description
David Ostrovsky83e8aee2013-09-30 22:37:26 +02004059|`branches` | The list of branches this change was merged into.
4060Each branch is listed without the 'refs/head/' prefix.
4061|`tags` | The list of tags this change was tagged with.
4062Each tag is listed without the 'refs/tags/' prefix.
4063|==========================
4064
Edwin Kempinbd885ff2014-04-11 16:11:56 +02004065[[web-link-info]]
4066=== WebLinkInfo
4067The `WebLinkInfo` entity describes a link to an external site.
4068
David Pursehouseae367192014-11-25 17:24:47 +09004069[options="header",cols="1,6"]
Edwin Kempinbd885ff2014-04-11 16:11:56 +02004070|======================
4071|Field Name|Description
4072|`name` |The link name.
4073|`url` |The link URL.
Sven Selberg55484202014-06-26 08:48:51 +02004074|`image_url`|URL to the icon of the link.
Edwin Kempinbd885ff2014-04-11 16:11:56 +02004075|======================
4076
David Ostrovsky1a49f622014-07-29 00:40:02 +02004077[[edit-info]]
4078=== EditInfo
4079The `EditInfo` entity contains information about a change edit.
4080
David Pursehouseae367192014-11-25 17:24:47 +09004081[options="header",cols="1,^1,5"]
David Ostrovsky1a49f622014-07-29 00:40:02 +02004082|===========================
4083|Field Name ||Description
4084|`commit` ||The commit of change edit as
4085link:#commit-info[CommitInfo] entity.
David Ostrovsky0619f652014-09-11 13:33:45 +02004086|`baseRevision`||The revision of the patch set change edit is based on.
David Ostrovskycdda3312014-08-03 14:03:13 +02004087|`actions` ||
4088Actions the caller might be able to perform on this change edit. The
4089information is a map of view name to link:#action-info[ActionInfo]
4090entities.
David Ostrovsky5562fe52014-08-12 22:36:27 +02004091|`fetch` ||
4092Information about how to fetch this patch set. The fetch information is
4093provided as a map that maps the protocol name ("`git`", "`http`",
4094"`ssh`") to link:#fetch-info[FetchInfo] entities.
David Ostrovsky5d98e342014-08-01 09:23:28 +02004095|`files` |optional|
4096The files of the change edit as a map that maps the file names to
4097link:#file-info[FileInfo] entities.
David Ostrovsky1a49f622014-07-29 00:40:02 +02004098|===========================
4099
David Ostrovskybd12e172014-08-21 23:08:15 +02004100[[change-edit-input]]
4101=== ChangeEditInput
4102The `ChangeEditInput` entity contains information for restoring a
David Ostrovsky138edb42014-08-15 21:31:43 +02004103path within change edit.
4104
David Pursehouseae367192014-11-25 17:24:47 +09004105[options="header",cols="1,^1,5"]
David Ostrovsky138edb42014-08-15 21:31:43 +02004106|===========================
4107|Field Name ||Description
4108|`restore_path`|optional|Path to file to restore.
4109|===========================
4110
David Ostrovskyc967e152014-10-24 17:36:16 +02004111[[change-edit-message-input]]
4112=== ChangeEditMessageInput
4113The `ChangeEditMessageInput` entity contains information for changing
4114the 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 Borowitz5c894d42014-11-25 17:43:06 -05004122[[problem-info]]
4123=== ProblemInfo
4124The `ProblemInfo` entity contains a description of a potential consistency problem
4125with a change. These are not related to the code review process, but rather
4126indicate some inconsistency in Gerrit's database or repository metadata related
4127to the enclosing change.
Dave Borowitzfd508ca2014-11-06 15:24:04 -08004128
Dave Borowitz3be39d02014-12-03 17:57:38 -08004129[options="header",cols="1,^1,5"]
Dave Borowitzfd508ca2014-11-06 15:24:04 -08004130|===========================
Dave Borowitz3be39d02014-12-03 17:57:38 -08004131|Field Name||Description
4132|`message` ||Plaintext message describing the problem with the change.
4133|`status` |optional|
4134The status of fixing the problem (`FIXED`, `FIX_FAILED`). Only set if a
4135fix was attempted.
4136|`outcome` |optional|
4137If `status` is set, an additional plaintext message describing the
4138outcome of the fix.
Dave Borowitzfd508ca2014-11-06 15:24:04 -08004139|===========================
4140
Edwin Kempind0a63922013-01-23 16:32:59 +01004141GERRIT
4142------
4143Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07004144
4145SEARCHBOX
4146---------