go/cmd/dolt/commands: roots.go: Fix for __DOLT_{DEV,1}__.

This commit is contained in:
Aaron Son
2022-06-07 14:45:20 -07:00
parent 09fc24e16d
commit df73a69cd5
2 changed files with 8 additions and 5 deletions

View File

@@ -34,6 +34,7 @@ import (
"github.com/dolthub/dolt/go/libraries/utils/filesys"
"github.com/dolthub/dolt/go/store/chunks"
"github.com/dolthub/dolt/go/store/nbs"
"github.com/dolthub/dolt/go/store/prolly/tree"
"github.com/dolthub/dolt/go/store/spec"
"github.com/dolthub/dolt/go/store/types"
)
@@ -56,16 +57,16 @@ func (cmd RootsCmd) Hidden() bool {
// RequiresRepo should return false if this interface is implemented, and the command does not have the requirement
// that it be run from within a data repository directory
func (cmd RootsCmd) RequiresRepo() bool {
return false
return true
}
// Description returns a description of the command
func (cmd RootsCmd) Description() string {
return "Displays the current Dolt cli version."
return "Displays store root values (or potential store root values) that we find in the current database."
}
func (cmd RootsCmd) GatedForNBF(nbf *types.NomsBinFormat) bool {
return types.IsFormat_DOLT_1(nbf)
return false
}
// CreateMarkdown creates a markdown file containing the helptext for the command at the given path
@@ -152,7 +153,10 @@ func (cmd RootsCmd) processTableFile(ctx context.Context, path string, modified
}
} else if sm, ok := value.(types.SerialMessage); ok {
if serial.GetFileID([]byte(sm)) == serial.StoreRootFileID {
err := types.WriteEncodedValue(ctx, cli.OutStream, value)
msg := serial.GetRootAsStoreRoot([]byte(sm), 0)
ambytes := msg.AddressMapBytes()
node := tree.NodeFromBytes(ambytes)
err := tree.OutputAddressMapNode(cli.OutStream, node)
if err != nil {
return false, err
}

View File

@@ -426,7 +426,6 @@ SQL
}
@test "status: roots runs even if status fails" {
skip_nbf_dolt_1
mv .dolt/repo_state.json .dolt/repo_state.backup
run dolt status