Monorepo for Tangled tangled.org

appview,knotserver: produce combined patch in comparisons #609

merged opened by oppi.li targeting master from push-tvqsxkkxqolv

this is calculated by the knotserver in sh.tangled.repo.compare and cached by the appview in pull submissions, this cannot be calculated on the appview side with just the format-patch because this calculation requires a git-index.

Signed-off-by: oppiliappan me@oppi.li

Labels
bugfix
assignee

None yet.

Participants 1
AT URI
at://did:plc:qfpnj4og54vl56wngdriaxug/sh.tangled.repo.pull/3lzswvlrm7m22
+19 -17
Interdiff #2 #3
appview/db/db.go

This file has not been changed.

appview/db/pulls.go

This patch was likely rebased, as context lines do not match.

+19 -17
appview/models/pull.go
··· 125 // content 126 RoundNumber int 127 Patch string 128 Comments []PullComment 129 SourceRev string // include the rev that was used to create this submission: only for branch/fork PRs 130 ··· 134 // content 135 RoundNumber int 136 Patch string 137 - Combined string 138 Comments []PullComment 139 SourceRev string // include the rev that was used to create this submission: only for branch/fork PRs 140 ··· 151 Created time.Time 152 } 153 154 func (p *Pull) LatestPatch() string { 155 - latestSubmission := p.Submissions[p.LastRoundNumber()] 156 - return latestSubmission.Patch 157 } 158 159 func (p *Pull) LatestSha() string { 160 - latestSubmission := p.Submissions[p.LastRoundNumber()] 161 - return latestSubmission.SourceRev 162 } 163 164 func (p *Pull) PullAt() syntax.ATURI { 165 return syntax.ATURI(fmt.Sprintf("at://%s/%s/%s", p.OwnerDid, tangled.RepoPullNSID, p.Rkey)) 166 } 167 168 - func (p *Pull) LastRoundNumber() int { 169 - return len(p.Submissions) - 1 170 - } 171 - 172 func (p *Pull) IsPatchBased() bool { 173 return p.PullSource == nil 174 } ··· 255 return participants 256 } 257 258 type Stack []*Pull 259 260 // position of this pull in the stack ··· 262 263 264 return participants 265 - } 266 - 267 - func (s PullSubmission) CombinedPatch() string { 268 - if s.Combined == "" { 269 - return s.Patch 270 - } 271 - 272 - return s.Combined 273 } 274 275 type Stack []*Pull
··· 125 // content 126 RoundNumber int 127 Patch string 128 + Combined string 129 Comments []PullComment 130 SourceRev string // include the rev that was used to create this submission: only for branch/fork PRs 131 ··· 135 // content 136 RoundNumber int 137 Patch string 138 Comments []PullComment 139 SourceRev string // include the rev that was used to create this submission: only for branch/fork PRs 140 ··· 151 Created time.Time 152 } 153 154 + func (p *Pull) LastRoundNumber() int { 155 + return len(p.Submissions) - 1 156 + } 157 + 158 + func (p *Pull) LatestSubmission() *PullSubmission { 159 + return p.Submissions[p.LastRoundNumber()] 160 + } 161 + 162 func (p *Pull) LatestPatch() string { 163 + return p.LatestSubmission().Patch 164 } 165 166 func (p *Pull) LatestSha() string { 167 + return p.LatestSubmission().SourceRev 168 } 169 170 func (p *Pull) PullAt() syntax.ATURI { 171 return syntax.ATURI(fmt.Sprintf("at://%s/%s/%s", p.OwnerDid, tangled.RepoPullNSID, p.Rkey)) 172 } 173 174 func (p *Pull) IsPatchBased() bool { 175 return p.PullSource == nil 176 } ··· 257 return participants 258 } 259 260 + func (s PullSubmission) CombinedPatch() string { 261 + if s.Combined == "" { 262 + return s.Patch 263 + } 264 + 265 + return s.Combined 266 + } 267 + 268 type Stack []*Pull 269 270 // position of this pull in the stack ··· 272 273 274 return participants 275 } 276 277 type Stack []*Pull
appview/pulls/pulls.go

This patch was likely rebased, as context lines do not match.

appview/repo/repo.go

This file has not been changed.

knotserver/xrpc/repo_compare.go

This file has not been changed.

types/repo.go

This file has not been changed.

History

4 rounds 0 comments
sign up or login to add to the discussion
oppi.li submitted #3
1 commit
expand
appview,knotserver: produce combined patch in comparisons
3/3 success
expand
expand 0 comments
pull request successfully merged
1 commit
expand
appview,knotserver: produce combined patch in comparisons
3/3 success
expand
expand 0 comments
1 commit
expand
appview,knotserver: produce combined patch in comparisons
3/3 success
expand
expand 0 comments
oppi.li submitted #0
1 commit
expand
appview,knotserver: produce combined patch in comparisons
expand 0 comments