Move sdk from code.gitea.io/sdk/gitea to gitea.dev/sdk (#1006)

Reviewed-on: https://gitea.com/gitea/tea/pulls/1006
Reviewed-by: Zettat123 <39446+zettat123@noreply.gitea.com>
This commit is contained in:
Lunny Xiao
2026-05-26 04:51:09 +00:00
parent 579099f9d9
commit 28ba9b915b
179 changed files with 617 additions and 599 deletions
+6 -6
View File
@@ -9,7 +9,7 @@ import (
"strings"
"time"
"code.gitea.io/sdk/gitea"
"gitea.dev/sdk"
"gitea.dev/tea/cmd/flags"
"gitea.dev/tea/modules/context"
@@ -71,7 +71,7 @@ Depending on your permissions on the repository, only your own tracked times mig
}
// RunTimesList list repositories
func RunTimesList(_ stdctx.Context, cmd *cli.Command) error {
func RunTimesList(requestCtx stdctx.Context, cmd *cli.Command) error {
ctx, err := context.InitCommand(cmd)
if err != nil {
return err
@@ -106,11 +106,11 @@ func RunTimesList(_ stdctx.Context, cmd *cli.Command) error {
user := ctx.Args().First()
if ctx.Bool("mine") {
times, _, err = client.ListMyTrackedTimes(opts)
times, _, err = client.Issues.ListMyTrackedTimes(requestCtx, opts)
fields = []string{"created", "repo", "issue", "duration"}
} else if user == "" {
// get all tracked times on the repo
times, _, err = client.ListRepoTrackedTimes(ctx.Owner, ctx.Repo, opts)
times, _, err = client.Issues.ListRepoTrackedTimes(requestCtx, ctx.Owner, ctx.Repo, opts)
fields = []string{"created", "issue", "user", "duration"}
} else if strings.HasPrefix(user, "#") {
// get all tracked times on the specified issue
@@ -118,12 +118,12 @@ func RunTimesList(_ stdctx.Context, cmd *cli.Command) error {
if parseErr != nil {
return parseErr
}
times, _, err = client.ListIssueTrackedTimes(ctx.Owner, ctx.Repo, issue, opts)
times, _, err = client.Issues.ListIssueTrackedTimes(requestCtx, ctx.Owner, ctx.Repo, issue, opts)
fields = []string{"created", "user", "duration"}
} else {
// get all tracked times by the specified user
opts.User = user
times, _, err = client.ListRepoTrackedTimes(ctx.Owner, ctx.Repo, opts)
times, _, err = client.Issues.ListRepoTrackedTimes(requestCtx, ctx.Owner, ctx.Repo, opts)
fields = []string{"created", "issue", "duration"}
}