Merge branch 'stable-2.15' into stable-2.16
* stable-2.15:
EditInfo: Include the change edit ref
Add missing documentation of base_patch_set_number in edit API
Change-Id: Ib005e971116f569d73e1019d2b3cd27f9ba3da32
diff --git a/Documentation/rest-api-changes.txt b/Documentation/rest-api-changes.txt
index 4aae2dd..bfc3979 100644
--- a/Documentation/rest-api-changes.txt
+++ b/Documentation/rest-api-changes.txt
@@ -2593,7 +2593,9 @@
"subject":"Use an EventBus to manage star icons",
"message":"Use an EventBus to manage star icons\n\nImage widgets that need to ..."
},
- "base_revision":"c35558e0925e6985c91f3a16921537d5e572b7a3"
+ "base_patch_set_number":1,
+ "base_revision":"c35558e0925e6985c91f3a16921537d5e572b7a3",
+ "ref":"refs/users/01/1000001/edit-76482/1"
}
----
@@ -4825,7 +4827,9 @@
"subject":"Implement feature X",
"message":"Implement feature X\n\nWith this feature ..."
},
+ "base_patch_set_number":1,
"base_revision":"674ac754f91e64a0efb8087e59a176484bd534d1"
+ "ref":"refs/users/01/1000001/edit-42622/1"
}
----
@@ -6336,15 +6340,17 @@
[options="header",cols="1,^1,5"]
|===========================
-|Field Name ||Description
-|`commit` ||The commit of change edit as
+|Field Name ||Description
+|`commit` ||The commit of change edit as
link:#commit-info[CommitInfo] entity.
-|`base_revision`||The revision of the patch set the change edit is based on.
-|`fetch` |optional|
+|`base_patch_set_number`||The patch set number of the patch set the change edit is based on.
+|`base_revision` ||The revision of the patch set the change edit is based on.
+|`ref` ||The ref of the change edit.
+|`fetch` |optional|
Information about how to fetch this patch set. The fetch information is
provided as a map that maps the protocol name ("`git`", "`http`",
"`ssh`") to link:#fetch-info[FetchInfo] entities.
-|`files` |optional|
+|`files` |optional|
The files of the change edit as a map that maps the file names to
link:#file-info[FileInfo] entities.
|===========================
diff --git a/java/com/google/gerrit/extensions/common/EditInfo.java b/java/com/google/gerrit/extensions/common/EditInfo.java
index 46ef879..0cd5af3 100644
--- a/java/com/google/gerrit/extensions/common/EditInfo.java
+++ b/java/com/google/gerrit/extensions/common/EditInfo.java
@@ -20,6 +20,7 @@
public CommitInfo commit;
public int basePatchSetNumber;
public String baseRevision;
+ public String ref;
public Map<String, FetchInfo> fetch;
public Map<String, FileInfo> files;
}
diff --git a/java/com/google/gerrit/server/edit/ChangeEditJson.java b/java/com/google/gerrit/server/edit/ChangeEditJson.java
index bf20404..55e0aef 100644
--- a/java/com/google/gerrit/server/edit/ChangeEditJson.java
+++ b/java/com/google/gerrit/server/edit/ChangeEditJson.java
@@ -53,6 +53,7 @@
out.commit = fillCommit(edit.getEditCommit());
out.baseRevision = edit.getBasePatchSet().getRevision().get();
out.basePatchSetNumber = edit.getBasePatchSet().getPatchSetId();
+ out.ref = edit.getRefName();
if (downloadCommands) {
out.fetch = fillFetchMap(edit);
}