changeset: fetch SUBMITTABLE and add field to struct
This commit is contained in:
parent
0e8aa14045
commit
5acc403e28
2 changed files with 5 additions and 1 deletions
|
@ -16,6 +16,7 @@ type Changeset struct {
|
||||||
Number int
|
Number int
|
||||||
Verified int
|
Verified int
|
||||||
CodeReviewed int
|
CodeReviewed int
|
||||||
|
Submittable bool
|
||||||
HashTags []string
|
HashTags []string
|
||||||
CommitID string
|
CommitID string
|
||||||
ParentCommitIDs []string
|
ParentCommitIDs []string
|
||||||
|
@ -31,6 +32,7 @@ func MakeChangeset(changeInfo *goGerrit.ChangeInfo) *Changeset {
|
||||||
Number: changeInfo.Number,
|
Number: changeInfo.Number,
|
||||||
Verified: labelInfoToInt(changeInfo.Labels["Verified"]),
|
Verified: labelInfoToInt(changeInfo.Labels["Verified"]),
|
||||||
CodeReviewed: labelInfoToInt(changeInfo.Labels["Code-Review"]),
|
CodeReviewed: labelInfoToInt(changeInfo.Labels["Code-Review"]),
|
||||||
|
Submittable: changeInfo.Submittable,
|
||||||
HashTags: changeInfo.Hashtags,
|
HashTags: changeInfo.Hashtags,
|
||||||
CommitID: changeInfo.CurrentRevision, // yes, this IS the commit ID.
|
CommitID: changeInfo.CurrentRevision, // yes, this IS the commit ID.
|
||||||
ParentCommitIDs: getParentCommitIDs(changeInfo),
|
ParentCommitIDs: getParentCommitIDs(changeInfo),
|
||||||
|
@ -65,7 +67,8 @@ func (c *Changeset) IsCodeReviewed() bool {
|
||||||
func (c *Changeset) String() string {
|
func (c *Changeset) String() string {
|
||||||
var b bytes.Buffer
|
var b bytes.Buffer
|
||||||
b.WriteString("Changeset")
|
b.WriteString("Changeset")
|
||||||
b.WriteString(fmt.Sprintf("(commitID: %.7s, author: %s, subject: %s)", c.CommitID, c.OwnerName, c.Subject))
|
b.WriteString(fmt.Sprintf("(commitID: %.7s, author: %s, subject: %s, submittable: %v)",
|
||||||
|
c.CommitID, c.OwnerName, c.Subject, c.Submittable))
|
||||||
return b.String()
|
return b.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ var additionalFields = []string{
|
||||||
"CURRENT_REVISION",
|
"CURRENT_REVISION",
|
||||||
"CURRENT_COMMIT",
|
"CURRENT_COMMIT",
|
||||||
"DETAILED_ACCOUNTS",
|
"DETAILED_ACCOUNTS",
|
||||||
|
"SUBMITTABLE",
|
||||||
}
|
}
|
||||||
|
|
||||||
// IClient defines the gerrit.Client interface
|
// IClient defines the gerrit.Client interface
|
||||||
|
|
Loading…
Reference in a new issue