@@ -1454,6 +1454,35 @@ func registerRoutes(m *web.Route) {
1454
1454
)
1455
1455
// end "/{username}/{reponame}/activity"
1456
1456
1457
+ m .Group ("/{username}/{reponame}" , func () {
1458
+ m .Group ("/pulls/{index}" , func () {
1459
+ m .Get ("" , repo .SetWhitespaceBehavior , repo .GetPullDiffStats , repo .ViewIssue )
1460
+ m .Get (".diff" , repo .DownloadPullDiff )
1461
+ m .Get (".patch" , repo .DownloadPullPatch )
1462
+ m .Group ("/commits" , func () {
1463
+ m .Get ("" , context .RepoRef (), repo .SetWhitespaceBehavior , repo .GetPullDiffStats , repo .ViewPullCommits )
1464
+ m .Get ("/list" , context .RepoRef (), repo .GetPullCommits )
1465
+ m .Get ("/{sha:[a-f0-9]{7,40}}" , context .RepoRef (), repo .SetEditorconfigIfExists , repo .SetDiffViewStyle , repo .SetWhitespaceBehavior , repo .SetShowOutdatedComments , repo .ViewPullFilesForSingleCommit )
1466
+ })
1467
+ m .Post ("/merge" , context .RepoMustNotBeArchived (), web .Bind (forms.MergePullRequestForm {}), repo .MergePullRequest )
1468
+ m .Post ("/cancel_auto_merge" , context .RepoMustNotBeArchived (), repo .CancelAutoMergePullRequest )
1469
+ m .Post ("/update" , repo .UpdatePullRequest )
1470
+ m .Post ("/set_allow_maintainer_edit" , web .Bind (forms.UpdateAllowEditsForm {}), repo .SetAllowEdits )
1471
+ m .Post ("/cleanup" , context .RepoMustNotBeArchived (), context .RepoRef (), repo .CleanUpPullRequest )
1472
+ m .Group ("/files" , func () {
1473
+ m .Get ("" , context .RepoRef (), repo .SetEditorconfigIfExists , repo .SetDiffViewStyle , repo .SetWhitespaceBehavior , repo .SetShowOutdatedComments , repo .ViewPullFilesForAllCommitsOfPr )
1474
+ m .Get ("/{sha:[a-f0-9]{7,40}}" , context .RepoRef (), repo .SetEditorconfigIfExists , repo .SetDiffViewStyle , repo .SetWhitespaceBehavior , repo .SetShowOutdatedComments , repo .ViewPullFilesStartingFromCommit )
1475
+ m .Get ("/{shaFrom:[a-f0-9]{7,40}}..{shaTo:[a-f0-9]{7,40}}" , context .RepoRef (), repo .SetEditorconfigIfExists , repo .SetDiffViewStyle , repo .SetWhitespaceBehavior , repo .SetShowOutdatedComments , repo .ViewPullFilesForRange )
1476
+ m .Group ("/reviews" , func () {
1477
+ m .Get ("/new_comment" , repo .RenderNewCodeCommentForm )
1478
+ m .Post ("/comments" , web .Bind (forms.CodeCommentForm {}), repo .SetShowOutdatedComments , repo .CreateCodeComment )
1479
+ m .Post ("/submit" , web .Bind (forms.SubmitReviewForm {}), repo .SubmitReview )
1480
+ }, context .RepoMustNotBeArchived ())
1481
+ })
1482
+ })
1483
+ }, ignSignIn , context .RepoAssignment , repo .MustAllowPulls , reqRepoPullsReader )
1484
+ // end "/{username}/{reponame}/pulls/{index}": repo pull request
1485
+
1457
1486
m .Group ("/{username}/{reponame}" , func () {
1458
1487
m .Group ("/activity_author_data" , func () {
1459
1488
m .Get ("" , repo .ActivityAuthors )
@@ -1492,32 +1521,6 @@ func registerRoutes(m *web.Route) {
1492
1521
return cancel
1493
1522
})
1494
1523
1495
- m .Group ("/pulls/{index}" , func () {
1496
- m .Get ("" , repo .SetWhitespaceBehavior , repo .GetPullDiffStats , repo .ViewIssue )
1497
- m .Get (".diff" , repo .DownloadPullDiff )
1498
- m .Get (".patch" , repo .DownloadPullPatch )
1499
- m .Group ("/commits" , func () {
1500
- m .Get ("" , context .RepoRef (), repo .SetWhitespaceBehavior , repo .GetPullDiffStats , repo .ViewPullCommits )
1501
- m .Get ("/list" , context .RepoRef (), repo .GetPullCommits )
1502
- m .Get ("/{sha:[a-f0-9]{7,40}}" , context .RepoRef (), repo .SetEditorconfigIfExists , repo .SetDiffViewStyle , repo .SetWhitespaceBehavior , repo .SetShowOutdatedComments , repo .ViewPullFilesForSingleCommit )
1503
- })
1504
- m .Post ("/merge" , context .RepoMustNotBeArchived (), web .Bind (forms.MergePullRequestForm {}), repo .MergePullRequest )
1505
- m .Post ("/cancel_auto_merge" , context .RepoMustNotBeArchived (), repo .CancelAutoMergePullRequest )
1506
- m .Post ("/update" , repo .UpdatePullRequest )
1507
- m .Post ("/set_allow_maintainer_edit" , web .Bind (forms.UpdateAllowEditsForm {}), repo .SetAllowEdits )
1508
- m .Post ("/cleanup" , context .RepoMustNotBeArchived (), context .RepoRef (), repo .CleanUpPullRequest )
1509
- m .Group ("/files" , func () {
1510
- m .Get ("" , context .RepoRef (), repo .SetEditorconfigIfExists , repo .SetDiffViewStyle , repo .SetWhitespaceBehavior , repo .SetShowOutdatedComments , repo .ViewPullFilesForAllCommitsOfPr )
1511
- m .Get ("/{sha:[a-f0-9]{7,40}}" , context .RepoRef (), repo .SetEditorconfigIfExists , repo .SetDiffViewStyle , repo .SetWhitespaceBehavior , repo .SetShowOutdatedComments , repo .ViewPullFilesStartingFromCommit )
1512
- m .Get ("/{shaFrom:[a-f0-9]{7,40}}..{shaTo:[a-f0-9]{7,40}}" , context .RepoRef (), repo .SetEditorconfigIfExists , repo .SetDiffViewStyle , repo .SetWhitespaceBehavior , repo .SetShowOutdatedComments , repo .ViewPullFilesForRange )
1513
- m .Group ("/reviews" , func () {
1514
- m .Get ("/new_comment" , repo .RenderNewCodeCommentForm )
1515
- m .Post ("/comments" , web .Bind (forms.CodeCommentForm {}), repo .SetShowOutdatedComments , repo .CreateCodeComment )
1516
- m .Post ("/submit" , web .Bind (forms.SubmitReviewForm {}), repo .SubmitReview )
1517
- }, context .RepoMustNotBeArchived ())
1518
- })
1519
- }, repo .MustAllowPulls )
1520
-
1521
1524
m .Group ("/media" , func () {
1522
1525
m .Get ("/branch/*" , context .RepoRefByType (context .RepoRefBranch ), repo .SingleDownloadOrLFS )
1523
1526
m .Get ("/tag/*" , context .RepoRefByType (context .RepoRefTag ), repo .SingleDownloadOrLFS )
0 commit comments