|
|
@ -851,6 +851,7 @@ type PullRepo struct { |
|
|
|
HeadRepoID int64 `xorm:"UNIQUE(s)"` |
|
|
|
HeadRepoID int64 `xorm:"UNIQUE(s)"` |
|
|
|
HeadRepo *Repository `xorm:"-"` |
|
|
|
HeadRepo *Repository `xorm:"-"` |
|
|
|
BaseRepoID int64 `xorm:"UNIQUE(s)"` |
|
|
|
BaseRepoID int64 `xorm:"UNIQUE(s)"` |
|
|
|
|
|
|
|
HeadUserName string |
|
|
|
HeadBarcnh string `xorm:"UNIQUE(s)"` |
|
|
|
HeadBarcnh string `xorm:"UNIQUE(s)"` |
|
|
|
BaseBranch string `xorm:"UNIQUE(s)"` |
|
|
|
BaseBranch string `xorm:"UNIQUE(s)"` |
|
|
|
MergeBase string `xorm:"VARCHAR(40)"` |
|
|
|
MergeBase string `xorm:"VARCHAR(40)"` |
|
|
@ -871,7 +872,6 @@ func (pr *PullRepo) AfterSet(colName string, _ xorm.Cell) { |
|
|
|
|
|
|
|
|
|
|
|
// NewPullRequest creates new pull request with labels for repository.
|
|
|
|
// NewPullRequest creates new pull request with labels for repository.
|
|
|
|
func NewPullRequest(repo *Repository, pr *Issue, labelIDs []int64, uuids []string, pullRepo *PullRepo, patch []byte) (err error) { |
|
|
|
func NewPullRequest(repo *Repository, pr *Issue, labelIDs []int64, uuids []string, pullRepo *PullRepo, patch []byte) (err error) { |
|
|
|
|
|
|
|
|
|
|
|
sess := x.NewSession() |
|
|
|
sess := x.NewSession() |
|
|
|
defer sessionRelease(sess) |
|
|
|
defer sessionRelease(sess) |
|
|
|
if err = sess.Begin(); err != nil { |
|
|
|
if err = sess.Begin(); err != nil { |
|
|
|