@ -723,7 +723,16 @@ func UpdatePullRequest(ctx *context.Context) {
if err = pull_service . Update ( issue . PullRequest , ctx . User , message ) ; err != nil {
if err = pull_service . Update ( issue . PullRequest , ctx . User , message ) ; err != nil {
if models . IsErrMergeConflicts ( err ) {
if models . IsErrMergeConflicts ( err ) {
conflictError := err . ( models . ErrMergeConflicts )
conflictError := err . ( models . ErrMergeConflicts )
ctx . Flash . Error ( ctx . Tr ( "repo.pulls.merge_conflict" , utils . SanitizeFlashErrorString ( conflictError . StdErr ) , utils . SanitizeFlashErrorString ( conflictError . StdOut ) ) )
flashError , err := ctx . HTMLString ( string ( tplAlertDetails ) , map [ string ] interface { } {
"Message" : ctx . Tr ( "repo.pulls.merge_conflict" ) ,
"Summary" : ctx . Tr ( "repo.pulls.merge_conflict_summary" ) ,
"Details" : utils . SanitizeFlashErrorString ( conflictError . StdErr ) + "<br>" + utils . SanitizeFlashErrorString ( conflictError . StdOut ) ,
} )
if err != nil {
ctx . ServerError ( "UpdatePullRequest.HTMLString" , err )
return
}
ctx . Flash . Error ( flashError )
ctx . Redirect ( ctx . Repo . RepoLink + "/pulls/" + com . ToStr ( issue . Index ) )
ctx . Redirect ( ctx . Repo . RepoLink + "/pulls/" + com . ToStr ( issue . Index ) )
return
return
}
}
@ -846,12 +855,30 @@ func MergePullRequest(ctx *context.Context, form auth.MergePullRequestForm) {
return
return
} else if models . IsErrMergeConflicts ( err ) {
} else if models . IsErrMergeConflicts ( err ) {
conflictError := err . ( models . ErrMergeConflicts )
conflictError := err . ( models . ErrMergeConflicts )
ctx . Flash . Error ( ctx . Tr ( "repo.pulls.merge_conflict" , utils . SanitizeFlashErrorString ( conflictError . StdErr ) , utils . SanitizeFlashErrorString ( conflictError . StdOut ) ) )
flashError , err := ctx . HTMLString ( string ( tplAlertDetails ) , map [ string ] interface { } {
"Message" : ctx . Tr ( "repo.editor.merge_conflict" ) ,
"Summary" : ctx . Tr ( "repo.editor.merge_conflict_summary" ) ,
"Details" : utils . SanitizeFlashErrorString ( conflictError . StdErr ) + "<br>" + utils . SanitizeFlashErrorString ( conflictError . StdOut ) ,
} )
if err != nil {
ctx . ServerError ( "MergePullRequest.HTMLString" , err )
return
}
ctx . Flash . Error ( flashError )
ctx . Redirect ( ctx . Repo . RepoLink + "/pulls/" + com . ToStr ( pr . Index ) )
ctx . Redirect ( ctx . Repo . RepoLink + "/pulls/" + com . ToStr ( pr . Index ) )
return
return
} else if models . IsErrRebaseConflicts ( err ) {
} else if models . IsErrRebaseConflicts ( err ) {
conflictError := err . ( models . ErrRebaseConflicts )
conflictError := err . ( models . ErrRebaseConflicts )
ctx . Flash . Error ( ctx . Tr ( "repo.pulls.rebase_conflict" , utils . SanitizeFlashErrorString ( conflictError . CommitSHA ) , utils . SanitizeFlashErrorString ( conflictError . StdErr ) , utils . SanitizeFlashErrorString ( conflictError . StdOut ) ) )
flashError , err := ctx . HTMLString ( string ( tplAlertDetails ) , map [ string ] interface { } {
"Message" : ctx . Tr ( "repo.pulls.rebase_conflict" , utils . SanitizeFlashErrorString ( conflictError . CommitSHA ) ) ,
"Summary" : ctx . Tr ( "repo.pulls.rebase_conflict_summary" ) ,
"Details" : utils . SanitizeFlashErrorString ( conflictError . StdErr ) + "<br>" + utils . SanitizeFlashErrorString ( conflictError . StdOut ) ,
} )
if err != nil {
ctx . ServerError ( "MergePullRequest.HTMLString" , err )
return
}
ctx . Flash . Error ( flashError )
ctx . Redirect ( ctx . Repo . RepoLink + "/pulls/" + com . ToStr ( pr . Index ) )
ctx . Redirect ( ctx . Repo . RepoLink + "/pulls/" + com . ToStr ( pr . Index ) )
return
return
} else if models . IsErrMergeUnrelatedHistories ( err ) {
} else if models . IsErrMergeUnrelatedHistories ( err ) {
@ -871,7 +898,16 @@ func MergePullRequest(ctx *context.Context, form auth.MergePullRequestForm) {
if len ( message ) == 0 {
if len ( message ) == 0 {
ctx . Flash . Error ( ctx . Tr ( "repo.pulls.push_rejected_no_message" ) )
ctx . Flash . Error ( ctx . Tr ( "repo.pulls.push_rejected_no_message" ) )
} else {
} else {
ctx . Flash . Error ( ctx . Tr ( "repo.pulls.push_rejected" , utils . SanitizeFlashErrorString ( pushrejErr . Message ) ) )
flashError , err := ctx . HTMLString ( string ( tplAlertDetails ) , map [ string ] interface { } {
"Message" : ctx . Tr ( "repo.pulls.push_rejected" ) ,
"Summary" : ctx . Tr ( "repo.pulls.push_rejected_summary" ) ,
"Details" : utils . SanitizeFlashErrorString ( pushrejErr . Message ) ,
} )
if err != nil {
ctx . ServerError ( "MergePullRequest.HTMLString" , err )
return
}
ctx . Flash . Error ( flashError )
}
}
ctx . Redirect ( ctx . Repo . RepoLink + "/pulls/" + com . ToStr ( pr . Index ) )
ctx . Redirect ( ctx . Repo . RepoLink + "/pulls/" + com . ToStr ( pr . Index ) )
return
return
@ -986,7 +1022,16 @@ func CompareAndPullRequestPost(ctx *context.Context, form auth.CreateIssueForm)
if len ( message ) == 0 {
if len ( message ) == 0 {
ctx . Flash . Error ( ctx . Tr ( "repo.pulls.push_rejected_no_message" ) )
ctx . Flash . Error ( ctx . Tr ( "repo.pulls.push_rejected_no_message" ) )
} else {
} else {
ctx . Flash . Error ( ctx . Tr ( "repo.pulls.push_rejected" , utils . SanitizeFlashErrorString ( pushrejErr . Message ) ) )
flashError , err := ctx . HTMLString ( string ( tplAlertDetails ) , map [ string ] interface { } {
"Message" : ctx . Tr ( "repo.pulls.push_rejected" ) ,
"Summary" : ctx . Tr ( "repo.pulls.push_rejected_summary" ) ,
"Details" : utils . SanitizeFlashErrorString ( pushrejErr . Message ) ,
} )
if err != nil {
ctx . ServerError ( "CompareAndPullRequest.HTMLString" , err )
return
}
ctx . Flash . Error ( flashError )
}
}
ctx . Redirect ( ctx . Repo . RepoLink + "/pulls/" + com . ToStr ( pullIssue . Index ) )
ctx . Redirect ( ctx . Repo . RepoLink + "/pulls/" + com . ToStr ( pullIssue . Index ) )
return
return