Commit Graph

17 Commits

Author SHA1 Message Date
Erik Arvidsson
5edf89cf3d Replace d.Chk.True with d.PanicIfFalse (#2563)
And same for d.Chk.False
2016-09-14 13:11:28 -07:00
Eric Halpern
48854dc999 Move datas.descendsFrom and prune search using Ref.Height (#2480)
- Move to commit.CommitDescendsFrom
 - When searching for an ancestor in the commit history, prune
   whenever the commit.Height() < ancestor.Height()
 - Add new test TestCommitDescendsFrom to verify correctness and pruning.
2016-09-02 11:44:38 -07:00
cmasone-attic
65edbaabe3 Allow Dataset HEAD to be set to non-fastforward commits (#2271)
The Dataset.Commit() code pathway still enforces fast-forward-only
behavior, but a new SetHead() method allows the HEAD of a Dataset to
be forced to any other Commit.

noms sync detects the case where the source Commit is not a descendent
of the provided sink Dataset's HEAD and uses the new API to force the
sink to the desired new Commit, printing out the now-abandoned old
HEAD.

Fixes #2240
2016-08-05 15:38:41 -07:00
Erik Arvidsson
ff88ff2a65 Commit type: Compute the type for meta too (#2185)
This changes to compute the type for the meta field in a similar
way to how we compute the type for the value field.

Fixes #2179
2016-07-28 17:14:35 -07:00
Erik Arvidsson
7a4436e9b5 Remove Type name property (#2161)
Only struct types have a name property and this was left over from
an earlier refactoring.
2016-07-26 15:31:43 -07:00
Erik Arvidsson
68e92092e5 Commit type: Inner parents struct should also have meta
This changes so that all commit struct types have a meta field
(which might be an empty struct).

Increment the serialization version since the old data does not
necessarily have the meta field.

Fixes ##2112
2016-07-21 18:25:17 -07:00
Dan Willhite
4e1bbfcfa5 Simplify basic commit type for validation check 2016-07-21 12:30:36 -07:00
Dan Willhite
137e39d683 Add meta information to commits in cvs-import and url-fetch.
Add "meta" field to commit.
Change noms_log to print meta information when it exists.
Fixes #2012.
2016-07-20 17:18:21 -07:00
Erik Arvidsson
e2f261b142 Go: Compute commit type based on value and parents
We now compute the commit type based on the type of the value and
the type of the parents.

For the first commit we get:

```
struct Commit {
  parents: Set<Ref<Cycle<0>>>,
  value: T,
}
```

As long as we continue to commit values with type T that type stays
the same.

When we later commits a value of type U we get:

```
struct Commit {
  parents: Set<Ref<struct Commit {
    parents: Set<Ref<Cycle<0>>>,
    value: T | U
  }>>,
  value: U,
}
```

The new type gets combined as a union type for the value of the inner
commit struct.

Fixes #1495
2016-07-18 14:28:56 -07:00
Erik Arvidsson
6ffe591329 Go: Change NewCommit API to take value and parents
This is in preparation for computing the commit type when it is
created and to do that we need to have the value and the parents.
2016-07-18 14:17:34 -07:00
Rafael Weinstein
ee5c0f3a72 MakeStructType and NewStructWithType now takes slices rather than maps (#1945)
NewStructType and NewStructWithType now takes slices rather than maps
2016-07-07 16:36:48 -07:00
Aaron Boodman
1d752e3101 Update license: Noms will be copyright Attic Labs. (#1976) 2016-07-05 22:07:42 -07:00
Rafael Weinstein
93e0eca51f Type cache (#1865)
Go TypeCache
2016-07-01 09:23:11 -07:00
Aaron Boodman
d58d558548 Make types.String not cache ref (#1836)
Fixes https://github.com/attic-labs/noms/issues/1542
2016-06-16 07:04:28 -07:00
cmasone-attic
74a0c98d75 Go: Use unified ref-height-based Pull algorithm (#1722)
Change Dataset.Pull to use a single algorithm to pull data from a
source to a sink, regardless of which (if any) is local. The basic
algorithm is described in the first section of pulling.md. This
implementation is equivalent but phrased a bit differently. The
algorithm actually used is described in the second section of
pulling.md

The main changes:
- datas.Pull(), which implements the new pulling algorithm
- RefHeap, a priority queue that sorts types.Ref by ref-height and
  then by ref.TargetHash()
- Add has() to both Database implementations. Cache has() checks.
- Switch Dataset to use new datas.Pull(). Currently not concurrent.

Toward #1568


Mostly, prune reachableChunks
2016-06-08 08:57:48 -07:00
Erik Arvidsson
bc9f9d19e1 Go: Make StructDesc use slices for names and types instead of a map (#1741)
The map showed up in benchmarks...

Fixes #1716
2016-06-06 16:58:40 -07:00
Aaron Boodman
bb7ac52265 Move the Go SDK into noms/go 2016-06-05 02:14:49 -07:00