Commit graph

12 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
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
5a26f8fcd1 Add missing licenses 2021-09-23 23:41:51 +01:00
Andrew Jeffery
4e5f1e1451 Dont document cli 2021-05-24 13:18:44 -07: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
Alex Good
c34f771693 Add color to CLI 2021-01-30 17:56:54 +00:00
Alex Good
24dcd9c1e6 Add automerge change CLI op 2021-01-29 14:27:51 +00:00
Alex Good
497372db99 Immutable frontend rewrite 2021-01-16 17:40:47 +00: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
2d31ed09cc canonical BinChange wip 2020-05-21 18:53:07 -04:00
Alex Good
15b7bb8c60 Make a CLI out of an enmormous pile of hacks 2020-04-22 00:35:10 +01:00