diff options
author | zeripath <art27@cantab.net> | 2022-02-09 20:28:55 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-09 20:28:55 +0000 |
commit | eb748f5f3c93e8e347309fc75ea8273c06a5489b (patch) | |
tree | fceec474a21fa35437bcf3e90bd549c11976b72e /templates/repo/editor/cherry_pick.tmpl | |
parent | 439ad34c71b8777a9dac369c643560b18bc41bab (diff) | |
download | gitea-eb748f5f3c93e8e347309fc75ea8273c06a5489b.tar.gz gitea-eb748f5f3c93e8e347309fc75ea8273c06a5489b.zip |
Add apply-patch, basic revert and cherry-pick functionality (#17902)
This code adds a simple endpoint to apply patches to repositories and
branches on gitea. This is then used along with the conflicting checking
code in #18004 to provide a basic implementation of cherry-pick revert.
Now because the buttons necessary for cherry-pick and revert have
required us to create a dropdown next to the Browse Source button
I've also implemented Create Branch and Create Tag operations.
Fix #3880
Fix #17986
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'templates/repo/editor/cherry_pick.tmpl')
-rw-r--r-- | templates/repo/editor/cherry_pick.tmpl | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/templates/repo/editor/cherry_pick.tmpl b/templates/repo/editor/cherry_pick.tmpl new file mode 100644 index 0000000000..9cdda2ea83 --- /dev/null +++ b/templates/repo/editor/cherry_pick.tmpl @@ -0,0 +1,32 @@ +{{template "base/head" .}} +<div class="page-content repository file editor edit"> + {{template "repo/header" .}} + <div class="ui container"> + {{template "base/alert" .}} + <form class="ui edit form" method="post" action="{{.RepoLink}}/_cherrypick/{{.SHA}}/{{.BranchName | PathEscapeSegments}}"> + {{.CsrfTokenHtml}} + <input type="hidden" name="last_commit" value="{{.last_commit}}"> + <input type="hidden" name="page_has_posted" value="true"> + <input type="hidden" name="revert" value="{{if eq .CherryPickType "revert"}}true{{else}}false{{end}}"> + <div class="ui secondary menu"> + <div class="fitted item treepath"> + <div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}"> + {{$shaurl := printf "%s/commit/%s" $.RepoLink (PathEscape .SHA)}} + {{$shalink := printf "<a class=\"ui blue sha label\" href=\"%s\">%s</a>" (Escape $shaurl) (ShortSha .SHA)}} + {{if eq .CherryPickType "revert"}} + {{.i18n.Tr "repo.editor.revert" $shalink | Str2html}} + {{else}} + {{.i18n.Tr "repo.editor.cherry_pick" $shalink | Str2html}} + {{end}} + <a class="section" href="{{$.RepoLink}}">{{.Repository.FullName}}</a> + <div class="divider">:</div> + <a class="section" href="{{$.BranchLink}}">{{.BranchName}}</a> + <span>{{.i18n.Tr "repo.editor.or"}} <a href="{{$shaurl}}">{{.i18n.Tr "repo.editor.cancel_lower"}}</a></span> + </div> + </div> + </div> + {{template "repo/editor/commit_form" .}} + </form> + </div> +</div> +{{template "base/footer" .}} |