/changes/: Return more data
Allow more data to be provided in the JSON results from /changes/, including all revisions of the change (aka patch sets), commit message data, files, and URLs to fetch the revisions with. Revisions are indexed by the commit SHA-1, as a commit can only really appear once per change. The current_revision field points to the revision structure that is the most recent for this change. Within a revision structure the fetch map provides a set of URLs and the corresponding reference that should point to the commit. This can be used to fetch the change over the Git protocols. All available URL permutations are made by the server rather than the client, giving the server more flexibility in the long term to move changes around. This should one day support moving closed changes out to archive repositories with different reference names. $ curl 'http://127.0.0.1:8080/changes/?q=97&format=JSON&o=CURRENT_REVISION&o=CURRENT_COMMIT&o=CURRENT_FILES' )]}' [ { "project": "gerrit", "branch": "master", "id": "I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a", "subject": "Use an EventBus to manage star icons", "status": "NEW", "created": "2012-04-25 00:52:25.580000000", "updated": "2012-04-25 00:52:25.586000000", "_sortkey": "001c9bf400000061", "_number": 97, "owner": { "name": "Shawn Pearce" }, "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c", "revisions": { "184ebe53805e102605d11f6b143486d15c23a09c": { "_number": 1, "fetch": { "git": { "url": "git://localhost/gerrit", "ref": "refs/changes/97/97/1" }, "http": { "url": "http://127.0.0.1:8080/gerrit", "ref": "refs/changes/97/97/1" } }, "commit": { "parents": [ { "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", "subject": "Migrate contributor agreements to All-Projects." } ], "author": { "name": "Shawn O. Pearce", "email": "sop@google.com", "date": "2012-04-24 18:08:08.000000000", "tz": -420 }, "committer": { "name": "Shawn O. Pearce", "email": "sop@google.com", "date": "2012-04-24 18:08:08.000000000", "tz": -420 }, "subject": "Use an EventBus to manage star icons", "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..." }, "files": { "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeCache.java": { "lines_deleted": 8 }, "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeDetailCache.java": { "lines_inserted": 1 }, "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java": { "lines_inserted": 11, "lines_deleted": 19 }, "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java": { "lines_inserted": 23, "lines_deleted": 20 }, "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarCache.java": { "status": "D", "lines_deleted": 139 }, "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarredChanges.java": { "status": "A", "lines_inserted": 204 }, "gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Screen.java": { "lines_deleted": 9 } } } } } ] Change-Id: I9589cc46b3dfcc43e799fdd40ee8d6c292c4f17b
This commit is contained in:
@@ -82,7 +82,10 @@ public final class Patch {
|
||||
RENAMED('R'),
|
||||
|
||||
/** Path was copied from {@link Patch#getSourceFileName()}. */
|
||||
COPIED('C');
|
||||
COPIED('C'),
|
||||
|
||||
/** Sufficient amount of content changed to claim the file was written. */
|
||||
REWRITE('W');
|
||||
|
||||
private final char code;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user