···
stack, _ := r.Context().Value("stack").(models.Stack)
abandonedPulls, _ := r.Context().Value("abandonedPulls").([]*models.Pull)
139
-
for _, submission := range pull.Submissions {
140
-
totalIdents += len(submission.Comments)
143
-
identsToResolve := make([]string, totalIdents)
146
-
identsToResolve[0] = pull.OwnerDid
148
-
for _, submission := range pull.Submissions {
149
-
for _, comment := range submission.Comments {
150
-
identsToResolve[idx] = comment.OwnerDid
mergeCheckResponse := s.mergeCheck(r, f, pull, stack)
resubmitResult := pages.Unknown
if user != nil && user.Did == pull.OwnerDid {
···
377
-
patch := pull.Submissions[roundIdInt].Patch
360
+
patch := pull.Submissions[roundIdInt].CombinedPatch()
diff := patchutil.AsNiceDiff(patch, pull.TargetBranch)
s.pages.RepoPullPatchPage(w, pages.RepoPullPatchParams{
···
428
-
currentPatch, err := patchutil.AsDiff(pull.Submissions[roundIdInt].Patch)
411
+
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.")
435
-
previousPatch, err := patchutil.AsDiff(pull.Submissions[roundIdInt-1].Patch)
418
+
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)
620
-
pullAt, err := db.GetPullAt(s.db, f.RepoAt(), pull.PullId)
622
-
log.Println("failed to get pull at", err)
623
-
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{
639
-
Pull: string(pullAt),
615
+
Pull: pull.PullAt().String(),
···
sourceRev := comparison.Rev2
887
-
patch := comparison.Patch
863
+
patch := comparison.FormatPatchRaw
864
+
combined := comparison.CombinedPatchRaw
if !patchutil.IsPatchValid(patch) {
s.pages.Notice(w, "pull", "Invalid patch format. Please provide a valid diff.")
···
902
-
s.createPullRequest(w, r, f, user, title, body, targetBranch, patch, sourceRev, pullSource, recordPullSource, isStacked)
879
+
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) {
···
911
-
s.createPullRequest(w, r, f, user, title, body, targetBranch, patch, "", nil, nil, isStacked)
888
+
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
994
-
patch := comparison.Patch
971
+
patch := comparison.FormatPatchRaw
972
+
combined := comparison.CombinedPatchRaw
if !patchutil.IsPatchValid(patch) {
s.pages.Notice(w, "pull", "Invalid patch format. Please provide a valid diff.")
···
1014
-
s.createPullRequest(w, r, f, user, title, body, targetBranch, patch, sourceRev, pullSource, recordPullSource, isStacked)
992
+
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{
1058
+
Combined: combined,
···
patch := r.FormValue("patch")
1507
-
s.resubmitPullHelper(w, r, f, user, pull, patch, "")
1487
+
s.resubmitPullHelper(w, r, f, user, pull, patch, "", "")
func (s *Pulls) resubmitBranch(w http.ResponseWriter, r *http.Request) {
···
sourceRev := comparison.Rev2
1568
-
patch := comparison.Patch
1548
+
patch := comparison.FormatPatchRaw
1549
+
combined := comparison.CombinedPatchRaw
1570
-
s.resubmitPullHelper(w, r, f, user, pull, patch, sourceRev)
1551
+
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
1663
-
patch := comparison.Patch
1644
+
patch := comparison.FormatPatchRaw
1645
+
combined := comparison.CombinedPatchRaw
1665
-
s.resubmitPullHelper(w, r, f, user, pull, patch, sourceRev)
1647
+
s.resubmitPullHelper(w, r, f, user, pull, patch, combined, sourceRev)
// validate a resubmission against a pull request
···
···
1721
-
err = db.ResubmitPull(tx, pull, patch, sourceRev)
1704
+
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()]
1936
-
err := db.ResubmitPull(tx, op, submission.Patch, submission.SourceRev)
1919
+
err := db.ResubmitPull(tx, op, submission.Patch, submission.Combined, submission.SourceRev)
log.Println("failed to update pull", err, op.PullId)