···
stack, _ := r.Context().Value("stack").(models.Stack)
abandonedPulls, _ := r.Context().Value("abandonedPulls").([]*models.Pull)
146
-
for _, submission := range pull.Submissions {
147
-
totalIdents += len(submission.Comments)
150
-
identsToResolve := make([]string, totalIdents)
153
-
identsToResolve[0] = pull.OwnerDid
155
-
for _, submission := range pull.Submissions {
156
-
for _, comment := range submission.Comments {
157
-
identsToResolve[idx] = comment.OwnerDid
mergeCheckResponse := s.mergeCheck(r, f, pull, stack)
branchDeleteStatus := s.branchDeleteStatus(r, f, pull)
resubmitResult := pages.Unknown
···
459
-
patch := pull.Submissions[roundIdInt].Patch
442
+
patch := pull.Submissions[roundIdInt].CombinedPatch()
diff := patchutil.AsNiceDiff(patch, pull.TargetBranch)
s.pages.RepoPullPatchPage(w, pages.RepoPullPatchParams{
···
510
-
currentPatch, err := patchutil.AsDiff(pull.Submissions[roundIdInt].Patch)
493
+
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.")
517
-
previousPatch, err := patchutil.AsDiff(pull.Submissions[roundIdInt-1].Patch)
500
+
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)
719
-
pullAt, err := db.GetPullAt(s.db, f.RepoAt(), pull.PullId)
721
-
log.Println("failed to get pull at", err)
722
-
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{
738
-
Pull: string(pullAt),
714
+
Pull: pull.PullAt().String(),
···
sourceRev := comparison.Rev2
986
-
patch := comparison.Patch
962
+
patch := comparison.FormatPatchRaw
963
+
combined := comparison.CombinedPatchRaw
if !patchutil.IsPatchValid(patch) {
s.pages.Notice(w, "pull", "Invalid patch format. Please provide a valid diff.")
···
1001
-
s.createPullRequest(w, r, f, user, title, body, targetBranch, patch, sourceRev, pullSource, recordPullSource, isStacked)
978
+
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) {
···
1010
-
s.createPullRequest(w, r, f, user, title, body, targetBranch, patch, "", nil, nil, isStacked)
987
+
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
1093
-
patch := comparison.Patch
1070
+
patch := comparison.FormatPatchRaw
1071
+
combined := comparison.CombinedPatchRaw
if !patchutil.IsPatchValid(patch) {
s.pages.Notice(w, "pull", "Invalid patch format. Please provide a valid diff.")
···
1113
-
s.createPullRequest(w, r, f, user, title, body, targetBranch, patch, sourceRev, pullSource, recordPullSource, isStacked)
1091
+
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{
1161
+
Combined: combined,
···
patch := r.FormValue("patch")
1611
-
s.resubmitPullHelper(w, r, f, user, pull, patch, "")
1591
+
s.resubmitPullHelper(w, r, f, user, pull, patch, "", "")
func (s *Pulls) resubmitBranch(w http.ResponseWriter, r *http.Request) {
···
sourceRev := comparison.Rev2
1672
-
patch := comparison.Patch
1652
+
patch := comparison.FormatPatchRaw
1653
+
combined := comparison.CombinedPatchRaw
1674
-
s.resubmitPullHelper(w, r, f, user, pull, patch, sourceRev)
1655
+
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
1767
-
patch := comparison.Patch
1748
+
patch := comparison.FormatPatchRaw
1749
+
combined := comparison.CombinedPatchRaw
1769
-
s.resubmitPullHelper(w, r, f, user, pull, patch, sourceRev)
1751
+
s.resubmitPullHelper(w, r, f, user, pull, patch, combined, sourceRev)
// validate a resubmission against a pull request
···
···
1825
-
err = db.ResubmitPull(tx, pull, patch, sourceRev)
1808
+
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()]
2041
-
err := db.ResubmitPull(tx, op, submission.Patch, submission.SourceRev)
2024
+
err := db.ResubmitPull(tx, op, submission.Patch, submission.Combined, submission.SourceRev)
log.Println("failed to update pull", err, op.PullId)