···
stack, _ := r.Context().Value("stack").(models.Stack)
abandonedPulls, _ := r.Context().Value("abandonedPulls").([]*models.Pull)
150
-
for _, submission := range pull.Submissions {
151
-
totalIdents += len(submission.Comments)
154
-
identsToResolve := make([]string, totalIdents)
157
-
identsToResolve[0] = pull.OwnerDid
159
-
for _, submission := range pull.Submissions {
160
-
for _, comment := range submission.Comments {
161
-
identsToResolve[idx] = comment.OwnerDid
mergeCheckResponse := s.mergeCheck(r, f, pull, stack)
branchDeleteStatus := s.branchDeleteStatus(r, f, pull)
resubmitResult := pages.Unknown
···
463
-
patch := pull.Submissions[roundIdInt].Patch
446
+
patch := pull.Submissions[roundIdInt].CombinedPatch()
diff := patchutil.AsNiceDiff(patch, pull.TargetBranch)
s.pages.RepoPullPatchPage(w, pages.RepoPullPatchParams{
···
514
-
currentPatch, err := patchutil.AsDiff(pull.Submissions[roundIdInt].Patch)
497
+
currentPatch, err := patchutil.AsDiff(pull.Submissions[roundIdInt].CombinedPatch())
log.Println("failed to interdiff; current patch malformed")
s.pages.Notice(w, fmt.Sprintf("interdiff-error-%d", roundIdInt), "Failed to calculate interdiff; current patch is invalid.")
521
-
previousPatch, err := patchutil.AsDiff(pull.Submissions[roundIdInt-1].Patch)
504
+
previousPatch, err := patchutil.AsDiff(pull.Submissions[roundIdInt-1].CombinedPatch())
log.Println("failed to interdiff; previous patch malformed")
s.pages.Notice(w, fmt.Sprintf("interdiff-error-%d", roundIdInt), "Failed to calculate interdiff; previous patch is invalid.")
···
createdAt := time.Now().Format(time.RFC3339)
723
-
pullAt, err := db.GetPullAt(s.db, f.RepoAt(), pull.PullId)
725
-
log.Println("failed to get pull at", err)
726
-
s.pages.Notice(w, "pull-comment", "Failed to create comment.")
client, err := s.oauth.AuthorizedClient(r)
log.Println("failed to get authorized client", err)
···
Record: &lexutil.LexiconTypeDecoder{
Val: &tangled.RepoPullComment{
742
-
Pull: string(pullAt),
718
+
Pull: pull.PullAt().String(),
···
sourceRev := comparison.Rev2
990
-
patch := comparison.Patch
966
+
patch := comparison.FormatPatchRaw
967
+
combined := comparison.CombinedPatchRaw
if !patchutil.IsPatchValid(patch) {
s.pages.Notice(w, "pull", "Invalid patch format. Please provide a valid diff.")
···
1005
-
s.createPullRequest(w, r, f, user, title, body, targetBranch, patch, sourceRev, pullSource, recordPullSource, isStacked)
982
+
s.createPullRequest(w, r, f, user, title, body, targetBranch, patch, combined, sourceRev, pullSource, recordPullSource, isStacked)
func (s *Pulls) handlePatchBasedPull(w http.ResponseWriter, r *http.Request, f *reporesolver.ResolvedRepo, user *oauth.User, title, body, targetBranch, patch string, isStacked bool) {
···
1014
-
s.createPullRequest(w, r, f, user, title, body, targetBranch, patch, "", nil, nil, isStacked)
991
+
s.createPullRequest(w, r, f, user, title, body, targetBranch, patch, "", "", nil, nil, isStacked)
func (s *Pulls) handleForkBasedPull(w http.ResponseWriter, r *http.Request, f *reporesolver.ResolvedRepo, user *oauth.User, forkRepo string, title, body, targetBranch, sourceBranch string, isStacked bool) {
···
sourceRev := comparison.Rev2
1097
-
patch := comparison.Patch
1074
+
patch := comparison.FormatPatchRaw
1075
+
combined := comparison.CombinedPatchRaw
if !patchutil.IsPatchValid(patch) {
s.pages.Notice(w, "pull", "Invalid patch format. Please provide a valid diff.")
···
1117
-
s.createPullRequest(w, r, f, user, title, body, targetBranch, patch, sourceRev, pullSource, recordPullSource, isStacked)
1095
+
s.createPullRequest(w, r, f, user, title, body, targetBranch, patch, combined, sourceRev, pullSource, recordPullSource, isStacked)
func (s *Pulls) createPullRequest(
···
title, body, targetBranch string,
pullSource *models.PullSource,
recordPullSource *tangled.RepoPull_Source,
···
initialSubmission := models.PullSubmission{
1165
+
Combined: combined,
···
patch := r.FormValue("patch")
1615
-
s.resubmitPullHelper(w, r, f, user, pull, patch, "")
1595
+
s.resubmitPullHelper(w, r, f, user, pull, patch, "", "")
func (s *Pulls) resubmitBranch(w http.ResponseWriter, r *http.Request) {
···
sourceRev := comparison.Rev2
1676
-
patch := comparison.Patch
1656
+
patch := comparison.FormatPatchRaw
1657
+
combined := comparison.CombinedPatchRaw
1678
-
s.resubmitPullHelper(w, r, f, user, pull, patch, sourceRev)
1659
+
s.resubmitPullHelper(w, r, f, user, pull, patch, combined, sourceRev)
func (s *Pulls) resubmitFork(w http.ResponseWriter, r *http.Request) {
···
comparison := forkComparison
sourceRev := comparison.Rev2
1771
-
patch := comparison.Patch
1752
+
patch := comparison.FormatPatchRaw
1753
+
combined := comparison.CombinedPatchRaw
1773
-
s.resubmitPullHelper(w, r, f, user, pull, patch, sourceRev)
1755
+
s.resubmitPullHelper(w, r, f, user, pull, patch, combined, sourceRev)
// validate a resubmission against a pull request
···
···
1829
-
err = db.ResubmitPull(tx, pull, patch, sourceRev)
1812
+
err = db.ResubmitPull(tx, pull, patch, combined, sourceRev)
log.Println("failed to create pull request", err)
s.pages.Notice(w, "resubmit-error", "Failed to create pull request. Try again later.")
···
submission := np.Submissions[np.LastRoundNumber()]
2045
-
err := db.ResubmitPull(tx, op, submission.Patch, submission.SourceRev)
2028
+
err := db.ResubmitPull(tx, op, submission.Patch, submission.Combined, submission.SourceRev)
log.Println("failed to update pull", err, op.PullId)