From b1a9efd552d164016c010fea179622edc22328fd Mon Sep 17 00:00:00 2001 From: moson-mo Date: Wed, 8 Feb 2023 17:48:09 +0100 Subject: [PATCH] housekeep(git): remove deprecated "setup-repo" command Marked as deprecated about 6 years ago. Time to bury it. Issue report: #428 Signed-off-by: moson-mo --- aurweb/git/serve.py | 8 -------- doc/git-interface.txt | 1 - test/t1200-git-serve.t | 15 ++++++++++----- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/aurweb/git/serve.py b/aurweb/git/serve.py index a12b6d6e..8dbbf3f7 100755 --- a/aurweb/git/serve.py +++ b/aurweb/git/serve.py @@ -573,13 +573,6 @@ def serve(action, cmdargv, user, privileged, remote_addr): # noqa: C901 elif action == "list-repos": checkarg(cmdargv) list_repos(user) - elif action == "setup-repo": - checkarg(cmdargv, "repository name") - warn( - "{:s} is deprecated. " - "Use `git push` to create new repositories.".format(action) - ) - create_pkgbase(cmdargv[1], user) elif action == "restore": checkarg(cmdargv, "repository name") @@ -636,7 +629,6 @@ def serve(action, cmdargv, user, privileged, remote_addr): # noqa: C901 "restore ": "Restore a deleted package base.", "set-comaintainers [...]": "Set package base co-maintainers.", "set-keywords [...]": "Change package base keywords.", - "setup-repo ": "Create a repository (deprecated).", "unflag ": "Remove out-of-date flag from a package base.", "unvote ": "Remove vote from a package base.", "vote ": "Vote for a package base.", diff --git a/doc/git-interface.txt b/doc/git-interface.txt index 8c6806f7..028ffd0d 100644 --- a/doc/git-interface.txt +++ b/doc/git-interface.txt @@ -53,7 +53,6 @@ The git-serve command, the "aurweb shell", provides different subcommands: * The restore command can be used to restore a deleted package base. * The set-comaintainers command modifies the co-maintainers of a package base. * The set-keywords command modifies the keywords assigned to a package base. -* The setup-repo command can be used to create a new repository. * The vote/unvote command can be used to vote/unvote for a package base. * The git-{receive,upload}-pack commands are redirected to git-shell(1). diff --git a/test/t1200-git-serve.t b/test/t1200-git-serve.t index f1657412..f65096db 100755 --- a/test/t1200-git-serve.t +++ b/test/t1200-git-serve.t @@ -56,11 +56,16 @@ test_expect_success 'Test IP address bans.' ' SSH_CLIENT="$SSH_CLIENT_ORIG" ' -test_expect_success 'Test setup-repo and list-repos.' ' - SSH_ORIGINAL_COMMAND="setup-repo foobar" AUR_USER=user \ - cover "$GIT_SERVE" 2>&1 && - SSH_ORIGINAL_COMMAND="setup-repo foobar2" AUR_USER=tu \ - cover "$GIT_SERVE" 2>&1 && +test_expect_success 'Test list-repos.' ' + # insert our test packages + echo "INSERT INTO PackageBases (Name, SubmittedTS, \ + ModifiedTS, SubmitterUID, MaintainerUID, FlaggerComment) \ + VALUES (\"foobar\", 0, 0, 1, 1, \"\");" | \ + sqlite3 aur.db + echo "INSERT INTO PackageBases (Name, SubmittedTS, \ + ModifiedTS, SubmitterUID, MaintainerUID, FlaggerComment) \ + VALUES (\"foobar2\", 0, 0, 2, 2, \"\");" | \ + sqlite3 aur.db cat >expected <<-EOF && *foobar EOF