|
|
@ -456,6 +456,12 @@ func ViewPullFiles(ctx *context.Context) { |
|
|
|
ctx.ServerError("GetDiffRange", err) |
|
|
|
ctx.ServerError("GetDiffRange", err) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if err = diff.LoadComments(issue, ctx.User); err != nil { |
|
|
|
|
|
|
|
ctx.ServerError("LoadComments", err) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ctx.Data["Diff"] = diff |
|
|
|
ctx.Data["Diff"] = diff |
|
|
|
ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0 |
|
|
|
ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0 |
|
|
|
|
|
|
|
|
|
|
@ -470,13 +476,6 @@ func ViewPullFiles(ctx *context.Context) { |
|
|
|
ctx.Data["BeforeSourcePath"] = setting.AppSubURL + "/" + path.Join(headTarget, "src", "commit", startCommitID) |
|
|
|
ctx.Data["BeforeSourcePath"] = setting.AppSubURL + "/" + path.Join(headTarget, "src", "commit", startCommitID) |
|
|
|
ctx.Data["RawPath"] = setting.AppSubURL + "/" + path.Join(headTarget, "raw", "commit", endCommitID) |
|
|
|
ctx.Data["RawPath"] = setting.AppSubURL + "/" + path.Join(headTarget, "raw", "commit", endCommitID) |
|
|
|
ctx.Data["RequireHighlightJS"] = true |
|
|
|
ctx.Data["RequireHighlightJS"] = true |
|
|
|
|
|
|
|
|
|
|
|
pathToLineToComment, err := models.FetchCodeComments(issue, ctx.User) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
ctx.ServerError("FetchCodeComments", err) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
ctx.Data["CodeComments"] = pathToLineToComment |
|
|
|
|
|
|
|
ctx.Data["CurrentReview"], err = models.GetCurrentReview(ctx.User, issue) |
|
|
|
ctx.Data["CurrentReview"], err = models.GetCurrentReview(ctx.User, issue) |
|
|
|
if err != nil && !models.IsErrReviewNotExist(err) { |
|
|
|
if err != nil && !models.IsErrReviewNotExist(err) { |
|
|
|
ctx.ServerError("GetCurrentReview", err) |
|
|
|
ctx.ServerError("GetCurrentReview", err) |
|
|
|