Commit graph

41 commits

Author SHA1 Message Date
David Pollak
bde0a6fbf6 Cleaned up some warnings and errors running against Rust 1.58.1 2022-02-24 15:20:48 -05:00
Andrew Jeffery
3c0c407192
Add initial github actions setup (#237)
Add initial github actions setup
2022-01-10 17:18:18 +00:00
alexjg
e72571962b
Correctly sort actor IDs when encoding changes (#241)
The javascript implementation of automerge sorts actor IDs
lexicographically when encoding changes. We were sorting actor IDs in
the order the appear in the change we're encoding. This meant that the
index that we assigned to operations in the encoded change was different
to that which the javascript implementation assigns, resulting in
mismatched head errors as the hashes we created did not match the
javascript implementation.

This change fixes the issue by sorting actor IDs lexicographically. We
make a pass over the operations in the change before encoding to collect
the actor IDs and sort them. This means we no longer need to pass a
mutable `Vec<ActorId>` to the various encode functions, which cleans
things up a little.

Fixes #240
2021-10-17 11:58:15 +01:00
Alex Good
fcb30c27c9
Fix the -o parameter of automerge export
The last commit added a `-o` parameter to `automerge export` for
consistency with `automerge merge`. This commit makes it possible to
omit this parameter.
2021-10-14 12:24:58 +01:00
alexjg
e682ac62ea
Add a merge command to the CLI (#239)
`merge` loads documents either from a list of path, or from standard
input, merges them and emits the merged document to standard output or a
given path.
2021-10-14 12:00:30 +01:00
Alex Good
5a26f8fcd1 Add missing licenses 2021-09-23 23:41:51 +01:00
Orion Henry
3db6f9ef13
Fix Clippy issues, broken tests, formatting issues (#188)
* fix clippy errors

* Bump travis nvm version

* Add smol_str arbitrary

* Fix Err prefix clippy error

* Fix clippy needless-borrow

* Ensure SortedVec sorts on deserialize

Co-authored-by: Andrew Jeffery <dev@jeffas.io>
2021-06-28 13:20:21 +01:00
Andrew Jeffery
8b3938c2e7
Rename UncompressedChange to Change (#173)
It wasn't really uncompressed as we have compressed and uncompressed
changes in the backend. It is just not encoded into the binary format.
The module separation (protocol vs backend) should help with the
distinction.
2021-06-16 11:50:26 +01:00
Andrew Jeffery
4e5f1e1451 Dont document cli 2021-05-24 13:18:44 -07:00
Andrew Jeffery
641fd11703
Change init to new and add defaults (#130)
Structs should use `new` for the constructor name and implement
`Default` where they can.
2021-05-14 21:35:09 +01:00
Andrew Jeffery
7a08c52dac
Fix clippy (#118) 2021-05-07 17:07:41 +01:00
Andrew Jeffery
3a8447c068
Remove automerge bench harness (#106)
This removes the default wrapper which throws errors with some cli
arguments, e.g. --save-baseline which is nice for being able to compare
versions!
2021-04-27 10:30:07 +01:00
Andrew Jeffery
d1934f2286 Add formatting config 2021-04-26 09:42:36 -07:00
Andrew Jeffery
fc45ff09a3
Allow change to return value from users closure (#84)
* Allow change to return value from users closure

* Add closure_result field to OptimisticChangeResult
2021-04-15 10:49:04 +01:00
Alex Good
c103b0638e Ritual abasement at the altar of clippy 2021-03-02 19:35:00 +00:00
Alex Good
4f4674a4a1 Implement cursors in frontend 2021-03-02 16:07:52 +00:00
Alex Good
b0fc259892 Run clippy and cargo fmt 2021-02-03 16:39:38 +00:00
Alex Good
98015f5a9c Better formatting for cli docs 2021-02-01 18:24:21 +00:00
Alex Good
a28ae6edb6 Fix dependency encoding in document format 2021-01-31 15:59:51 +00:00
Alex Good
c34f771693 Add color to CLI 2021-01-30 17:56:54 +00:00
Alex Good
6affcae4d1 Document change command 2021-01-30 12:47:11 +00:00
Orion Henry
db2d540cae zero length error 2021-01-29 17:59:57 -05:00
Alex Good
24dcd9c1e6 Add automerge change CLI op 2021-01-29 14:27:51 +00:00
Alex Good
ae4b9f8f94 Add some benchmarks and make some performance related tweaks 2021-01-25 13:49:38 +00:00
Alex Good
497372db99 Immutable frontend rewrite 2021-01-16 17:40:47 +00:00
Jeremy Rose
023f3c1672
fix automerge-cli ftbfs (#29) 2020-11-08 14:47:00 +00:00
Scott Trinh
128e90bb18
cli: Add mutation CLI subcommands to IDEAS documentation (#25) 2020-06-10 11:09:59 +01:00
Scott Trinh
b943c41e7d
cli: Add import command (#21)
* cli: wip Add import command

* cli: wip Save bytes to out file

* cli: Update `export` for reader/writer interface

* cli: Update import for reader/writer interface

* cli: Add `atty` to check if stdin/out is a TTY

* cli: Require file path if not streaming in or out

* cli: Align naming of the binary changes file, whether in or out

* cli: Small documentation fixes

* cli: Allow specifying an input file for import

* cli: Add `duct` crate for testing

* cli: comment-out println that was showing up in output files

* cli: Add basic CLI tests for import, export, and import -> export

* cli: EOF NL

* cli: Remove a few redundant calls to clone

* cli: Move duct to dev-dependencies

* Remove debug message
2020-06-08 20:01:55 +01:00
Scott Trinh
aa87af4aaf
cli: Export state as JSON (#17) 2020-05-26 21:08:23 +01:00
Orion Henry
e9c03ccdaa BinChange is now Change 2020-05-22 15:16:42 -04:00
Orion Henry
89a1ed46f7 move change back to the backend repo 2020-05-22 13:54:02 -04:00
Orion Henry
2d31ed09cc canonical BinChange wip 2020-05-21 18:53:07 -04:00
Orion Henry
1478a3eebc fix my stdout binary ideas 2020-05-19 16:51:31 -04:00
Orion Henry
46d7aeb5a0 more idea tweaks 2020-05-19 16:46:53 -04:00
Orion Henry
1256060458 tweak ideas.md 2020-05-18 13:52:40 -04:00
Orion Henry
6654bb2fed ideas file for cli 2020-05-18 13:41:29 -04:00
Alex Good
9bb374b492 Run rustfmt 2020-05-14 01:05:01 +01:00
Alex Good
3bfae69e19 Merge branch 'master' into frontend 2020-05-14 00:19:35 +01:00
Alex Good
dd650b0c38 Merge branch 'performance' into frontend 2020-05-09 13:04:44 +01:00
Orion Henry
c45351b121 first cut of the C api 2020-05-07 07:57:34 -07:00
Alex Good
15b7bb8c60 Make a CLI out of an enmormous pile of hacks 2020-04-22 00:35:10 +01:00