Commit Graph

20 Commits

Author SHA1 Message Date
Saurabh Singh
0326fe4584 introduce history store
Summary: This commit just introduces the history store.

Reviewed By: DurhamG

Differential Revision: D8553823

fbshipit-source-id: 93af6059296d11c4fcc0dd306b4472c4f2168fa7
2018-06-27 19:05:31 -07:00
Saurabh Singh
164bf3e85a fix error messaging
Summary: This commit just fixes the messaging for the errors.

Reviewed By: DurhamG

Differential Revision: D8553820

fbshipit-source-id: 73f2cd13e7538b6870b16a0e47e657a6d08af9e3
2018-06-26 11:36:09 -07:00
Saurabh Singh
7c9227818a refactor rust datastore to a consistent naming scene
Summary: This is just a refactor to address the naming scheme.

Reviewed By: quark-zju

Differential Revision: D8269217

fbshipit-source-id: 8c52d2c67837550e0b7dc1a45b3faf9a80319b61
2018-06-04 17:39:47 -07:00
Saurabh Singh
7067e4ca1f fix nit in implementation
Summary:
Based on review for D8214151 by quark-zju, addressing the nit here as
well.

Reviewed By: quark-zju

Differential Revision: D8267140

fbshipit-source-id: 12c3355852a49859c2b0a243fa8666105c914c73
2018-06-04 16:21:38 -07:00
Saurabh Singh
8ba5a79489 adding tests for bad data store
Summary:
Adding the tests for the case when the union store has only one data
store which always returns an `Err` as `Result`. This `Err` is not of the type
`KeyError` which the union store handles differently.

Reviewed By: quark-zju

Differential Revision: D8214156

fbshipit-source-id: bd077af343086c92f46ec6a6f1551d05dd9bda09
2018-06-04 16:21:38 -07:00
Saurabh Singh
242f2b904f add tests for empty data store
Summary:
Adding tests for the case when the union store only has a single data
store which is completely empty.

Reviewed By: quark-zju

Differential Revision: D8214151

fbshipit-source-id: 9d8f329548a1b7e105a5dc6219067a6e292fe97c
2018-06-04 16:21:37 -07:00
Saurabh Singh
34ca90a6f8 rename test methods to be more specific
Summary:
This commit just renames the methods to be more specific. This is
useful for later changes.

Reviewed By: quark-zju

Differential Revision: D8214153

fbshipit-source-id: e8db9148334f7cd539aca626e3798e256b9b022f
2018-06-04 16:21:37 -07:00
Saurabh Singh
a4f5e8aefc add tests for empty union date store
Summary:
These tests just test the expected outcome when the union data store
is empty.

Reviewed By: quark-zju

Differential Revision: D8018975

fbshipit-source-id: a2cc4c87509b857dbf5f6af506f165ea62080db8
2018-05-15 18:37:47 -07:00
Saurabh Singh
cab75fbb90 add common traits for Key
Summary:
This commit derives the common traits for the Key type just as we did
for the Node type in D7872300.

Reviewed By: quark-zju

Differential Revision: D8018973

fbshipit-source-id: 566a69be16d74529c6eb5f157b84de25835f780f
2018-05-15 18:37:47 -07:00
Saurabh Singh
88a2d8ff6b implement quickcheck::Arbitrary for Key in revisionstore
Summary:
We need to implement `quickcheck::Arbitrary` for Key so that it can be
used for the quickcheck tests.

Reviewed By: quark-zju

Differential Revision: D8018977

fbshipit-source-id: dbdbb34fbd7eaeb18321eafec4604d752f496a4d
2018-05-15 18:37:47 -07:00
Saurabh Singh
0b5b994973 implement quickcheck::Arbitrary for Node type in revisionstore
Summary:
We need to implement `quickcheck::Arbitrary` for Node so that it can
be used for quickcheck tests.

Reviewed By: quark-zju

Differential Revision: D8018978

fbshipit-source-id: ceda99622370bee6e9d05b839f9856c0526f553c
2018-05-15 18:37:47 -07:00
Saurabh Singh
411736dc7c add 'quickcheck' crate to revisionstore
Summary:
I am planning to use the `quickcheck` crate for testing the union data
store. This commit just adds the crate to the revisionstore.

Reviewed By: quark-zju

Differential Revision: D8018974

fbshipit-source-id: d390deeb01aa7d1bf1e66bb5bc948d48bd3f269e
2018-05-15 18:37:47 -07:00
Saurabh Singh
8688e1cc5e union data store: union data store implementation in Rust
Summary:
This commit just introduces the `UnionDataStore` and implements the
`DataStore` trait for it.

Reviewed By: quark-zju

Differential Revision: D7801615

fbshipit-source-id: 14eabd2aa1b1e085de94aec126a7108231ec6e8d
2018-05-15 18:37:47 -07:00
Saurabh Singh
d2b9c6c6ac union store: introduce common type for the union store implmentation
Summary:
We will be implmenting multiple union stores and therefore, it makes
sense to encapsulate the common logic in its own type. This also abstracts the
usage of `RefCell` within the union store.

Reviewed By: jsgf

Differential Revision: D7884651

fbshipit-source-id: a74b6d9df5ee0d7d04359219e276fd5713b3a00b
2018-05-15 18:37:47 -07:00
Saurabh Singh
bcb7ac0b32 node: add common traits for the node type
Summary:
Based on the review comments for D7801615, this commit adds the common traits
for the `Node` type

Reviewed By: jsgf

Differential Revision: D7872300

fbshipit-source-id: 44dedfc3ec0e18ac0dee0dcfc5f7dfc4aff2511d
2018-05-15 18:37:47 -07:00
Durham Goode
18697e3fb3 hg: implement getmissing() for Rust hgstore
Summary:
Initial implementation of getmissing for a simple Rust pass through
data store. Future diffs will extend this to implement the union data store
completely in Rust.

Reviewed By: quark-zju

Differential Revision: D7632405

fbshipit-source-id: e660d33f8231410805cfaba6d77c56f27b002f8e
2018-05-14 12:05:13 -07:00
Durham Goode
f2b4d7f2e0 hg: implement getmeta() for Rust hgstore
Summary:
An initial implementation of getmeta for the Rust hg data store. Future
diffs will add more functionality.

Reviewed By: quark-zju

Differential Revision: D7632404

fbshipit-source-id: 53bd3b96b777bc3c5aef2b4d07ce1a9d9a5a52ed
2018-05-14 12:05:13 -07:00
Durham Goode
39dde8552d hg: implement getdeltachain() for Rust hgstore
Summary:
An initial implementation of getdeltachain for a simple pass through
data store. Future diffs will add additional functionality.

Reviewed By: quark-zju

Differential Revision: D7632407

fbshipit-source-id: 1a38089ba8ea70f8772af95afd871ee493082d80
2018-05-14 12:05:13 -07:00
Durham Goode
880ff5d0a9 hg: implement datastore.get() for Rust hgstore
Summary:
Implements the get function for a simple pass through rust data store
layer. Future diffs will implement more functions, and then later we will
implement the entire union data store in Rust.

Reviewed By: quark-zju

Differential Revision: D7632403

fbshipit-source-id: 3a1d0a8500e3110213d70dc1cff637cf8eadd809
2018-05-14 12:05:13 -07:00
Durham Goode
a97e97e413 hg: initial boiler plate for new hgstore crate
Summary:
This will contain all the Python centric hg store code that will let
Python call into the Rust storage layer.

Reviewed By: quark-zju

Differential Revision: D7632406

fbshipit-source-id: 6b7bcc8f47a23e9c0121e1f92de1137369bf584e
2018-05-14 12:05:12 -07:00