Commit Graph

2794 Commits

Author SHA1 Message Date
Ben Kalman a28f5ddaf9 Render diff struct field paths .foo not ["foo"] (#2379) 2016-08-16 15:28:47 -07:00
Erik Arvidsson f5433ec1b7 JS: Do not shadow struct properties (#2378)
When we create JS struct classes we no longer creates properties for
`chunks`, `hash` or `type` (nor for `toString`, `hashOwnProperty` etc)

If you are using structs with field names that clashes with these then
use a `StructMirror`.

Fixes #2332
2016-08-16 15:12:34 -07:00
Erik Arvidsson 3320518f88 Fix shell script flags (#2377) 2016-08-16 11:58:57 -07:00
Erik Arvidsson c013f1ea1c Go marshal (#2374)
Basic support for creating Noms value from Go values as well as reading
Noms values onto Go values.

Typical usage:

```
// Go to Noms
type T struct {
  S string
  N int32
}
nomsVal, err := marshal.Marshal(T{"Hi", 42})

// Noms to Go
var goVal T
err = marshal.Unmarshal(types.NewStruct("T", types.StructData{
  "S": types.String("Bye"),
  "N": types.Number(555),
}, &goVal)
```

Fixes #1591
2016-08-16 11:47:32 -07:00
Erik Arvidsson 4532c954c0 Update CONTRIBUTING.md 2016-08-16 11:45:02 -07:00
Aaron Boodman a100b28076 Update CONTRIBUTING.md 2016-08-16 11:44:15 -07:00
Sungguk Lim ed549000f1 Updating CONTRIBUTING.md (#2355)
* Describe how to test in CONTRIBUTING.mD

* Adding a way to run js test in CONTRIBUTING.md

* Move 'hacking on noms' contents to CONTRIBUTING.md
2016-08-16 11:42:19 -07:00
Ben Kalman 9079b83927 Use best set/map diff in noms diff (#2372)
In 7c103344 I changed noms log to use left-right diff so that it
completes faster, but it changed noms diff to use left-right as well.
Noms diff is supposed to use best diff.
2016-08-15 17:15:12 -07:00
cmasone-attic 2c63b7cf69 Merge pull request #2371 from cmasone-attic/issue148
Update FAQ to address conflict resolution
2016-08-15 11:03:18 -07:00
Aaron Boodman c8b0d4c680 Add better error reporting to HTTPBatchStore::UpdateRoot() (#2369)
* Add better error reporting to HTTPBatchStore::UpdateRoot()

* Add logging at places where we return http.BadRequest
2016-08-15 11:02:28 -07:00
Chris Masone b5c4d784bb Update FAQ to address conflict resolution
Towards #148
2016-08-15 10:56:37 -07:00
Jang-Soo "Bruce" Lee 7f17329ed9 Add a friendly message to the base path of the noms server, as opposed to giving an unfriendly 404 message (#2365) 2016-08-13 15:22:07 -07:00
Jang-Soo "Bruce" Lee f3dc44a3b1 fix error message (#2364) 2016-08-12 18:08:32 -07:00
Ben Kalman 1e511a61c6 Let Splore open a noms path (#2356)
Currently Splore can only open a database (db=) or a hash (hash=). This
removes the hash and replaces it with the much more general path (p=).

For example, what used to be:
  ?db=http://demo.noms.io&hash=abcd
is now:
  ?db=http://demo.noms.io&p=#abcd

and of course more complex paths work, like:
  ?db=http://demo.noms.io&p=#abcd.field[42].name

I've exposed getHashOfValue in noms.js.
2016-08-12 16:47:26 -07:00
Ben Kalman dac857724d README.md: mention that $GOPATH/bin needs to be in your $PATH (#2359) 2016-08-12 15:52:18 -07:00
Ben Kalman da62bb2b97 Remove most references to ldb: prefix in the .md docs (#2360) 2016-08-12 15:51:25 -07:00
Dan Willhite e975427c02 Merge pull request #2346 from willhite/iter-range
Add IterFrom() function to Map.
2016-08-11 16:41:39 -07:00
Dan Willhite c21d67cbc1 Add IterFrom() function to Map.
Towards #2114 (nomdex)
2016-08-11 16:29:53 -07:00
Eric Halpern c5ccae3852 Fix noms_sync status message to indicate when new dataset is created (#2276)
* Fix noms_sync status message to indicate when new dataset is created

Originally, syncing a commit to a non-existent dataset and an already sync'ed dataset resulted in the same message: "<src> is up to date"

This fix distinguishes 2 cases:

  - Syncing to a new dataset prints "<dest> created"

  - Syncing to an identical dataset prints "<dest> already up to date"

Resolves: #2053

* Make message when noms sync creates new dataset more fun

Addresses: #2053
2016-08-11 16:17:15 -07:00
Ben Kalman 0d6bd01810 Port PathSpec implementation to JS (#2335)
This is a breaking change to the JS API. HashSpec and parseObjectSpec
have been removed in favour of PathSpec, and parse errors now throw
SyntaxError instead of silently failing (this matches JSON.parse).
2016-08-11 15:29:27 -07:00
Dan Willhite 695bc5bcba Merge pull request #2289 from willhite/sets
Add streaming set and improve streaming collection performance.
2016-08-11 15:15:15 -07:00
Dan Willhite 0dce4fd468 Add streaming set and improve streaming collection performance.
Streaming collections now share one ldb instance rather than having 1 ldb instance per collection.
Towards: #2114 (nomsdex)
2016-08-11 14:46:29 -07:00
Mike Gray 865e977320 add csv-import --detect-column-types option (#2329) 2016-08-11 17:02:05 -04:00
Mike Gray b284c7ce03 removing shell script (#2347) 2016-08-11 16:49:00 -04:00
Erik Arvidsson 226a0471f3 JS: Fix browser version of encodeUtf8 (#2339)
When we switched to big endian we forgot to update this.

Fixes #2338
2016-08-11 12:01:01 -07:00
Erik Arvidsson 6178251012 Update to Flow 0.30.0 (#2337)
This requires all parameterized types to have type params. Fortunately
one can use `T<any>` which has the same behavior as the old `T` syntax.

We should tighten the types further after this but this unblocks us.

Fixes #2301
2016-08-11 11:27:41 -07:00
Sungguk Lim 6697c2e6fc Replace github.com/tsuru/gnuflag with github.com/juju/gnuflag (#2340)
Replace vendor folder and where it is used.
2016-08-11 10:29:57 -07:00
Mike Gray 58948d3433 test once, build multiple - jenkins go builds (#2345) 2016-08-11 13:08:55 -04:00
Mike Gray 8c02c5da46 duh, don't change stuff right before commit without testing again (#2342) 2016-08-11 11:14:21 -04:00
Mike Gray f9b818bb34 adding basic script to use on jenkins (#2341) 2016-08-11 11:02:57 -04:00
cmasone-attic d97b852ec6 Merge pull request #2334 from cmasone-attic/embed
Tweak interface/type embedding in databaseCommon
2016-08-10 15:59:21 -07:00
Ben Kalman 9255b62241 Check in the NomsPRBuilder build script as tools/run_pr_builder.sh (#2333) 2016-08-10 14:54:01 -07:00
Chris Masone 4be8107405 Tweak interface/type embedding in databaseCommon
In service of streaming set and map mutators, it'd be helpful for
ValueStore to implement some methods that are exposed only to other
code within the types package, even when a ValueStore is embedded
in a Database. That said, we don't want those methods to become a
part of the public Database API.

To enable this, this patch changes databaseCommon to embed a
*types.ValueStore, instead of composing one. This causes all the
ValueStore methods to be a part of the databaseCommon API, but
since all the Database construction methods return a Database by
interface, stuff like BatchStore() all gets masked. Thus, callers
still can't access ValueStore methods. Databases are passed into
the types package as ValueReadWriters, though, so code in there
can call any method on that interface -- including unexported stuff.
2016-08-10 14:29:11 -07:00
Ben Kalman 630d3a29cc Port AbsolutePath implementation to JS (#2325) 2016-08-10 13:44:08 -07:00
Peter Abrahamsen 33121dc102 Fix type-o in Flickr sample (#2283)
Based on the signature, this is how the copy should read.
2016-08-10 14:16:20 -04:00
Tegan Snyder 25124a12b0 Update csv README.md (#2328) 2016-08-10 12:13:19 -04:00
Ben Kalman f7bf38bbd1 Port path implementation to JS (#2317)
JS had an incomplete implementation, most notably missing: string
parsing, hash # syntax, and support for hash indices.
2016-08-09 17:12:08 -07:00
Mike Gray a812034182 changing csv-import of map to include pk in struct (#2316) 2016-08-09 19:57:11 -04:00
Aaron Boodman daf2ed7a78 Update faq.md 2016-08-09 15:59:40 -07:00
Mike Gray 75ef96bdc7 implement csv-export writing maps of structs (#2322) 2016-08-09 18:31:54 -04:00
Erik Arvidsson da1c278264 JS: Safari 9 support (#2295)
- Lower case header names in fetch function
- fetchUint8Array should return an Uint8Array and not an ArrayBuffer
- Safari does not have slice on typed arrays

Fixes #2265
2016-08-09 13:36:19 -07:00
Adam Leventhal e1fd70c2e3 nomsfs: small fix up for Finder regression (#2318) 2016-08-08 21:40:42 -07:00
Adam Leventhal 8fb43f1ef4 nomsfs: general cleanup (#2309) 2016-08-08 18:08:32 -07:00
Dan Willhite 415121f9ac Merge pull request #2315 from willhite/noms-refactor
Factor our noms Command and Help so they are reusable.
2016-08-08 14:53:28 -07:00
Dan Willhite deb4d2ac0c Factor out noms Command and Help so they are reusable. 2016-08-08 14:08:29 -07:00
Dan Willhite 0374168d15 Merge pull request #2314 from willhite/pager-flag
Allow RegisterOutputFlag to register more than once. Fixes #2312.
2016-08-08 10:17:30 -07:00
Dan Willhite ae37ff405a Allow registerOutputFlag to register more than once. Fixes #2312. 2016-08-08 08:38:30 -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
Ben Kalman fd034f8c81 Simplify Path construction in Go (#2262)
Previously there were 3 ways to construct a Path: via methods like
AddIndex, via parsing/AddPath, and simply via using append() (since Path
is a slice).

This patch deletes the former and leaves only ParsePath and append(),
with the ability to manually create the various path parts (I've made
them public). I also added documentation for the public types/fields.
2016-08-05 15:16:04 -07:00
Aaron Boodman 50b3791e6b Update README.md 2016-08-05 15:14:29 -07:00