Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf834dca

Browse files
committed
Edit file workflow for creating a fork and proposing changes
When viewing a file that the user can't edit because they can't write tothe branch, the edit button is no longer disabled.If no user fork of the repository exists, there is now a page create one.It will automatically create a fork with a single branch matching the onebeing viewed, and a unique repository name will be automatically picked.If the fork exists, an message will explain at the top of the edit pageexplaining that the changes will be applied to a branch in the fork. Thebase repository branch will be pushed to a new branch to the fork, andthen the edits will be applied on top.This all happens when accessing /_edit/, so that for example onlinedocumentation can have an "edit this page" link to the base repositorythat does the right thing.
1 parent2683adf commitf834dca

File tree

12 files changed

+337
-66
lines changed

12 files changed

+337
-66
lines changed

‎options/locale/locale_en-US.ini‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1334,7 +1334,6 @@ editor.cannot_edit_non_text_files = Binary files cannot be edited in the web int
13341334
editor.edit_this_file = Edit File
13351335
editor.this_file_locked = File is locked
13361336
editor.must_be_on_a_branch = You must be on a branch to make or propose changes to this file.
1337-
editor.fork_before_edit = You must fork this repository to make or propose changes to this file.
13381337
editor.delete_this_file = Delete File
13391338
editor.must_have_write_access = You must have write access to make or propose changes to this file.
13401339
editor.file_delete_success = File"%s" has been deleted.
@@ -1394,6 +1393,16 @@ editor.user_no_push_to_branch = User cannot push to branch
13941393
editor.require_signed_commit = Branch requires a signed commit
13951394
editor.cherry_pick = Cherry-pick %s onto:
13961395
editor.revert = Revert %s onto:
1396+
editor.fork_create = Fork Repository to Propose Changes
1397+
editor.fork_create_description = You can not edit this repository directly. Instead you can create a fork, make edits and create a pull request.
1398+
editor.fork_edit_description = You can not edit this repository directly. The changes will be written to your fork <b>%s</b>, so you can create a pull request.
1399+
editor.fork_failed_to_push_branch = Failed to push branch %s to your repoitory.
1400+
editor.cannot_find_editable_repo = Can not find repository to apply the edit to. Was it deleted while editing?
1401+
editor.fork_not_editable = Fork Repository Not Editable
1402+
editor.fork_internal_error = Internal error loading repository information about <b>%s</b>.
1403+
editor.fork_is_archived = Your repository <b>%s</b> is archived. Unarchive it in repository settings to make changes.
1404+
editor.fork_code_disabled = Code is disabled in your repository <b>%s</b>. Enable code in repository settings to make changes.
1405+
editor.fork_no_permission = You do not have permission to write to repository <b>%s</b>.
13971406
13981407
commits.desc = Browse source code change history.
13991408
commits.commits = Commits

‎routers/web/repo/cherry_pick.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ func CherryPick(ctx *context.Context) {
4747
ctx.Data["commit_message"]=splits[1]
4848
}
4949

50-
canCommit:=renderCommitRights(ctx)
50+
canCommit:=renderCommitRights(ctx,ctx.Repo.Repository)
5151
ctx.Data["TreePath"]=""
5252

5353
ifcanCommit {
5454
ctx.Data["commit_choice"]=frmCommitChoiceDirect
5555
}else {
5656
ctx.Data["commit_choice"]=frmCommitChoiceNewBranch
5757
}
58-
ctx.Data["new_branch_name"]=GetUniquePatchBranchName(ctx)
58+
ctx.Data["new_branch_name"]=GetUniquePatchBranchName(ctx,ctx.Repo.Repository)
5959
ctx.Data["last_commit"]=ctx.Repo.CommitID
6060
ctx.Data["LineWrapExtensions"]=strings.Join(setting.Repository.Editor.LineWrapExtensions,",")
6161
ctx.Data["BranchLink"]=ctx.Repo.RepoLink+"/src/"+ctx.Repo.RefTypeNameSubURL()
@@ -75,7 +75,7 @@ func CherryPickPost(ctx *context.Context) {
7575
ctx.Data["CherryPickType"]="cherry-pick"
7676
}
7777

78-
canCommit:=renderCommitRights(ctx)
78+
canCommit:=renderCommitRights(ctx,ctx.Repo.Repository)
7979
branchName:=ctx.Repo.BranchName
8080
ifform.CommitChoice==frmCommitChoiceNewBranch {
8181
branchName=form.NewBranchName

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp