Merge pull request #1 from kolaente/resolved-conflicts
Resolved conflicts
This commit is contained in:
commit
05ad1bb4a8
|
|
@ -315,6 +315,12 @@ func createComment(e *xorm.Session, opts *CreateCommentOptions) (_ *Comment, err
|
||||||
if opts.Label != nil {
|
if opts.Label != nil {
|
||||||
LabelID = opts.Label.ID
|
LabelID = opts.Label.ID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var depId int64 = 0
|
||||||
|
if opts.DependentIssue != nil {
|
||||||
|
depId = opts.DependentIssue.ID
|
||||||
|
}
|
||||||
|
|
||||||
comment := &Comment{
|
comment := &Comment{
|
||||||
Type: opts.Type,
|
Type: opts.Type,
|
||||||
PosterID: opts.Doer.ID,
|
PosterID: opts.Doer.ID,
|
||||||
|
|
@ -341,7 +347,6 @@ func createComment(e *xorm.Session, opts *CreateCommentOptions) (_ *Comment, err
|
||||||
// It seems to be inserted, but isnt. (Doesn't return an error, raw pasting
|
// It seems to be inserted, but isnt. (Doesn't return an error, raw pasting
|
||||||
// the sql query in a database console does work). But after the function
|
// the sql query in a database console does work). But after the function
|
||||||
// is called, there is no entry in the database. At least for type 12 and 13.
|
// is called, there is no entry in the database. At least for type 12 and 13.
|
||||||
|
|
||||||
_, err = e.Insert(comment)
|
_, err = e.Insert(comment)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
||||||
|
|
@ -919,6 +919,23 @@ func NewComment(ctx *context.Context, form auth.CreateCommentForm) {
|
||||||
(form.Status == "reopen" || form.Status == "close") &&
|
(form.Status == "reopen" || form.Status == "close") &&
|
||||||
!(issue.IsPull && issue.PullRequest.HasMerged) {
|
!(issue.IsPull && issue.PullRequest.HasMerged) {
|
||||||
|
|
||||||
|
// Check for open dependencies
|
||||||
|
if form.Status == "close"{
|
||||||
|
|
||||||
|
canbeClosed := models.IssueNoDependenciesLeft(issue)
|
||||||
|
|
||||||
|
if !canbeClosed {
|
||||||
|
if issue.IsPull{
|
||||||
|
ctx.Flash.Error("You need to close all issues blocking this pull request before you can merge it!")
|
||||||
|
ctx.Redirect(fmt.Sprintf("%s/pulls/%d", ctx.Repo.RepoLink, issue.Index))
|
||||||
|
} else {
|
||||||
|
ctx.Flash.Error("You need to close all issues blocking this issue before you can close it!")
|
||||||
|
ctx.Redirect(fmt.Sprintf("%s/issues/%d", ctx.Repo.RepoLink, issue.Index))
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Duplication and conflict check should apply to reopen pull request.
|
// Duplication and conflict check should apply to reopen pull request.
|
||||||
var pr *models.PullRequest
|
var pr *models.PullRequest
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user