aboutsummaryrefslogtreecommitdiffstats
path: root/services/pull/pull.go
Commit message (Collapse)AuthorAgeFilesLines
* Add buttons to allow loading of incomplete diffs (#16829)zeripath2021-10-151-1/+1
| | | | | | | | | | | | | | | | | This PR adds two buttons to the stats and the end of the diffs list to load the (some of) the remaining incomplete diff sections. Contains #16775 Signed-off-by: Andrew Thornton <art27@cantab.net> ## Screenshots ### Show more button at the end of the diff ![Screenshot from 2021-09-04 11-12-37](https://user-images.githubusercontent.com/1824502/132091009-b1f6113e-2c04-4be5-8a04-b8ecea56887b.png) ### Show more button at the end of the diff stats box ![Screenshot from 2021-09-04 11-14-54](https://user-images.githubusercontent.com/1824502/132091063-86da5a6d-6628-4b82-bea9-3655cd9f40f6.png)
* Support direct comparison (git diff a..b) as well merge comparison (a...b) ↵zeripath2021-09-271-1/+1
| | | | | | | | | | | | (#16635) This PR changes the compare page to make the "..." in the between branches a clickable link. This changes the comparison type from "..." to "..". Similarly it makes the initial compare icon clickable to switch the head and base branches. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Move login related structs and functions to models/login (#17093)Lunny Xiao2021-09-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move login related structs and functions to models/login * Fix test * Fix lint * Fix lint * Fix lint of windows * Fix lint * Fix test * Fix test * Only load necessary fixtures when preparing unit tests envs * Fix lint * Fix test * Fix test * Fix error log * Fix error log * Fix error log * remove unnecessary change * fix error log * merge main branch
* DBContext is just a Context (#17100)zeripath2021-09-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * DBContext is just a Context This PR removes some of the specialness from the DBContext and makes it context This allows us to simplify the GetEngine code to wrap around any context in future and means that we can change our loadRepo(e Engine) functions to simply take contexts. Signed-off-by: Andrew Thornton <art27@cantab.net> * fix unit tests Signed-off-by: Andrew Thornton <art27@cantab.net> * another place that needs to set the initial context Signed-off-by: Andrew Thornton <art27@cantab.net> * avoid race Signed-off-by: Andrew Thornton <art27@cantab.net> * change attachment error Signed-off-by: Andrew Thornton <art27@cantab.net>
* Move db related basic functions to models/db (#17075)Lunny Xiao2021-09-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | * Move db related basic functions to models/db * Fix lint * Fix lint * Fix test * Fix lint * Fix lint * revert unnecessary change * Fix test * Fix wrong replace string * Use *Context * Correct committer spelling and fix wrong replaced words Co-authored-by: zeripath <art27@cantab.net>
* Replace `list.List` with slices (#16311)KN4CK3R2021-08-091-18/+14
| | | | | | | | | | | | | | | | | | | * Replaced list with slice. * Fixed usage of pointer to temporary variable. * Replaced LIFO list with slice. * Lint * Removed type check. * Removed duplicated code. * Lint * Fixed merge. Co-authored-by: 6543 <6543@obermui.de>
* Add agit flow support in gitea (#14295)a10121127962021-07-281-8/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feature: add agit flow support ref: https://git-repo.info/en/2020/03/agit-flow-and-git-repo/ example: ```Bash git checkout -b test echo "test" >> README.md git commit -m "test" git push origin HEAD:refs/for/master -o topic=test ``` Signed-off-by: a1012112796 <1012112796@qq.com> * fix lint * simplify code add fix some nits * update merge help message * Apply suggestions from code review. Thanks @jiangxin * add forced-update message * fix lint * splite writePktLine * add refs/for/<target-branch>/<topic-branch> support also * Add test code add fix api * fix lint * fix test * skip test if git version < 2.29 * try test with git 2.30.1 * fix permission check bug * fix some nit * logic implify and test code update * fix bug * apply suggestions from code review * prepare for merge Signed-off-by: Andrew Thornton <art27@cantab.net> * fix permission check bug - test code update - apply suggestions from code review @zeripath Signed-off-by: a1012112796 <1012112796@qq.com> * fix bug when target branch isn't exist * prevent some special push and fix some nits * fix lint * try splite * Apply suggestions from code review - fix permission check - handle user rename * fix version negotiation * remane * fix template * handle empty repo * ui: fix branch link under the title * fix nits Co-authored-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add an abstract json layout to make it's easier to change json library (#16528)Lunny Xiao2021-07-241-2/+1
| | | | | | | | | | | * Add an abstract json layout to make it's easier to change json library * Fix import * Fix import sequence * Fix blank lines * Fix blank lines
* Add checkbox to delete pull branch after successful merge (#16049)Jimmy Praet2021-07-131-1/+5
| | | | | | | | | | | | | | | | | | | | | | | * Add checkbox to delete pull branch after successful merge * Omit DeleteBranchAfterMerge field in json * Log a warning instead of error when PR head branch deleted * Add DefaultDeleteBranchAfterMerge to PullRequestConfig * Add support for delete_branch_after_merge via API * Fix for API: the branch should be deleted from the HEAD repo If head and base repo are the same, reuse the already opened ctx.Repo.GitRepo * Don't delegate to CleanupBranch, only reuse branch deletion code CleanupBranch contains too much logic that has already been performed by the Merge * Reuse gitrepo in MergePullRequest Co-authored-by: Andrew Thornton <art27@cantab.net>
* Append to existing trailers in generated squash commit message (#15980)Jimmy Praet2021-06-251-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | * Remove superfluous newline before Co-authored-by trailers * Append to existing PR description trailer section If the existing PR description message already contains a trailer section (e.g. Signed-off-by: ), append to it instead of creating a new trailer section. * Reuse compiled regexp * Simplify regex and deal with trailing \n in PR description * Add tests for CommitMessageTrailersPattern - add support for Key:Value (no space after colon) - add support for whitespace "folding" * Update services/pull/pull_test.go Co-authored-by: Norwin <noerw@users.noreply.github.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Norwin <noerw@users.noreply.github.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix 500 Error with branch and tag sharing the same name #15592 (#16040)Viktor Yakovchuk2021-06-231-1/+13
| | | | | | | | | | | | | | | * Fix 500 Error with branch and tag sharing the same name #15592 Fixed 500 error while create Pull request when there are more than one sources (branch, tag) with the same name Fix #15592 Signed-off-by: Viktor Yakovchuk <viktor@yakovchuk.net> * fix logging Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: 6543 <6543@obermui.de>
* Reintroduce squash merge default comment as a config setting (#16134)parnic2021-06-191-4/+32
| | | | | | | * Reinstate most of commit 09304db9a5d88c035a96f74a4544572bc8c5dac0 * Move the behaviour behind a config setting * Also fix the initial #12365
* Only log Error on getLastCommitStatus error to let pull list still be ↵65432021-05-041-1/+2
| | | | visible (#15716)
* Performance improvement for list pull requests (#15447)Lunny Xiao2021-04-151-10/+50
|
* Migrate to use jsoniter instead of encoding/json (#14841)zeripath2021-03-011-1/+2
| | | | | | | | | | * Migrate to use jsoniter * fix tests * update gitea.com/go-chi/binding Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* When Deleting Repository only explicitly close PRs whose base is not this ↵zeripath2021-03-011-1/+6
| | | | | | | | | repository (#14823) When Deleting Repository only explicitly close PRs whose base is not this repository Fix #14775 Signed-off-by: Andrew Thornton <art27@cantab.net>
* [API] Add pagination to ListBranches (#14524)65432021-02-031-1/+1
| | | | | | | | | | | | | | | | | | * make PaginateUserSlice generic -> PaginateSlice * Add pagination to ListBranches * add skip, limit to Repository.GetBranches() * Move routers/api/v1/utils/utils PaginateSlice -> modules/util/paginate.go * repo_module.GetBranches paginate * fix & rename & more logging * better description Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: a1012112796 <1012112796@qq.com>
* label and milestone webhooks on issue/pull creation (#14363)Jimmy Praet2021-01-171-0/+6
|
* Some code improvements (#14266)Lunny Xiao2021-01-061-0/+4
|
* Send notifications for mentions in pulls, issues, (code-)comments (#14218)Jimmy Praet2021-01-021-1/+6
| | | | | Fixes #14187: mention handling extracted from email notification code Fixes #14013: add notification for mentions in pull request code comments Fixes #13450: Not receiving any emails with setting "Only Email on Mention"
* migrate from com.* to alternatives (#14103)65432020-12-251-3/+1
| | | | | | | | | | | | | | | * remove github.com/unknwon/com from models * dont use "com.ToStr()" * replace "com.ToStr" with "fmt.Sprint" where its easy to do * more refactor * fix test * just "proxy" Copy func for now * as per @lunny
* Use the text of pull-request as the squash commit's message (#13071)Mura Li2020-12-211-21/+9
| | | | | | | | | | | Originally, it was filled by the commit messages of the involved commits. In this change, we use the headline comment of the pull request as the commit message when it is a squash merge. Thanks to @zeripath for suggesting the idea. Fixes #12365 Co-authored-by: Mura Li <typeless@users.noreply.github.com>
* Show dropdown with all statuses for commit (#13977)Cirno the Strongest2020-12-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Show dropdown with all statuses for commit * Use popups * Remove unnecessary change * Style popup * Use divided list * As per @silverwind * Refactor GetLastCommitStatus * Missing dropdown on repo home and commit page * Fix tests * Make status icon be a part of a link on PR list * Fix missing translation call * Indent fix Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Show status check for merged PRs (#13975)Cirno the Strongest2020-12-181-12/+9
| | | | | | | | | | | * Show status check for merged PRs * Handle PRs with no commits * Styling Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: 6543 <6543@obermui.de>
* [Refactor] CombinedStatus and CommitStatus related functions & structs (#14026)65432020-12-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * RM unused struct * rename (*CommitStatus) loadRepo() -> loadAttributes() * move ToCommitStatus into its own file * use CommitStatusState instead of StatusState * move CombinedStatus convertion into convert package * let models.GetLatestCommitStatus use repoID direct and accept ListOptions * update swagger docs * fix tests * Fix swagger docs * rm page * fix swagger docs!!! * return json null * always return json * rename api.Status to api.CommitStatus * fix swagger docs * sec swagger fix
* Increment skip to avoid infini-loop (#13703)John Olheiser2020-11-271-1/+1
| | | | | Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv>
* Use chronological commit order in default squash message (#13661) (#13696)Jimmy Praet2020-11-251-2/+3
|
* [Enhancement] Allow admin to merge pr with protected file changes (#12078)赵智超2020-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [Enhancement] Allow admin to merge pr with protected file changes As tilte, show protected message in diff page and merge box. Signed-off-by: a1012112796 <1012112796@qq.com> * remove unused ver * Update options/locale/locale_en-US.ini Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com> * Add TrN * Apply suggestions from code review * fix lint * Update options/locale/locale_en-US.ini Co-authored-by: zeripath <art27@cantab.net> * Apply suggestions from code review * move pr proteced files check to TestPatch * Call TestPatch when protected branches settings changed * Apply review suggestion @CirnoT * move to service @lunny * slightly restructure routers/private/hook.go Adds a lot of comments and simplifies the logic Signed-off-by: Andrew Thornton <art27@cantab.net> * placate lint Signed-off-by: Andrew Thornton <art27@cantab.net> * skip duplicate protected files check * fix check logic * slight refactor of TestPatch Signed-off-by: Andrew Thornton <art27@cantab.net> * When checking for protected files changes in TestPatch use the temporary repository Signed-off-by: Andrew Thornton <art27@cantab.net> * fix introduced issue with hook Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove the check on PR index being greater than 0 as it unnecessary Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Stop cloning unnecessarily on PR update (#12839)zeripath2020-09-141-60/+17
| | | | | | | | | | | | | | | | | * Stop cloning unnecessarily on PR update Fix #12740 Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove unnecessary delete Signed-off-by: Andrew Thornton <art27@cantab.net> * fix lint Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix git open close bug (#12834)Lunny Xiao2020-09-141-3/+3
|
* Re-attempt to delete temporary upload if the file is locked by another ↵zeripath2020-08-111-2/+2
| | | | | | | | | | | process (#12447) Replace all calls to os.Remove/os.RemoveAll by retrying util.Remove/util.RemoveAll and remove circular dependencies from util. Fix #12339 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: silverwind <me@silverwind.io>
* Update CommitsAhead CommitsBehind on Pull BaseBranch Change too (#11912)65432020-06-161-1/+10
|
* Handle more pathological branch and tag names (#11843)zeripath2020-06-111-1/+1
| | | | | | | | | | | * Handle more pathological branch and tag names Signed-off-by: Andrew Thornton <art27@cantab.net> * Fix failing test Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Ensure rejected push to refs/pull/index/head fails nicely (#11724)zeripath2020-06-081-0/+10
| | | | | | | | | | A pre-receive hook that rejects pushes to refs/pull/index/head will cause a broken PR which causes an internal server error whenever it is viewed. This PR handles prevents the internal server error by handling non-existent pr heads and sends a flash error informing the creator there was a problem. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add push commits history comment on PR time-line (#11167)赵智超2020-05-201-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add push commits history comment on PR time-line * Add notify by email and ui of this comment type also Signed-off-by: a1012112796 <1012112796@qq.com> * Add migrations for IsForcePush * fix wrong force-push judgement * Apply suggestions from code review * Remove commit number check * add own notify fun * fix some typo Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> * fix lint * fix style again, I forgot something before * Change email notify way * fix api * add number check if It's force-push * Add repo commit link fuction remove unnecessary check skip show push commits comment which not have commits alive * Update issue_comment.go * Apply suggestions from code review Co-authored-by: mrsdizzie <info@mrsdizzie.com> * Apply suggestions from code review * fix ui view Co-authored-by: silverwind <me@silverwind.io> * fix height * remove unnecessary style define * simplify GetBranchName * Apply suggestions from code review * save commit ids and isForce push by json * simplify GetBranchName * fix bug Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: mrsdizzie <info@mrsdizzie.com> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: silverwind <me@silverwind.io>
* Cache PullRequest Divergence (#10914)65432020-04-141-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Cache PullRequest Divergence * only re-calc divergence if AddTestPullRequestTask() is exec * migrate already open pulls * finalize * take care of closed&not-merged+deleted-branch pull requests * fix nil pointer exeption Signed-off-by: 6543 <6543@obermui.de> * try this * no error its a warn * init gitea-repositories-meta * dont use gitDivergence type * CI.restart() * CI.restart() * CI.restart() * CI.restart() * check IsUserAllowedToUpdate independend from CommitsBehind
* remove package code.gitea.io/gitea/modules/git import out of models (#11025)65432020-04-101-1/+201
|
* Only update merge_base in checker if not already merged (#10908)zeripath2020-04-011-1/+1
| | | | | | | | Fix #10766 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: Lauris BH <lauris@nix.lv>
* Display pull request head branch even the branch deleted or repository ↵Lunny Xiao2020-03-021-5/+4
| | | | | | | | | | | | | | | | deleted (#10413) * Display pull request head branch even the branch deleted or repository deleted * Merge getHeadRepo/loadHeadRepo and getBaseRepo/loadBaseRepo on pull and fill repo when pr.Issue.Repo is available * retrieve sha from pull head when pull request branch deleted and fix tests * Fix test * Ensure MustHeadRepoName returns empty string if no head repo Co-authored-by: zeripath <art27@cantab.net>
* Prevent panic on merge to PR (#10403)zeripath2020-02-211-0/+8
| | | | | | | | If you attempt to merge to a branch which on a PR there will be a nil pointer error in the pull request checker. This panic is uncaught and will bring down the gitea server. This PR adds protection to prevent this.
* Fix IsErrPullClosed (#10093)Lunny Xiao2020-02-011-2/+2
|
* PRs: Move to use a temporary repo for pushing new prs (#10009)zeripath2020-01-281-14/+30
| | | | * Move to use a temporary repo for pushing new prs
* Fix pull view when head repository or head branch missed and close related ↵Lunny Xiao2020-01-251-0/+76
| | | | | | | | | | | | | | | | | | pull requests when delete head repository or head branch (#9927) * fix pull view when head repository or head branch missed and close related pull requests when delete branch * fix pull view broken when head repository deleted * close pull requests when head repositories deleted * Add tests for broken pull request head repository or branch * fix typo * ignore special error when close pull request Co-authored-by: Lauris BH <lauris@nix.lv>
* Add owner_name column for table repository for maintaince reason (#9717)Lunny Xiao2020-01-121-1/+1
| | | | | | | | | | | | | | * Add owner_name column for table repository for maintaince reason * refactor * Fix tests * fix test * fix bug when fork repository Co-authored-by: zeripath <art27@cantab.net>
* Mark PR reviews as stale at push and allow to dismiss stale approvals (#9532)David Svantesson2020-01-091-1/+95
| | | | | | | Fix #5997. If a push causes the patch/diff of a PR towards target branch to change, all existing reviews for the PR will be set and shown as stale. New branch protection option to dismiss stale approvals are added. To show that a review is not based on the latest PR changes, an hourglass is shown
* Properly enforce gitea environment for pushes (#9501)zeripath2019-12-271-0/+9
| | | #8982 attempted to enforce the gitea environment for pushes - unfortunately it tested the settings before they were actually read in - and therefore does not do that!
* Change target branch for pull request (#6488)Mario Lubenka2019-12-161-0/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Adds functionality to change target branch of created pull requests Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Use const instead of var in JavaScript additions Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Check if branches are equal and if PR already exists before changing target branch Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Make sure to check all commits Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Print error messages for user as error flash message Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Disallow changing target branch of closed or merged pull requests Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Resolve conflicts after merge of upstream/master Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Change order of branch select fields Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes duplicate check Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Use ctx.Tr for translations Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Recompile JS Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Use correct translation namespace Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Remove redundant if condition Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Moves most change branch logic into pull service Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Completes comment Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Add Ref to ChangesPayload for logging changed target branches instead of creating a new struct Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Revert changes to go.mod Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Directly use createComment method Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Return 404 if pull request is not found. Move written check up Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Remove variable declaration Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Return client errors on change pull request target errors Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Return error in commit.HasPreviousCommit Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adds blank line Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Test patch before persisting new target branch Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Update patch before testing (not working) Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes patch calls when changeing pull request target Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes unneeded check for base name Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Moves ChangeTargetBranch completely to pull service. Update patch status. Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Set webhook mode after errors were validated Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Update PR in one transaction Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Move logic for check if head is equal with branch to pull model Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adds missing comment and simplify return Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adjust CreateComment method call Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Graceful: Xorm, RepoIndexer, Cron and Others (#9282)zeripath2019-12-151-27/+36
| | | | | | | | | | | | * Change graceful to use a singleton obtained through GetManager instead of a global. * Graceful: Make TestPullRequests shutdownable * Graceful: Make the cron tasks graceful * Graceful: AddTestPullRequest run in graceful ctx * Graceful: SyncMirrors shutdown * Graceful: SetDefaultContext for Xorm to be HammerContext * Avoid starting graceful for migrate commands and checkout * Graceful: DeliverHooks now can be shutdown * Fix multiple syncing errors in modules/sync/UniqueQueue & Make UniqueQueue closable * Begin the process of making the repo indexer shutdown gracefully
* Move PushToBaseRepo from models to services/pull (#9352)Lunny Xiao2019-12-151-1/+49
|
* Remove SavePatch and generate patches on the fly (#9302)zeripath2019-12-131-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | * Save patches to temporary files * Remove SavePatch and generate patches on the fly * Use ioutil.TempDir * fixup! Use ioutil.TempDir * fixup! fixup! Use ioutil.TempDir * RemoveAll LocalCopyPath() in initIntergrationTest * Default to status checking on PR creation * Remove unnecessary set to StatusChecking * Protect against unable to load repo * Handle conflicts * Restore original conflict setting * In TestPullRequests update status to StatusChecking before running TestPatch