Instead of returning errors, these now use d.Exp to raise catchable
errors.
Also, added commit hash at which code was pulled from encoding/json
Marshal io.Reader into a Blob, unmarshal Blob into io.Writer
Unmarshal and Marshal are tools for moving data from Noms into native Go and
back. The rules are described in the documentation of the two functions, but
the behavior is broadly similar to encoding/json.
Towards issue #160
The plan is to modify the encoding/json code heavily for use in
marshaling between native Go and Noms values. This pulls in the files
unmodified so we have a record of our changes.
Get rid of the notion of a special 'Empty' Commit value, which means
that a freshly created Dataset or DataStore will have no Head at
all. To allow callers to tolerate this, we provide the MaybeHead()
method for them to use when they're unsure about whether a given
Data{set,Store} has ever been committed to.
To ease the API impacts of this change, we've also modified Commit()
to take a types.Value and handle creating a Commit struct holding that
Value and descending directly from the current Head.
Callers who wish to provide alternate parents can use CommitWithParents()
This patch changes the "Head" of a DataStore to be a single Commit,
as opposed to a SetOfCommit. This has several consequences:
1) Commit() will only accept Commits that are descendants of the
current Head.
2) Calls to Commit() can now fail, so the method now has an additional
'ok' return value that callers must check. Whether ok is true or
false, the DataStore struct returned is the right one to use for
subsequent calls to Commit() -- retries or otherwise.
3) This rolls up the stack, so Dataset.Commit() can now fail as well,
and similar logic applies.
4) sync.SetNewHeads() also behaves similarly, since it can also now fail.
5) Examples now die on Commit() failures.
Also, removes the /dataset endpoint from server. It's deprecated, and this
patch would have required updating it, so instead just delete it.
Towards issue #147