replaced usages of Format_7_18 and Format_LD_1 with Format_Default

This commit is contained in:
Andy Arthur
2022-01-07 14:26:01 -08:00
parent 6884461fbc
commit 685bf653dd
13 changed files with 35 additions and 34 deletions
+9 -9
View File
@@ -79,7 +79,7 @@ func TestParseKeyValues(t *testing.T) {
singleKeySch,
[]string{"robertson"},
[]types.Value{
mustValue(row.TaggedValues{lnColTag: types.String("robertson")}.NomsTupleForPKCols(types.Format_7_18, singleKeyColColl).Value(ctx)),
mustValue(row.TaggedValues{lnColTag: types.String("robertson")}.NomsTupleForPKCols(types.Format_Default, singleKeyColColl).Value(ctx)),
},
false,
},
@@ -88,7 +88,7 @@ func TestParseKeyValues(t *testing.T) {
singleKeySch,
[]string{"last", "robertson"},
[]types.Value{
mustValue(row.TaggedValues{lnColTag: types.String("robertson")}.NomsTupleForPKCols(types.Format_7_18, singleKeyColColl).Value(ctx)),
mustValue(row.TaggedValues{lnColTag: types.String("robertson")}.NomsTupleForPKCols(types.Format_Default, singleKeyColColl).Value(ctx)),
},
false,
},
@@ -102,7 +102,7 @@ func TestParseKeyValues(t *testing.T) {
singleKeySch,
[]string{"last", "last"},
[]types.Value{
mustValue(row.TaggedValues{lnColTag: types.String("last")}.NomsTupleForPKCols(types.Format_7_18, singleKeyColColl).Value(ctx)),
mustValue(row.TaggedValues{lnColTag: types.String("last")}.NomsTupleForPKCols(types.Format_Default, singleKeyColColl).Value(ctx)),
},
false,
},
@@ -110,8 +110,8 @@ func TestParseKeyValues(t *testing.T) {
singleKeySch,
[]string{"last", "robertson", "johnson"},
[]types.Value{
mustValue(row.TaggedValues{lnColTag: types.String("robertson")}.NomsTupleForPKCols(types.Format_7_18, singleKeyColColl).Value(ctx)),
mustValue(row.TaggedValues{lnColTag: types.String("johnson")}.NomsTupleForPKCols(types.Format_7_18, singleKeyColColl).Value(ctx)),
mustValue(row.TaggedValues{lnColTag: types.String("robertson")}.NomsTupleForPKCols(types.Format_Default, singleKeyColColl).Value(ctx)),
mustValue(row.TaggedValues{lnColTag: types.String("johnson")}.NomsTupleForPKCols(types.Format_Default, singleKeyColColl).Value(ctx)),
},
false,
},
@@ -126,8 +126,8 @@ func TestParseKeyValues(t *testing.T) {
sch,
[]string{"last", "robertson", "johnson"},
[]types.Value{
mustValue(row.TaggedValues{lnColTag: types.String("robertson")}.NomsTupleForPKCols(types.Format_7_18, testKeyColColl).Value(ctx)),
mustValue(row.TaggedValues{lnColTag: types.String("johnson")}.NomsTupleForPKCols(types.Format_7_18, testKeyColColl).Value(ctx)),
mustValue(row.TaggedValues{lnColTag: types.String("robertson")}.NomsTupleForPKCols(types.Format_Default, testKeyColColl).Value(ctx)),
mustValue(row.TaggedValues{lnColTag: types.String("johnson")}.NomsTupleForPKCols(types.Format_Default, testKeyColColl).Value(ctx)),
},
false,
},
@@ -135,8 +135,8 @@ func TestParseKeyValues(t *testing.T) {
sch,
[]string{"first,last", "robert,robertson", "john,johnson"},
[]types.Value{
mustValue(row.TaggedValues{lnColTag: types.String("robertson"), fnColTag: types.String("robert")}.NomsTupleForPKCols(types.Format_7_18, testKeyColColl).Value(ctx)),
mustValue(row.TaggedValues{lnColTag: types.String("johnson"), fnColTag: types.String("john")}.NomsTupleForPKCols(types.Format_7_18, testKeyColColl).Value(ctx)),
mustValue(row.TaggedValues{lnColTag: types.String("robertson"), fnColTag: types.String("robert")}.NomsTupleForPKCols(types.Format_Default, testKeyColColl).Value(ctx)),
mustValue(row.TaggedValues{lnColTag: types.String("johnson"), fnColTag: types.String("john")}.NomsTupleForPKCols(types.Format_Default, testKeyColColl).Value(ctx)),
},
false,
},
+1 -1
View File
@@ -27,7 +27,7 @@ import (
func TestLog(t *testing.T) {
dEnv := createUninitializedEnv()
err := dEnv.InitRepo(context.Background(), types.Format_7_18, "Bill Billerson", "bigbillieb@fake.horse", env.DefaultInitBranch)
err := dEnv.InitRepo(context.Background(), types.Format_Default, "Bill Billerson", "bigbillieb@fake.horse", env.DefaultInitBranch)
if err != nil {
t.Error("Failed to init repo")
+3 -3
View File
@@ -389,7 +389,7 @@ func TestInsert(t *testing.T) {
tbl, _, err := root.GetTable(ctx, tableName)
assert.NoError(t, err)
taggedVals := row.TaggedValues{dtestutils.IdTag: types.UUID(expectedid)}
key := taggedVals.NomsTupleForPKCols(types.Format_7_18, dtestutils.TypedSchema.GetPKCols())
key := taggedVals.NomsTupleForPKCols(types.Format_Default, dtestutils.TypedSchema.GetPKCols())
kv, err := key.Value(ctx)
assert.NoError(t, err)
_, ok, err := table.GetRow(ctx, tbl, dtestutils.TypedSchema, kv.(types.Tuple))
@@ -473,7 +473,7 @@ func TestUpdate(t *testing.T) {
tbl, _, err := root.GetTable(ctx, tableName)
assert.NoError(t, err)
taggedVals := row.TaggedValues{dtestutils.IdTag: types.UUID(expectedid)}
key := taggedVals.NomsTupleForPKCols(types.Format_7_18, dtestutils.TypedSchema.GetPKCols())
key := taggedVals.NomsTupleForPKCols(types.Format_Default, dtestutils.TypedSchema.GetPKCols())
kv, err := key.Value(ctx)
assert.NoError(t, err)
row, ok, err := table.GetRow(ctx, tbl, dtestutils.TypedSchema, kv.(types.Tuple))
@@ -552,7 +552,7 @@ func TestDelete(t *testing.T) {
tbl, _, err := root.GetTable(ctx, tableName)
assert.NoError(t, err)
taggedVals := row.TaggedValues{dtestutils.IdTag: types.UUID(expectedid)}
key := taggedVals.NomsTupleForPKCols(types.Format_7_18, dtestutils.TypedSchema.GetPKCols())
key := taggedVals.NomsTupleForPKCols(types.Format_Default, dtestutils.TypedSchema.GetPKCols())
kv, err := key.Value(ctx)
assert.NoError(t, err)
_, ok, err := table.GetRow(ctx, tbl, dtestutils.TypedSchema, kv.(types.Tuple))
@@ -48,7 +48,7 @@ func createUninitializedEnv() *env.DoltEnv {
func TestGetDotDotRevisions(t *testing.T) {
dEnv := createUninitializedEnv()
err := dEnv.InitRepo(context.Background(), types.Format_LD_1, "Bill Billerson", "bill@billerson.com", env.DefaultInitBranch)
err := dEnv.InitRepo(context.Background(), types.Format_Default, "Bill Billerson", "bill@billerson.com", env.DefaultInitBranch)
require.NoError(t, err)
cs, err := doltdb.NewCommitSpec(env.DefaultInitBranch)
@@ -218,7 +218,7 @@ func mustForkDB(t *testing.T, fromDB *doltdb.DoltDB, bn string, cm *doltdb.Commi
stref, err := cm.GetStRef()
require.NoError(t, err)
forkEnv := createUninitializedEnv()
err = forkEnv.InitRepo(context.Background(), types.Format_LD_1, "Bill Billerson", "bill@billerson.com", env.DefaultInitBranch)
err = forkEnv.InitRepo(context.Background(), types.Format_Default, "Bill Billerson", "bill@billerson.com", env.DefaultInitBranch)
require.NoError(t, err)
p1 := make(chan datas.PullProgress)
p2 := make(chan datas.PullerEvent)
@@ -183,7 +183,7 @@ func newRow(sch schema.Schema, id int, first, last string) row.Row {
2: types.String(last),
}
r, err := row.New(types.Format_LD_1, sch, vals)
r, err := row.New(types.Format_Default, sch, vals)
if err != nil {
panic(err)
+1 -1
View File
@@ -70,7 +70,7 @@ func createTestEnvWithFS(fs filesys.Filesys, workingDir string) *env.DoltEnv {
const name = "test mcgibbins"
const email = "bigfakeytester@fake.horse"
dEnv := env.Load(context.Background(), testHomeDirFunc, fs, doltdb.LocalDirDoltDB, "test")
err := dEnv.InitRepo(context.Background(), types.Format_7_18, name, email, env.DefaultInitBranch)
err := dEnv.InitRepo(context.Background(), types.Format_Default, name, email, env.DefaultInitBranch)
if err != nil {
panic("Failed to initialize environment")
}
+1 -1
View File
@@ -129,7 +129,7 @@ func getEnvAndConfig(ctx context.Context, b *testing.B) (dEnv *env.DoltEnv, cfg
}
dEnv = env.Load(ctx, os.UserHomeDir, fs, doltdb.LocalDirDoltDB, "bench")
err = dEnv.InitRepo(ctx, types.Format_7_18, name, email, env.DefaultInitBranch)
err = dEnv.InitRepo(ctx, types.Format_Default, name, email, env.DefaultInitBranch)
if err != nil {
b.Fatal(err)
}
+2 -2
View File
@@ -95,7 +95,7 @@ func main() {
os.Exit(1)
}
ref, err := types.NewRef(dss, types.Format_7_18)
ref, err := types.NewRef(dss, types.Format_Default)
d.PanicIfError(err)
height := ref.Height()
fmt.Println("Store is of height", height)
@@ -132,7 +132,7 @@ func main() {
orderedChildren := hash.HashSlice{}
nextLevel := hash.HashSlice{}
for _, h := range current {
_ = currentValues[h].WalkRefs(types.Format_7_18, func(r types.Ref) error {
_ = currentValues[h].WalkRefs(types.Format_Default, func(r types.Ref) error {
target := r.TargetHash()
orderedChildren = append(orderedChildren, target)
if !visited[target] && r.Height() > 1 {
+8 -8
View File
@@ -38,14 +38,14 @@ import (
)
var testMDChunks = []chunks.Chunk{
mustChunk(types.EncodeValue(types.String("Call me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, "), types.Format_7_18)),
mustChunk(types.EncodeValue(types.String("and nothing particular to interest me on shore, I thought I would sail about a little and see the watery "), types.Format_7_18)),
mustChunk(types.EncodeValue(types.String("part of the world. It is a way I have of driving off the spleen and regulating the "), types.Format_7_18)),
mustChunk(types.EncodeValue(types.String("circulation. Whenever I find myself growing grim about the mouth; whenever it is a damp, drizzly "), types.Format_7_18)),
mustChunk(types.EncodeValue(types.String("November in my soul; whenever I find myself involuntarily pausing before coffin warehouses, and bringing "), types.Format_7_18)),
mustChunk(types.EncodeValue(types.String("funeral I meet; and especially whenever my hypos get such an upper hand of me, that it requires "), types.Format_7_18)),
mustChunk(types.EncodeValue(types.String("a strong moral principle to prevent me from deliberately stepping into the street, and methodically "), types.Format_7_18)),
mustChunk(types.EncodeValue(types.String("knocking peoples hats off—then, I account it high time to get to sea as soon as I can."), types.Format_7_18)),
mustChunk(types.EncodeValue(types.String("Call me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, "), types.Format_Default)),
mustChunk(types.EncodeValue(types.String("and nothing particular to interest me on shore, I thought I would sail about a little and see the watery "), types.Format_Default)),
mustChunk(types.EncodeValue(types.String("part of the world. It is a way I have of driving off the spleen and regulating the "), types.Format_Default)),
mustChunk(types.EncodeValue(types.String("circulation. Whenever I find myself growing grim about the mouth; whenever it is a damp, drizzly "), types.Format_Default)),
mustChunk(types.EncodeValue(types.String("November in my soul; whenever I find myself involuntarily pausing before coffin warehouses, and bringing "), types.Format_Default)),
mustChunk(types.EncodeValue(types.String("funeral I meet; and especially whenever my hypos get such an upper hand of me, that it requires "), types.Format_Default)),
mustChunk(types.EncodeValue(types.String("a strong moral principle to prevent me from deliberately stepping into the street, and methodically "), types.Format_Default)),
mustChunk(types.EncodeValue(types.String("knocking peoples hats off—then, I account it high time to get to sea as soon as I can."), types.Format_Default)),
}
var testMDChunksSize uint64
@@ -55,7 +55,7 @@ func TestAsyncSortedEdits(t *testing.T) {
}
func TestAsyncSortedEditsStable(t *testing.T) {
ase := NewAsyncSortedEdits(types.Format_LD_1, 2, 1, 1)
ase := NewAsyncSortedEdits(types.Format_Default, 2, 1, 1)
assert.NotNil(t, ase)
ase.AddEdit(types.Int(0), nil)
ase.AddEdit(types.Int(1), nil)
+2 -2
View File
@@ -66,12 +66,12 @@ func TestKVPCollection(t *testing.T) {
}
func TestKVPCollectionDestructiveMergeStable(t *testing.T) {
left := NewKVPCollection(types.Format_LD_1, types.KVPSlice{
left := NewKVPCollection(types.Format_Default, types.KVPSlice{
types.KVP{Key: types.Int(0)},
types.KVP{Key: types.Int(1)},
types.KVP{Key: types.Int(2)},
})
right := NewKVPCollection(types.Format_LD_1, types.KVPSlice{
right := NewKVPCollection(types.Format_Default, types.KVPSlice{
types.KVP{Key: types.Int(0), Val: types.Int(0)},
types.KVP{Key: types.Int(1), Val: types.Int(0)},
types.KVP{Key: types.Int(2), Val: types.Int(0)},
+3 -3
View File
@@ -24,19 +24,19 @@ import (
)
func TestSortedEditItrStable(t *testing.T) {
left := NewKVPCollection(types.Format_LD_1, types.KVPSlice{
left := NewKVPCollection(types.Format_Default, types.KVPSlice{
types.KVP{Key: types.Int(0)},
types.KVP{Key: types.Int(1)},
types.KVP{Key: types.Int(2)},
})
right := NewKVPCollection(types.Format_LD_1, types.KVPSlice{
right := NewKVPCollection(types.Format_Default, types.KVPSlice{
types.KVP{Key: types.Int(0), Val: types.Int(0)},
types.KVP{Key: types.Int(1), Val: types.Int(0)},
types.KVP{Key: types.Int(2), Val: types.Int(0)},
})
assert.NotNil(t, left)
assert.NotNil(t, right)
i := NewSortedEditItr(types.Format_LD_1, left, right)
i := NewSortedEditItr(types.Format_Default, left, right)
assert.NotNil(t, i)
var err error
+1
View File
@@ -229,6 +229,7 @@ func read(ctx context.Context, rd io.Reader) (hash.Hash, *FileValueStore, error)
nbf = types.Format_7_18
case types.Format_LD_1.VersionString():
nbf = types.Format_LD_1
// todo(andy): add types.Format_DOLT_1
default:
return hash.Hash{}, nil, fmt.Errorf("unknown noms format: %s", string(data))
}