[ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/update.sh

This commit is contained in:
zachmu
2023-09-12 00:47:49 +00:00
parent 8358408891
commit 7c71476bab
6 changed files with 72 additions and 72 deletions

View File

@@ -769,11 +769,11 @@ func executeNoFFMergeAndCommit(ctx context.Context, sqlCtx *sql.Context, queryis
}
pendingCommit, err := actions.GetCommitStaged(ctx, roots, ws, mergeParentCommits, dEnv.DbData().Ddb, actions.CommitStagedProps{
Message: msg,
Date: spec.Date,
Force: spec.Force,
Name: spec.Name,
Email: spec.Email,
Message: msg,
Date: spec.Date,
Force: spec.Force,
Name: spec.Name,
Email: spec.Email,
})
headRef, err := dEnv.RepoStateReader().CWBHeadRef()
@@ -832,11 +832,11 @@ func executeMergeAndCommit(ctx context.Context, sqlCtx *sql.Context, queryist cl
// getCommitMsgForMerge returns user defined message if exists; otherwise, get the commit message from editor.
func getCommitMsgForMerge(
sqlCtx *sql.Context,
queryist cli.Queryist,
suggestedMsg string,
noEdit bool,
cliCtx cli.CliContext,
sqlCtx *sql.Context,
queryist cli.Queryist,
suggestedMsg string,
noEdit bool,
cliCtx cli.CliContext,
) (string, error) {
msg, err := getCommitMessageFromEditor(sqlCtx, queryist, suggestedMsg, "", noEdit, cliCtx)
if err != nil {

View File

@@ -121,7 +121,7 @@ func (cmd PullCmd) Exec(ctx context.Context, commandStr string, args []string, d
env.WithNoEdit(apr.Contains(cli.NoEditFlag)),
env.WithForce(apr.Contains(cli.ForceFlag)),
)
if err != nil {
return HandleVErrAndExitCode(errhand.VerboseErrorFromError(err), usage)
}
@@ -135,12 +135,12 @@ func (cmd PullCmd) Exec(ctx context.Context, commandStr string, args []string, d
// pullHelper splits pull into fetch, prepare merge, and merge to interleave printing
func pullHelper(
ctx context.Context,
sqlCtx *sql.Context,
queryist cli.Queryist,
dEnv *env.DoltEnv,
pullSpec *env.PullSpec,
cliCtx cli.CliContext,
ctx context.Context,
sqlCtx *sql.Context,
queryist cli.Queryist,
dEnv *env.DoltEnv,
pullSpec *env.PullSpec,
cliCtx cli.CliContext,
) error {
srcDB, err := pullSpec.Remote.GetRemoteDBWithoutCaching(ctx, dEnv.DoltDB.ValueReadWriter().Format(), dEnv)
if err != nil {
@@ -185,7 +185,7 @@ func pullHelper(
return err
}
fmt.Println(h.String())
err = dEnv.DoltDB.FastForward(ctx, remoteTrackRef, srcDBCommit)
if errors.Is(err, datas.ErrMergeNeeded) {
// If the remote tracking branch has diverged from the local copy, we just overwrite it
@@ -284,4 +284,4 @@ func pullHelper(
}
return nil
}
}

View File

@@ -391,9 +391,9 @@ func GetTrackingRef(branchRef ref.DoltRef, remote Remote) (ref.DoltRef, error) {
}
type PullSpec struct {
Squash bool
NoFF bool
NoCommit bool
Squash bool
NoFF bool
NoCommit bool
NoEdit bool
Force bool
RemoteName string
@@ -437,11 +437,11 @@ func WithForce(force bool) PullSpecOpt {
// NewPullSpec returns a PullSpec for the arguments given. This function validates remote and gets remoteRef
// for given remoteRefName; if it's not defined, it uses current branch to get its upstream branch if it exists.
func NewPullSpec(
_ context.Context,
rsr RepoStateReader,
remoteName, remoteRefName string,
remoteOnly bool,
opts ...PullSpecOpt,
_ context.Context,
rsr RepoStateReader,
remoteName, remoteRefName string,
remoteOnly bool,
opts ...PullSpecOpt,
) (*PullSpec, error) {
refSpecs, err := GetRefSpecs(rsr, remoteName)
if err != nil {
@@ -488,11 +488,11 @@ func NewPullSpec(
RefSpecs: refSpecs,
Branch: remoteRef,
}
for _, opt := range opts {
opt(spec)
}
return spec, nil
}

View File

@@ -40,8 +40,8 @@ type MergeSpec struct {
StompedTblNames []string
WorkingDiffs map[string]hash.Hash
Squash bool
NoFF bool
NoCommit bool
NoFF bool
NoCommit bool
NoEdit bool
Force bool
Email string
@@ -52,7 +52,7 @@ type MergeSpec struct {
type MergeSpecOpt func(*MergeSpec)
func WithNoFf(noFF bool) MergeSpecOpt {
return func(ms *MergeSpec) {
return func(ms *MergeSpec) {
ms.NoFF = noFF
}
}
@@ -93,13 +93,13 @@ func WithPullSpecOpts(pullSpec *env.PullSpec) MergeSpecOpt {
// NewMergeSpec returns a MergeSpec with the arguments provided.
func NewMergeSpec(
ctx context.Context,
rsr env.RepoStateReader,
ddb *doltdb.DoltDB,
roots doltdb.Roots,
name, email, commitSpecStr string,
date time.Time,
opts ...MergeSpecOpt,
ctx context.Context,
rsr env.RepoStateReader,
ddb *doltdb.DoltDB,
roots doltdb.Roots,
name, email, commitSpecStr string,
date time.Time,
opts ...MergeSpecOpt,
) (*MergeSpec, error) {
headCS, err := doltdb.NewCommitSpec("HEAD")
if err != nil {
@@ -154,11 +154,11 @@ func NewMergeSpec(
Name: name,
Date: date,
}
for _, opt := range opts {
opt(spec)
}
return spec, nil
}

View File

@@ -170,13 +170,13 @@ func doDoltMerge(ctx *sql.Context, args []string) (string, int, int, error) {
// 'no-commit' flag is not defined.
// TODO FF merging commit with constraint violations requires `constraint verify`
func performMerge(
ctx *sql.Context,
sess *dsess.DoltSession,
ws *doltdb.WorkingSet,
dbName string,
spec *merge.MergeSpec,
noCommit bool,
msg string,
ctx *sql.Context,
sess *dsess.DoltSession,
ws *doltdb.WorkingSet,
dbName string,
spec *merge.MergeSpec,
noCommit bool,
msg string,
) (*doltdb.WorkingSet, string, int, int, error) {
// todo: allow merges even when an existing merge is uncommitted
if ws.MergeActive() {
@@ -311,15 +311,15 @@ func abortMerge(ctx *sql.Context, workingSet *doltdb.WorkingSet, roots doltdb.Ro
}
func executeMerge(
ctx *sql.Context,
sess *dsess.DoltSession,
dbName string,
squash bool,
head, cm *doltdb.Commit,
cmSpec string,
ws *doltdb.WorkingSet,
opts editor.Options,
workingDiffs map[string]hash.Hash,
ctx *sql.Context,
sess *dsess.DoltSession,
dbName string,
squash bool,
head, cm *doltdb.Commit,
cmSpec string,
ws *doltdb.WorkingSet,
opts editor.Options,
workingDiffs map[string]hash.Hash,
) (*doltdb.WorkingSet, error) {
result, err := merge.MergeCommits(ctx, head, cm, opts)
if err != nil {
@@ -384,13 +384,13 @@ func executeFFMerge(ctx *sql.Context, dbName string, squash bool, ws *doltdb.Wor
}
func executeNoFFMerge(
ctx *sql.Context,
dSess *dsess.DoltSession,
spec *merge.MergeSpec,
msg string,
dbName string,
ws *doltdb.WorkingSet,
noCommit bool,
ctx *sql.Context,
dSess *dsess.DoltSession,
spec *merge.MergeSpec,
msg string,
dbName string,
ws *doltdb.WorkingSet,
noCommit bool,
) (*doltdb.WorkingSet, *doltdb.Commit, error) {
mergeRoot, err := spec.MergeC.GetRootValue(ctx)
if err != nil {
@@ -428,13 +428,13 @@ func executeNoFFMerge(
return ws.WithStagedRoot(roots.Staged), nil, nil
}
pendingCommit, err := dSess.NewPendingCommit(ctx, dbName, roots, actions.CommitStagedProps{
Message: msg,
Date: spec.Date,
Force: spec.Force,
Name: spec.Name,
Email: spec.Email,
Message: msg,
Date: spec.Date,
Force: spec.Force,
Name: spec.Name,
Email: spec.Email,
})
if err != nil {
return nil, nil, err

View File

@@ -20,7 +20,6 @@ import (
"fmt"
"sync"
"github.com/dolthub/dolt/go/store/datas"
"github.com/dolthub/go-mysql-server/sql"
"github.com/dolthub/dolt/go/cmd/dolt/cli"
@@ -30,6 +29,7 @@ import (
"github.com/dolthub/dolt/go/libraries/doltcore/env/actions"
"github.com/dolthub/dolt/go/libraries/doltcore/ref"
"github.com/dolthub/dolt/go/libraries/doltcore/sqle/dsess"
"github.com/dolthub/dolt/go/store/datas"
"github.com/dolthub/dolt/go/store/datas/pull"
)
@@ -178,7 +178,7 @@ func doDoltPull(ctx *sql.Context, args []string) (int, int, error) {
if err != nil {
return noConflictsOrViolations, threeWayMerge, err
}
uncommittedChanges, _, _, err := actions.RootHasUncommittedChanges(roots)
if err != nil {
return noConflictsOrViolations, threeWayMerge, err