Commit Graph

12 Commits

Author SHA1 Message Date
Simon Farnsworth
ebafde00b0 Remove Repo trait completely
Summary:
We're never going to serve RevlogRepo in production, and we're down to
a single BlobRepo type that will have different backing stores. Remove the
unused trait, and use BlobRepo everywhere bar blobimport and repo_config
(because we previously hardcoded revlog here - we want to change to a BlobRepo
once blobimport is full-fidelity).

Reviewed By: jsgf

Differential Revision: D6596164

fbshipit-source-id: ba6e76e78c495720792cbe77ae6037f7802ec126
2018-01-15 06:37:27 -08:00
Simon Farnsworth
16da012250 Remove ValueIn/ValueOut from the BlobStore generic arguments.
Summary:
BlobStore is entirely generic, and puts no limits on its
implementations. Remove ValueIn and ValueOut type parameters, and insist that
all blobs are Bytes (as per production setups)

Reviewed By: StanislavGlebik

Differential Revision: D6425413

fbshipit-source-id: 455e526d8baebd0d0f1906941648acca89be4881
2017-12-04 10:22:09 -08:00
Simon Farnsworth
5519eae489 Make Bookmarks a parameterless trait
Summary:
As part of removing excess genericism, make Bookmarks a trait with no
associated types or type parameters. I will revisit error types here once I
have removed the Repo trait - these are not ideal, but enough to get things
going

Reviewed By: StanislavGlebik

Differential Revision: D6405315

fbshipit-source-id: 814c106612a061e1766f1ea9a9428a13a73bd007
2017-11-27 08:05:02 -08:00
Simon Farnsworth
16615b3749 Make Heads a parameterless trait
Summary:
As part of removing excess genericism, make Heads a trait with no
associated types or type parameters.

Reviewed By: StanislavGlebik

Differential Revision: D6352727

fbshipit-source-id: df9ef87e0e0abe43c30e7318da38d7f930c37c6e
2017-11-23 07:05:35 -08:00
Siddharth Agarwal
e771348b76 blobrepo: incorporate linknodes in blob state
Summary: Also support them in `generate_memblob_repo.py`.

Reviewed By: jsgf

Differential Revision: D6215721

fbshipit-source-id: c8b855bbc74b619bc093b3aac449a283a1ad33ec
2017-11-13 22:01:55 -08:00
Siddharth Agarwal
a6c5093cc8 blobimport: write out linknodes
Summary:
This makes it quite easy to write out linknodes.

Also regenerate linknodes for our test fixtures -- the next commit will bring
them in.

Reviewed By: jsgf

Differential Revision: D6214033

fbshipit-source-id: 3b930fe9eda45a1b7bc6f0b3f81dd8af102061fc
2017-11-13 22:01:55 -08:00
Simon Farnsworth
573f37bc83 Add several more test repositories of different shapes
Summary:
We want a few more test fixtures that cover different "shapes" of repo
- branching, merging etc - and that test things we don't necessarily expect to
  see in developer use. Add them to the repo as extra fixtures.

The repos have the following shapes (from `hg sl --all` output):
```
@  4f7f3f  simonfar
|  Replace the base
|
o  b65231  simonfar
|  Doubled
|
o  d7542c  simonfar
|  Branch 2
|
| o  168390  simonfar
| |  I think 4 is a nice number
| |
| o  1d8a90  simonfar
| |  Add one
| |
| o  3cda5c  simonfar
|/   Branch 1
|
o  15c40d  simonfar
   base
```

```
@  264f01  simonfar
|  Add 5
|
o  5d4388  simonfar
|  Add 4
|
o  fc2cef  simonfar
|  Add 3
|
o  bc7b4d  simonfar
|  Add 2
|
o  795b81  simonfar
|  Add 1
|
o  4f7f3f  simonfar
|  Replace the base
|
o  b65231  simonfar
|  Doubled
|
o  d7542c  simonfar
|  Branch 2
|
| o  168390  simonfar
| |  I think 4 is a nice number
| |
| o  1d8a90  simonfar
| |  Add one
| |
| o  3cda5c  simonfar
|/   Branch 1
|
o  15c40d  simonfar
   base
```

```
@  49f53a  simonfar
|  Three.four
|
| o  04decb  simonfar
|/   Three.three
|
o  4685e9  simonfar
|  Two.two
|
| o  c27ef5  simonfar
| |  Three.two
| |
| | o  b6a816  simonfar
| |/   Three.one
| |
| o  9e8521  simonfar
|/   Two.one
|
o  ecba69  simonfar
   One
```

```
@    babf5e  simonfar
|\   Merge
| |
| o  4f7f3f  simonfar
| |  Replace the base
| |
| o  b65231  simonfar
| |  Doubled
| |
| o  d7542c  simonfar
| |  Branch 2
| |
o |  168390  simonfar
| |  I think 4 is a nice number
| |
o |  1d8a90  simonfar
| |  Add one
| |
o |  3cda5c  simonfar
|/   Branch 1
|
o  15c40d  simonfar
   base
```

```
@    75742e  simonfar
|\   Merge two branches
| |
| o  264f01  simonfar
| |  Add 5
| |
| o  5d4388  simonfar
| |  Add 4
| |
| o  fc2cef  simonfar
| |  Add 3
| |
| o  bc7b4d  simonfar
| |  Add 2
| |
| o  795b81  simonfar
| |  Add 1
| |
| o  4f7f3f  simonfar
| |  Replace the base
| |
| o  b65231  simonfar
| |  Doubled
| |
| o  d7542c  simonfar
| |  Branch 2
| |
o |  168390  simonfar
| |  I think 4 is a nice number
| |
o |  1d8a90  simonfar
| |  Add one
| |
o |  3cda5c  simonfar
|/   Branch 1
|
o  15c40d  simonfar
   base
```

```
@  cc7f14  simonfar
|  And work
|
o    d59249  simonfar
|\   Merge
| |
o |  03b058  simonfar
| |  Add 5
| |
o |  2fa8b4  simonfar
| |  Add 4
| |
o |  0b94a2  simonfar
| |  Add 3
| |
o |  f61fdc  simonfar
| |  Add 2
| |
o |  36ff88  simonfar
| |  Add 1
| |
o |  170052  simonfar
 /   Two
|
o  33fb49  simonfar
|  Add 5
|
o  f01e18  simonfar
|  Add 4
|
o  163adc  simonfar
|  Add 3
|
o  eee492  simonfar
|  Add 2
|
o  3775a8  simonfar
|  Add 1
|
o  9d374b  simonfar
   One
```

```
@  ec27ab  simonfar
|  And remove
|
o    9c6dd4  simonfar
|\   Merge
| |
o |  03b058  simonfar
| |  Add 5
| |
o |  2fa8b4  simonfar
| |  Add 4
| |
o |  0b94a2  simonfar
| |  Add 3
| |
o |  f61fdc  simonfar
| |  Add 2
| |
o |  36ff88  simonfar
| |  Add 1
| |
o |  170052  simonfar
 /   Two
|
o  64011f  simonfar
|  Add 10
|
o  c1d537  simonfar
|  Add 9
|
o  e819f2  simonfar
|  Add 8
|
o  5a3e8d  simonfar
|  Add 7
|
o  76096a  simonfar
|  Add 6
|
o  33fb49  simonfar
|  Add 5
|
o  f01e18  simonfar
|  Add 4
|
o  163adc  simonfar
|  Add 3
|
o  eee492  simonfar
|  Add 2
|
o  3775a8  simonfar
|  Add 1
|
o  9d374b  simonfar
   One
```

Reviewed By: StanislavGlebik

Differential Revision: D5924752

fbshipit-source-id: ba18df6963c5209e3cfa888862ac22c52d6cebf0
2017-09-28 04:06:24 -07:00
Siddharth Agarwal
a79b8267ae rename Path to MPath
Summary:
`Path` has the potential to be confused with `std::path::Path`.
`MPath` is nice, concise, and clearly different from `Path`.

Reviewed By: jsgf

Differential Revision: D5895665

fbshipit-source-id: dc5ed5c3866b227d753c6d904d3c6d213c882cd7
2017-09-22 17:27:03 -07:00
Siddharth Agarwal
da22546d74 move state into a trait
Summary:
We're going to add more stores like obsmarkers and linknodes very
soon. Stuffing all of them into type parameters is going to get ugly very soon.

Instead, add a trait which represents all the state, and make `BlobRepo`
generic on that trait. Add a few implementations for common use cases like
files and RocksDB-based stores.

This allows the dependency lists for the Mononoke and Eden servers to be more
straightforward.

Reviewed By: jsgf

Differential Revision: D5850372

fbshipit-source-id: 37a0687611687b9616ebbddce70f53e1e5d3267b
2017-09-18 00:35:52 -07:00
Simon Farnsworth
3d267f64f6 mononoke: compile test fixtures into in-memory repos
Summary:
We want to be able to test against repo fixtures. Turn repo fixtures
that have been created by blobimport into in-memory BlobRepos for testing.

Reviewed By: jsgf

Differential Revision: D5834109

fbshipit-source-id: d6fc01f19986b5a6951f25c7c8bda8aa7c9dee56
2017-09-16 02:50:00 -07:00
Siddharth Agarwal
2511835a09 add a small script to regenerate test fixtures
Summary: Makes a formerly manual process automatic.

Reviewed By: jsgf

Differential Revision: D5832456

fbshipit-source-id: 0bfa01aaf08f0794a3b98ab7290d163a65650a7e
2017-09-14 13:52:23 -07:00
Jeremy Fitzhardinge
43d88961a9 mononoke: linear history blobrepo fixture
Summary: Simple linear history with 10 changesets as a file blob repo.

Reviewed By: sid0

Differential Revision: D5731223

fbshipit-source-id: bc479304d13f7a2299d3ecc382e052ad5600c46c
2017-09-11 13:08:36 -07:00