···
stack, _ := r.Context().Value("stack").(models.Stack)
abandonedPulls, _ := r.Context().Value("abandonedPulls").([]*models.Pull)
149
-
for _, submission := range pull.Submissions {
150
-
totalIdents += len(submission.Comments)
153
-
identsToResolve := make([]string, totalIdents)
156
-
identsToResolve[0] = pull.OwnerDid
158
-
for _, submission := range pull.Submissions {
159
-
for _, comment := range submission.Comments {
160
-
identsToResolve[idx] = comment.OwnerDid
mergeCheckResponse := s.mergeCheck(r, f, pull, stack)
branchDeleteStatus := s.branchDeleteStatus(r, f, pull)
resubmitResult := pages.Unknown
···
462
-
patch := pull.Submissions[roundIdInt].Patch
445
+
patch := pull.Submissions[roundIdInt].CombinedPatch()
diff := patchutil.AsNiceDiff(patch, pull.TargetBranch)
s.pages.RepoPullPatchPage(w, pages.RepoPullPatchParams{
···
513
-
currentPatch, err := patchutil.AsDiff(pull.Submissions[roundIdInt].Patch)
496
+
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.")
520
-
previousPatch, err := patchutil.AsDiff(pull.Submissions[roundIdInt-1].Patch)
503
+
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)
722
-
pullAt, err := db.GetPullAt(s.db, f.RepoAt(), pull.PullId)
724
-
log.Println("failed to get pull at", err)
725
-
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{
741
-
Pull: string(pullAt),
717
+
Pull: pull.PullAt().String(),
···
sourceRev := comparison.Rev2
989
-
patch := comparison.Patch
965
+
patch := comparison.FormatPatchRaw
966
+
combined := comparison.CombinedPatchRaw
if !patchutil.IsPatchValid(patch) {
s.pages.Notice(w, "pull", "Invalid patch format. Please provide a valid diff.")
···
1004
-
s.createPullRequest(w, r, f, user, title, body, targetBranch, patch, sourceRev, pullSource, recordPullSource, isStacked)
981
+
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) {
···
1013
-
s.createPullRequest(w, r, f, user, title, body, targetBranch, patch, "", nil, nil, isStacked)
990
+
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
1096
-
patch := comparison.Patch
1073
+
patch := comparison.FormatPatchRaw
1074
+
combined := comparison.CombinedPatchRaw
if !patchutil.IsPatchValid(patch) {
s.pages.Notice(w, "pull", "Invalid patch format. Please provide a valid diff.")
···
1116
-
s.createPullRequest(w, r, f, user, title, body, targetBranch, patch, sourceRev, pullSource, recordPullSource, isStacked)
1094
+
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{
1164
+
Combined: combined,
···
patch := r.FormValue("patch")
1614
-
s.resubmitPullHelper(w, r, f, user, pull, patch, "")
1594
+
s.resubmitPullHelper(w, r, f, user, pull, patch, "", "")
func (s *Pulls) resubmitBranch(w http.ResponseWriter, r *http.Request) {
···
sourceRev := comparison.Rev2
1675
-
patch := comparison.Patch
1655
+
patch := comparison.FormatPatchRaw
1656
+
combined := comparison.CombinedPatchRaw
1677
-
s.resubmitPullHelper(w, r, f, user, pull, patch, sourceRev)
1658
+
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
1770
-
patch := comparison.Patch
1751
+
patch := comparison.FormatPatchRaw
1752
+
combined := comparison.CombinedPatchRaw
1772
-
s.resubmitPullHelper(w, r, f, user, pull, patch, sourceRev)
1754
+
s.resubmitPullHelper(w, r, f, user, pull, patch, combined, sourceRev)
// validate a resubmission against a pull request
···
···
newRoundNumber := len(pull.Submissions)
newSourceRev := sourceRev
1832
-
err = db.ResubmitPull(tx, pullAt, newRoundNumber, newPatch, newSourceRev)
1815
+
combinedPatch := combined
1816
+
err = db.ResubmitPull(tx, pullAt, newRoundNumber, newPatch, combinedPatch, newSourceRev)
log.Println("failed to create pull request", err)
s.pages.Notice(w, "resubmit-error", "Failed to create pull request. Try again later.")
···
newRoundNumber := len(op.Submissions)
newPatch := np.LatestPatch()
2011
+
combinedPatch := np.LatestSubmission().Combined
newSourceRev := np.LatestSha()
2028
-
err := db.ResubmitPull(tx, pullAt, newRoundNumber, newPatch, newSourceRev)
2013
+
err := db.ResubmitPull(tx, pullAt, newRoundNumber, newPatch, combinedPatch, newSourceRev)
log.Println("failed to update pull", err, op.PullId)
s.pages.Notice(w, "pull-resubmit-error", "Failed to resubmit pull request. Try again later.")
···
initialSubmission := models.PullSubmission{