mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-27 18:59:23 -06:00
[ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/update.sh
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
20
go/libraries/doltcore/env/remotes.go
vendored
20
go/libraries/doltcore/env/remotes.go
vendored
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user