Add patch set description
With this change, the description field is properly populated by the %m flag and set in ReviewDB and NoteDB, and is set in the ChangeJSON received in a GetChange call. The test for pushing a change with a message was also updated to check for the description field being set in RevisionInfo. To be included in descendant changes: - Handling cases where PSUtil.insert is called that aren't change creations or updates (cherrypick, etc) - Implementation of an API endpoint for setting/deleting the value - Docs Feature: Issue 4544 Change-Id: I1c4d817d1d5e263b0cd42bf9ea874808aac00582
This commit is contained in:
		@@ -194,6 +194,16 @@ public final class PatchSet {
 | 
			
		||||
  @Column(id = 8, notNull = false, length = Integer.MAX_VALUE)
 | 
			
		||||
  protected String pushCertificate;
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * Optional user-supplied description for this patch set.
 | 
			
		||||
   * <p>
 | 
			
		||||
   * When this field is null, the description was never set on the patch set.
 | 
			
		||||
   * When this field is an empty string, the description was set and later
 | 
			
		||||
   * cleared.
 | 
			
		||||
   */
 | 
			
		||||
  @Column(id = 9, notNull = false, length = Integer.MAX_VALUE)
 | 
			
		||||
  protected String description;
 | 
			
		||||
 | 
			
		||||
  protected PatchSet() {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@@ -209,6 +219,7 @@ public final class PatchSet {
 | 
			
		||||
    this.draft = src.draft;
 | 
			
		||||
    this.groups = src.groups;
 | 
			
		||||
    this.pushCertificate = src.pushCertificate;
 | 
			
		||||
    this.description = src.description;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public PatchSet.Id getId() {
 | 
			
		||||
@@ -277,6 +288,14 @@ public final class PatchSet {
 | 
			
		||||
    pushCertificate = cert;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public String getDescription() {
 | 
			
		||||
    return description;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public void setDescription(String description) {
 | 
			
		||||
    this.description = description;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @Override
 | 
			
		||||
  public String toString() {
 | 
			
		||||
    return "[PatchSet " + getId().toString() + "]";
 | 
			
		||||
 
 | 
			
		||||
@@ -54,6 +54,9 @@ public final class PatchSetInfo {
 | 
			
		||||
  /** SHA-1 of commit */
 | 
			
		||||
  protected String revId;
 | 
			
		||||
 | 
			
		||||
  /** Optional user-supplied description for the patch set. */
 | 
			
		||||
  protected String description;
 | 
			
		||||
 | 
			
		||||
  protected PatchSetInfo() {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@@ -116,4 +119,12 @@ public final class PatchSetInfo {
 | 
			
		||||
  public String getRevId() {
 | 
			
		||||
    return revId;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public void setDescription(String description) {
 | 
			
		||||
    this.description = description;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public String getDescription() {
 | 
			
		||||
    return description;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user