Commit Graph

15 Commits

Author SHA1 Message Date
Andy Arthur 20567259a4 assert FeatureVersion in BATS teardown 2021-02-15 11:14:00 -08:00
Vinai Rachakonda 3342b8d58f Vinai/refactor docs (#1210)
This pr does a massive refactor of the internal state management with docs.
2021-01-25 17:00:27 -05:00
Daylon Wilkins 39979b8f5b Moved most commands to use SQL, added CREATE TABLE LIKE, and removed tags from comments. 2020-09-21 03:01:01 -07:00
Brian Hendriks ef40adc077 reset hard fixes (#706) 2020-05-27 13:51:54 -07:00
Andy Arthur 4e12c58cc0 updated BATS 2020-05-05 10:27:53 -07:00
Katie McCulloch 1d5f61dc0f {bats,libraries/doltcore/env: Remove automatic creation of docs and fix bats tests accordingly 2020-04-21 14:16:51 -07:00
Katie McCulloch 45975f00be libraries/doltcore/env/actions/branch.go: Add bug fix so we no longer overwrite working changes of docs on a successful checkout with no conflicts 2020-04-09 15:57:51 -07:00
Katie McCulloch ae12e65703 bats/docs.bats: Add test coverage for dolt checkout branch, no conflicts, changes in working set 2020-04-09 15:54:44 -07:00
Katie McCulloch 627960e0d1 bats/docs.bats: Add test case for dolt diff when only one doc on filesystem 2020-02-13 13:01:29 -08:00
Zach Musgrave 6545a8efe1 Removed special-casing of dolt_docs table from schema, mv, and cp commands, and fixed tests.
Signed-off-by: Zach Musgrave <zach@liquidata.co>
2020-02-05 15:49:53 -08:00
Katie McCulloch 92772a870c bats,{go/cmd/dolt/commands/schcmds/show}: Update message when no tables in working set 2020-01-27 13:00:38 -08:00
Katie McCulloch 387e3dd3e5 bats,{go/cmd/dolt/commands}: Hide dolt_docs schema on dolt schema show when no other args are provided 2020-01-27 12:40:22 -08:00
Daylon Wilkins a8ee8c30dc Removed Windows carriage-return and trailing whitespace from bats tests 2020-01-23 11:17:11 -08:00
Daylon Wilkins 072c8d80e0 Removed old table and schema commands from the command line 2020-01-22 17:03:22 -08:00
Katie McCulloch e609fa2bf7 dolt_docs feature branch (#222)
* Add Notes struct and some helper functions

* go/libraries/doltcore/env: Add Notes paths and create README and LICENSE on dolt init

* bats/no-repo.bats: Check that readme and license are created on init

* go/libraries/doltcore/env/notes.go: Let Notes key/val pairs be a map[string]string

* go/libraries/doltcore: Store notes on RootValue

* added license and readme to dolt status; merge on already existing repos not working

* fix merge for existing repos by using existing rootvals when notesMap is nil

* go/{cmd,libraries}: Use Doc instead of Note

* go/{cmd,libraries}: Move dolt docs to tableMap

* go/{cmd, libraries}: Get rid of abbreviation of Doc

* bats: Add comments for test where we rm LICENSE and README

* go/cmd/dolt/commands/status: Transform errors on  to get rid of panics

* go/libraries/dolctore/doltdb/root_val: Extract duplicate code in DocDiff to helper function

* go/libraries/doltcore: NewDocDiffs and root.DocDiff to take a slice of docs, easier to add docs in the future

* go/libraries/doltcore/env: Make Doc related env/path functions more general purpose that take in file name

* go/libraries/doltcore/actions: gofmt errors.go and minor update to defining docDetails

* go/libraries/doltcore/env/environment.go: Add PutDocsToWorking function

* go: Add docs to 'dolt add .' and update 'dolt status' to include staged docs

* bats: Add dolt doc tests and update comments where we rm <doc>

* go/libraries/doltcore/env/environment.go: Add generic functions to retrieve all or one valid docDetail(s)

* go: Pass specific docDetails for  to staged one PK at a time

* bats/dolt-docs.bats: dolt add <doc> for LICENSE.md and README.md

* bats/dolt-docs.bats: Remove fragile tests using  and use  instead

* go/libraries/doltcore: Break DocDiffs into helper functions and remove dereference to NewerText

* go/libraries/doltcore/env/environment: Extract updateExistingDocs and createDocsTable helper functions

* go/libraries/doltcore: Add RemoveDocsFromWorking so we unstage docs if stageTables encounters an error

* {bats,go}: Add test for adding invalid <table|doc>, simplify GetDocDiffs, and use PutDocsToWorking directly

* go/{cmd,libraries}: Implement dolt reset --hard, refactor dolt_docs.go env file for general use

* bats/dolt-docs.bats: Add dolt reset --hard tests for docs

* go/{cmd,libraries}: Implement soft reset for docs, make doltcore/env doc functions more general use

* bats/dolt-docs.bats: Add test coverage for soft reset of docs

* go/libraries/doltcore/env/environment.go: Extract PutDocsAndGetNewRoot function from PutDocsToWorking/PutDocsToStaged and use it in those functions

* {bats,go/cmd/dolt/commands/diff.go}: Add docs to working root before diffing, update tests

* {bats,go}: Print doc diffs

* {go,bats}: Print lines for deleted doc, and simplify doc diff printing

* Comitting output of ./Godeps/update.sh that was giving me error in ./Godeps/verify.sh

* {bats, go/libraries/doltcore/sqle/database.go: Remove DocTableName from sql commands

* go/{cmd,libraries}: Declare DoltNamespace and add HasDoltPrefix and FilterDoltInternalTables

* {go,bats}: Implement dolt diff <dic> by parsing docs from args, with bats test

* {go,bats}: Fix bug from commit #7b15ae8201083cbee57 that did not print deleted staged docs correctly

* rename docs test file: bats/dolt-docs.bats --> docs.bats

* go/{cmd,libraries/doltcore/env}: Implement dolt checkout <doc>

* bats/docs.bats: Add tests for dolt checkout <doc>

* Added test for branch, merge, and conflicts for dolt docs

* Actually Fixed weird space issue

* {go,bats}: Return error for dolt table *, schema *, ls, add, diff and reset command arguments that contain doltdb.DocTableName, with tests

* go/{cmd,libraries}: Remove pointer from type Docs and refactor resetHard to work with the change

* bats: 2 more tests for checkout

* SaveTrackedDocs for checkout, merge; still one skipped bats test

* go/{cmd,libraries}: Clean up doc checkout

* Simplify bats test docs.bats

* bats/docs.bats: simplify testing

* go/libraries/doltcore/doltdb/root_val_test.go: TestAddNewerTextAndValueToDocFromTbl

* go/libraries/dotlcore/doltdb/root_val: TestAddNewerTextAndDocPkFromRow

* simplify bats tests; remove run/status check where it is unneccesary

* Simplify bats test docs.bats

* libraries/doltcore/doltdb/root_val_test: TestDocDiff

* bats/docs.bats: Add newlines and notes to long test, remove comment

* {go,bats}: Stage tables and docs after successful merge with auto resolved conflicts

* go,{cmd,libraries}: Catch errors, return helpful doc error for checkout, add a comment

* cmd/dotl/commands/cnfcmds/resolve.go: Save docs in autoResolve and manualResolve instead of Resolve command function

* go/{cmd,libraries}: Refactor Checkout to handle docs explicitly

* bats/docs.bats: Add test coverage for checkout doc bug; still not working

* go/cmd/dolt/commands/status.go: Extract methods for retrieving lines of added, modified and removed not staged tbls and docs

* go: Move functions that Save docs to actions/docs.go

* go/cmd/dolt/commands/reset.go: Simplify RemoveDocsTbl helper fxn

* go/libraries/dotlcore/env/dolt_Docs.go: Use fs instead of os

* go/{cmd,libraries}: Simplify GetTblsDocsAndRootsForCheckout and add function comment

* gofmt-w

* go/{cmd,libraries}: Only use localDocs in actions/docs.go, and save docs where root has been updated

* go/cmd/dolt/commands/merge.go: Fail silently on updating staged root on merge

* go/cmd/dolt/commands: Move docsInCnfOnRoot to commands/status.go where it is being used

* go/{cmd,libraries}: Only use localDocs in actions/docs.go, and save docs where root has been updated

* go/cmd/dolt/commands/merge.go: Fail silently on updating staged root on merge

* go/cmd/dolt/commands: Move docsInCnfOnRoot to commands/status.go where it is being used

* bats/docs.bats: Add more test coverage for checkout

* go/{cmd,libraries}: Refactor Checkout command

* go/cmd/dolt/commands/merge.go: Remove silent fail, print message

* go/libraries/doltcore/env: Fix error that was deleting both untracked docs when only one was checked out

* go/{cmd,libraries}: Refactor Checkout command

* go/cmd/dolt/commands/merge.go: Remove silent fail, print message

* go/libraries/doltcore/env: Fix error that was deleting both untracked docs when only one was checked out

* Remove HasDoltPrefix from 2 checks that break create-view tests

* go/cmd/dolt/commands/checkout.go: Use HandleVErrAndExitCode, fix error msg when  is present, remove unneccessary verr declaration

* go/cmd/dolt/commands/checkout.go: Rename functions, return ref (not ref.String()) from getRemoteBranchRef

* Extract helper fxn getTblNotExistError, return NewTblNotExistError with bad table info

* go/cmd/dolt/commands/merge.go: Save docs in merge functions where roots are updated, add comment for UpdatedStagedWithVErr

* go/libraries/doltcore/env/actions: Move getupdatedWorkingAndStagedWithDocs to actions/docs.go

* Declare ctx := context.Background() at top of tests, use ctx throughout test

* Small improvement to AddValueToDocFromTbl, add comments to root_val_teset

* go/cmd/dolt/commands/checkout.go: Return verbose error rather than set variable and return later

* go/cmd/dolt/commands/checkout.go: Return verbose error from helper fxns in commands/checkout.go

* go/libraries/doltcore/env/actions/table.go: Remove err declaration from return params, declare err inline instead

* go/libraries/doltcore/env/actions/tables.go: Rename getTblNotExistError to validateTablesExist

Co-authored-by: Tim Sehn <tim@liquidata.co>
2020-01-17 10:50:15 -08:00