Commit Graph

171 Commits

Author SHA1 Message Date
Lukas Piatkowski
efc38342f7 bundle2-resolver: convert FilelogDeltaed to Filelog
Summary: This code handles deltaed filelogs and resolves them into proper Filelogs

Reviewed By: farnz

Differential Revision: D7011702

fbshipit-source-id: e8dc4844657011bc1085463eedd1790b87d317dc
2018-02-22 03:45:25 -08:00
Stanislau Hlebik
11af232471 mononoke: send replychangegroup to the client
Summary:
Return a reply to a client so that it doesn't fail.
Reply consists of just one replychangegroup that tells a client that the push
has succeeded (even though currently it wasn't).

resolve() function returns future of Bytes instead of a stream. It may be
suboptimal, but should be fine for now, and it's already used by a few
wireproto methods.

Reviewed By: lukaspiatkowski

Differential Revision: D7010578

fbshipit-source-id: 9b5425b912c640d4e2bac957a02e9881813b8871
2018-02-21 11:07:19 -08:00
Katherine McKinley
28ce2f6211 Replace NodeHash with ChangesetId in BlobRepo
Summary:
This change removes get_changeset_by_nodeid and replaces it with
get_changeset_by_changesetid, and propagates the changes to callers.

A few places still have ChangesetId::new() because I'm not sure where
the original NodeHash comes from. If you have any pointers, I would be
happy to fix them before landing.

Reviewed By: lukaspiatkowski

Differential Revision: D7031923

fbshipit-source-id: cd00ea1d2b955538e26d7b5735aed33fe0ae0330
2018-02-21 10:42:06 -08:00
Simon Farnsworth
9e366eacd4 Introduce a LazyMemblob test blobstore
Summary:
The current Memblob store is eager; this is great for finding certain
classes of bugs (those that assume an ordering that is not guaranteed), but not
so good for exposing other classes of bugs (those that assume that the future
has done its work before it resolves).

Add a lazy variant that functions in the same way as Memblob, but that waits
until it's polled to return.

Reviewed By: StanislavGlebik

Differential Revision: D7033792

fbshipit-source-id: 4c2d8a8150d908bcb26347757f96f99e20d74fc2
2018-02-21 07:17:00 -08:00
Stanislau Hlebik
ebf46512ef mononoke: test cleanup, part 2
Summary: Cleanup blobimporting

Reviewed By: lukaspiatkowski

Differential Revision: D7000047

fbshipit-source-id: 2657a5608c3d58df71154dd2e97c4c899c33714a
2018-02-16 03:08:40 -08:00
Stanislau Hlebik
f503d1993c mononoke: test cleanup, part 1
Summary:
Use hgclone_treemanifest instead of hgcloneshallow.
Note that it changes the behaviour of test-infinitepush.t - now it sends
treegroup part too. Since we actually want to send treegroup part during
infinitepush push, that means that the test was broken and now it fixed.

Reviewed By: lukaspiatkowski

Differential Revision: D7000046

fbshipit-source-id: 61b4517f23081faab1738f44d27220ae8063e077
2018-02-16 03:08:40 -08:00
Stanislau Hlebik
387bb1af8c mononoke: fixed test-push-protocol.t test
Summary:
In D6988301 luk noticed that test output is incorrect. Turned out that client
asked server to fetch revision that exists only client-side.

To fix the test let's set treeonly=True and do shallow clone.
Figuring out why exactly it won't work without these flags is very
time-consuming. But that's the usual setup we expect our clients to have.
Besides test-init.t have used these flags and worked fine, so does
test-push-protocol.t

Reviewed By: lukaspiatkowski

Differential Revision: D7000045

fbshipit-source-id: 5e3a6e9fc9c0a1ed0a1e2074f5ac86533d42fa09
2018-02-16 03:08:40 -08:00
Stanislau Hlebik
4c717285ca mononoke: improve integration tests infra
Summary:
1) Do not use system hg in tests.
Let's use current version of hg in the tests. It will simplify debugging
because we can now easily tweak both hg client and server. It will also result
in fewer test breakages, because previously our tests were broken when system
hg was updated.

2) Run integration tests in parallel with -j option

Reviewed By: quark-zju

Differential Revision: D6998535

fbshipit-source-id: dac4eb6d33978161ffe42d9d6a5a39a3ddf3a4e3
2018-02-16 03:08:40 -08:00
Lukas Piatkowski
329afcf975 integration test: fix mistyped line in push protocol test
Reviewed By: farnz

Differential Revision: D6998593

fbshipit-source-id: d65fa1c5ccb1558547d1e9c031e95d29048ab3ca
2018-02-15 07:26:29 -08:00
Stanislau Hlebik
48c5ac631a mononoke: fix tests
Summary:
In D6923197 we've made it so that nullid always exists. This is necessary for
pull, because client can send nullids (for example, if client has an empty
repo). That has broken revset test.

Also gettreepack capability was added, that has broken test-push-protocol.t

Reviewed By: quark-zju

Differential Revision: D6988301

fbshipit-source-id: 2deafc3489de9f50126de7212656ffc075ef3537
2018-02-14 08:37:01 -08:00
Stanislau Hlebik
c0b25700db mononoke: add support many mfnodes and basemfnodes in gettreepack
Summary:
Quick recap: gettreepack is a treemanifest wireproto method.
It's used to send treemanifest data to the client. Client sends list of
manifest nodes it's interested in (mfnodes), and list of nodes it already has
(basemfnodes). Server should find the difference and send it back. Client
usually call this wireproto method when it checks out new revision (`hg
update`), but it uses in other cases too (for example, in `hg prefetch`).

Before we supported exactly one mfnode and exactly one basemfnode. This is
usually fine for `hg update` use-case, but `hg prefetch` can request many
mfnodes and can send empty basemfnode. So let's support this too.

Note that current implementation isn't efficient. It uses at most one
basemfnode, meaning that it can send data that client already has. Also for
each mfnode we generate separate stream of changed entries. That means that the
same entries can be fetched many times.

Reviewed By: lukaspiatkowski

Differential Revision: D6923197

fbshipit-source-id: d25f9a01ca568c84811ee1a13181e70eb217eb53
2018-02-14 06:36:04 -08:00
Stanislau Hlebik
ea4e34d811 mononoke: add failing infinitepush integration test
Summary:
Add an integration infinitepush test. Currently infinitepush is not implemented
in mononoke, so the test fails. We'll use it later to test our functionality.

Also add infinitepush wireproto capability, otherwise the test is useless - it
sends no infinitepush parts at all.

Reviewed By: quark-zju

Differential Revision: D6948967

fbshipit-source-id: 3b479c2c7f036c2b9424de0f160f742bb8ff7412
2018-02-14 03:35:33 -08:00
Stanislau Hlebik
22a09370b7 mononoke: basic lookup implementation
Summary:
Wireproto method to lookup if a revision/bookmark exists.
Currently supports only full hashes, later we'll add support for bookmarks and
node prefixes.

Reviewed By: farnz

Differential Revision: D6948358

fbshipit-source-id: af92a892eae8f787053447e601ebf95dfd638fa4
2018-02-13 10:21:43 -08:00
Stanislau Hlebik
4542e7dc1a mononoke: fix tests
Reviewed By: farnz

Differential Revision: D6977472

fbshipit-source-id: 370f0a5a902b98539075da65adc15f67ce4a7080
2018-02-13 10:08:42 -08:00
Stanislau Hlebik
f76937cbc7 mononoke: support renames in hg pull
Reviewed By: quark-zju

Differential Revision: D6922881

fbshipit-source-id: 69fb667ec222d7cc65db8f687178b8db61bd4912
2018-02-13 08:54:31 -08:00
Stanislau Hlebik
97032c01fc mononoke: fetch full file history
Summary:
remotefilelog getfiles method requires fetching the whole history. Current
implementation is naive and it's going to be slow on big repos.
But later we're going to replace it with mysql

Reviewed By: quark-zju

Differential Revision: D6913180

fbshipit-source-id: 9244272a0339a2a83cf5b5615963b65ad2fcdc07
2018-02-13 08:54:31 -08:00
Stanislau Hlebik
9fa48d87d0 mononoke: simple getfiles implementation
Summary:
Currently missing a few things:
1) Fetching the whole history for a file
2) Dealing with renames

That will be fixed in the next diffs

Reviewed By: quark-zju

Differential Revision: D6913179

fbshipit-source-id: f847c61791488bb2842a245ae00de7420b97145e
2018-02-13 08:54:31 -08:00
Stanislau Hlebik
0ad9a311ff mononoke: getfiles arguments parsing
Summary:
getfiles is a remotefilelog method to fetch file content. Mercurial client
calls it on-demand, usually during `hg update` command. So normal `hg pull`
with remotefilelog doesn't send filelogs back to the client.

This diff implements getfiles arguments parsing. The code is tricky, so I've
added lots of comments to explain what's going on.

Reviewed By: farnz

Differential Revision: D6913178

fbshipit-source-id: 0248993c3ac487956e0ff547996d51b75cdaee96
2018-02-13 08:54:31 -08:00
Lukas Piatkowski
dfd17c9d57 mononoke: create integration test for a basic push case to treemanifest repo
Summary: making this test work is a 2018 m1 milestone

Reviewed By: farnz

Differential Revision: D6950112

fbshipit-source-id: 798a1b8e722e96b27f0cb8267b82232d3fe0496d
2018-02-13 06:22:17 -08:00
Stanislau Hlebik
1d7668ffba mononoke: remove get_mpath and get_path and use get_name
Summary:
As we discussed before, let's add get_name() method that returns MPathElement,
and remove get_path() and get_mpath().

Except for renaming, diff also make repoconfig work with tree manifest, and
fixes linknodes creation in blobimport - previously basename was used instead
of the whole path.

Reviewed By: jsgf

Differential Revision: D6857097

fbshipit-source-id: c09f3ff40d38643bd44aee8b4488277d658cf4f6
2018-02-07 07:53:48 -08:00
Stanislau Hlebik
c7c6c8be53 mononoke: reverse nodes in the pull
Summary:
Pulling more than one node doesn't work, because mononoke revsets return
children before the parents. In that case mercurial client fails because new
child points to non-existent parents. To fix it let's reverse the output.
It's bad, because we lose the advantages of streaming, but we do it now anyway
because `getbundle()` method returns Bytes. Besides changelog data should be
fairly small.

Reviewed By: farnz

Differential Revision: D6899239

fbshipit-source-id: 67b3954bfbed8e0aaa69e0da453dae443cd24912
2018-02-06 02:20:39 -08:00
Stanislau Hlebik
5170568488 mononoke: add many_files_dirs test fixture
Summary:
Add a fixture where there are many files and directories.
History is linear for now, but later we may add merge commtis.
It will be used to test gettreepack method.

Reviewed By: lukaspiatkowski

Differential Revision: D6818544

fbshipit-source-id: 798a1bea66eb49491f98fe5e997b172f3c927c53
2018-01-30 01:33:06 -08:00
Stanislau Hlebik
5d1bcd7a67 mononoke: fix test
Summary: Mercurial was updated, it doesn't print 'new head created' anymore

Reviewed By: farnz

Differential Revision: D6819007

fbshipit-source-id: 9ead8d0d9c165f3c8d9a6f519642012edfbc6013
2018-01-26 08:20:45 -08:00
Stanislau Hlebik
906035f526 mononoke: basic getbundle changegroup implementation
Summary:
Super-basic implementation of generating changegroup part in getbundle. All it does is sending changelog
entries - so no manifest and no filelog entries. While it's very simple, it may
actually be enough for a real production use-case. With treemanifest and
remotefilelog we don't need to pull anything except for changelog entries,
everything else will be downloaded on demand.

Reviewed By: jsgf

Differential Revision: D6748070

fbshipit-source-id: 1dcd802a4b3b111f935e713e7696d58f05861b77
2018-01-21 07:37:30 -08:00
Xiaotian Wu
92c0528b1f modify manifestid related code
Summary: nodehash -> manifestid

Reviewed By: lukaspiatkowski

Differential Revision: D6719378

fbshipit-source-id: 1ec59b33270e389da8e74b3864c37a86c9d89f81
2018-01-16 07:57:25 -08:00
Xiaotian Wu
ed94c6702c modify changesetid related code
Summary: modify the parameter type

Reviewed By: lukaspiatkowski

Differential Revision: D6695443

fbshipit-source-id: fafcdc83773cb86c08cdcf3a8d80c1c9a498eca5
2018-01-16 07:57:25 -08:00
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
Stanislau Hlebik
1417398de8 mononoke: move ssl config options to the separate toml config section
Summary: It removes a bit of copy-pastes code

Reviewed By: sid0

Differential Revision: D6627250

fbshipit-source-id: b110dcad998a240b6da60bc3347c7c5c0370aae0
2018-01-04 07:36:34 -08:00
Stanislau Hlebik
15d23af540 mononoke: get rid of filesblob state
Summary:
It won't be used in prod anyway, and for local use rocksdb blob state is still
preferable

Reviewed By: sid0

Differential Revision: D6627197

fbshipit-source-id: d9ca55b0221c050e8e8e35914aff22906198874a
2018-01-04 07:36:34 -08:00
Siddharth Agarwal
886e67bad2 integration: allow running a subset of tests
Summary: integration_runner.py now takes test arguments.

Reviewed By: jsgf

Differential Revision: D6607064

fbshipit-source-id: ed8271b67e76bebe92bca3931fc3620aaf577b51
2018-01-01 17:52:36 -08:00
Siddharth Agarwal
64e5182680 fix test-init.t
Summary:
The test wasn't waiting for the Mononoke server to be available. Also
improve the error message slightly.

Reviewed By: jsgf

Differential Revision: D6606102

fbshipit-source-id: d0fde39aef8b3423fd1a8996a01f12e8a9661597
2018-01-01 17:52:36 -08:00
Stanislau Hlebik
a095cc23da mononoke: add treenode_simple method
Summary:
Fetching file sizes is very expensive - it's one more round-trip to the
blobstore.
Add method that returns tree content, but doesn't fetch blob sizes.

Reviewed By: jsgf

Differential Revision: D6545108

fbshipit-source-id: 3d335eafa9dc367fb9e607f5c147b7e5c37cf133
2017-12-15 10:37:42 -08:00
Stanislau Hlebik
0cceb35e49 mononoke: select free port in the test
Summary:
Two tests can't be run simultaneously because they use the same port. This diff
fixes it.

Reviewed By: farnz

Differential Revision: D6457855

fbshipit-source-id: 3e5f82211bcd87abc608bdeab239fe680976316d
2017-12-06 07:37:23 -08:00
Simon Farnsworth
b38dd81782 Make known protocol check that the commit is fully present
Summary: `changeset_exists` only checks that the changeset is in the blob store. Once we start accepting pushes, we'll also want to check that the changeset is reachable from a head. Use revsets to check this. Once we have a notion of "completeness" for changesets, we'll switch `known` to use that instead - this code is still useful as a way to go from `changeset_exists` to `changeset_complete` in bulk.

Reviewed By: jsgf

Differential Revision: D6205695

fbshipit-source-id: 7e3b5c30bc5e459feb95a20913d8a04f3fda7469
2017-12-04 11:54:53 -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
Stanislau Hlebik
95e0ae5c6e mononoke: do not use jq tool in integration tests
Summary:
It maybe not installed on the system. Let's use simple python script instead.

Note: unfortunately we can't use 'python -m json.tool' because we need to sort
entries in the list

Reviewed By: jsgf

Differential Revision: D6437136

fbshipit-source-id: 0703f45c46d220046b9ef484bdf406a7f936557b
2017-11-30 03:23:17 -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
Stanislau Hlebik
72d65064c5 mononoke: client auth on the eden server
Summary:
Config file needs to have ca file in PEM format.
It is used to authenticate client.

See code comments for more details.

Reviewed By: jsgf

Differential Revision: D6323439

fbshipit-source-id: 6b6f1fd68605b263dcb33b051843e10d3f5cb38e
2017-11-20 05:35:55 -08:00
Stanislau Hlebik
33b8a6aa62 mononoke: HTTPS in eden server
Summary:
Avoid using plain HTTP and use HTTPS instead.
To do this config needs to provide paths to server certificate and private key files in PEM format.
Then they will be converted to Pkcs12 archive.

This diff adds authentication of server i.e. client can check that it talks to a real server. Next diff adds authentication of a client.
Lower-level `hyper::server::Http::bind_connection()` is used instead of `hyper::server::Http::bind()` method in order to add TLS support.

See code comments for more details.

Implementation is more complicated than I expected it to be. I need to use 3 more new crates. Lmk if there is a better way to do this.

Reviewed By: jsgf

Differential Revision: D6323440

fbshipit-source-id: 544f27e6ec210ddf840212b0c0c94145980e8be3
2017-11-20 05:35:55 -08:00
Stanislau Hlebik
745c6c799e mononoke: read eden-server configs from toml file
Summary:
We have too many parameters, and cmd-line args are no longer good enough. Let's
use toml based config, with a format that's similar to mononoke server
repoconfig.

Reviewed By: farnz

Differential Revision: D6313512

fbshipit-source-id: 61379e93707a4fcbb42aa8a0392ce526dab19f2e
2017-11-20 05:35:55 -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
Stanislau Hlebik
160b89994e mononoke: accept urls with trailing slash and without
Summary: Let's not be too restrictive about urls

Reviewed By: markbt

Differential Revision: D6099460

fbshipit-source-id: 228a5b3a3cc0f09d68307a3695952543a2f5f05a
2017-11-01 19:11:20 -07:00
Stanislau Hlebik
e300d76095 mononoke: add logging to eden-server and improve error reporting
Summary:
1) Glog logging is added
2) The whole error chain is reported

Reviewed By: markbt

Differential Revision: D6099290

fbshipit-source-id: 1ec9a7fe4c6b9f2b918f47852884ba8afa997916
2017-11-01 19:11:20 -07:00
Jeremy Fitzhardinge
3ac3c41431 mononoke: rename server scm/mononoke/server:server -> scm/mononoke:mononoke
Summary: Use a more easily discoverable name.

Reviewed By: farnz

Differential Revision: D6191999

fbshipit-source-id: 140372bb714af7b8c2fff481f257264acb719735
2017-10-31 10:14:30 -07:00
Stanislau Hlebik
d4b41ae5d1 mononoke: move eden-server to eden_server
Summary: To make folder name consistent with the buck target

Reviewed By: farnz

Differential Revision: D6098739

fbshipit-source-id: 7d876a0fa352d98a5d4164093d07ebe7388680e7
2017-10-19 09:05:49 -07:00
Lukas Piatkowski
0a76eb6f45 blobimport: add optional thrift service and stats counters
Reviewed By: farnz

Differential Revision: D6030720

fbshipit-source-id: 26971f13061e9a3a1e65d339fc7bdc444b5165fd
2017-10-11 10:58:08 -07:00
Lukas Piatkowski
565afd9615 blobimport: use drain from slog-glog-fmt for logging
Summary: the glog drain does not swallow f.e. backtrace of error_chain errors, so it is a bit easier to debug the tool

Reviewed By: farnz

Differential Revision: D6021671

fbshipit-source-id: 32bfe01bfd77d85c37a2a446cb3e5d000763c689
2017-10-11 05:50:46 -07:00
Stanislau Hlebik
2e51af1bc3 mononoke: add more integration tests
Summary: Make sure we use treemanifest in the tests, and add commit with a directory

Reviewed By: farnz

Differential Revision: D5974524

fbshipit-source-id: 5ef9f110243001e1916509f53741cccb42dc8deb
2017-10-05 00:02:17 -07:00
Stanislau Hlebik
486e5ed681 mononoke: use cpupool in eden server
Summary:
In Eden server we want to return list of file sizes for each file in the directory.
For now we are doing a separate call to the blobrepo. Since there can be lots of such calls, let's make them in parallel using cpupool

Reviewed By: lukaspiatkowski

Differential Revision: D5950452

fbshipit-source-id: 6b852a49c201ccc14ceb8f950dd61fa5cdebad0a
2017-10-03 11:50:46 -07:00
Stanislau Hlebik
d904a5c13f mononoke: handle null manifest pointer specially
Summary:
Previously blob importing failed if commit has null manifest pointer. This diff
fixes it by returning empty blob.

Reviewed By: lukaspiatkowski

Differential Revision: D5953225

fbshipit-source-id: 196e4dc3aaf2820ddeee366f20966e598aee97cb
2017-10-03 09:05:52 -07:00
Stanislau Hlebik
108438646d mononoke: fix --interactive
Summary:
There was an upstream fix 573baab2a797 that fixed run-tests --interactive for
test with many test cases. This diff grafts the change

Reviewed By: lukaspiatkowski

Differential Revision: D5902793

fbshipit-source-id: 0b90a0105d0bf0e2d9f5f788503dc40009441c40
2017-09-29 01:13:20 -07: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
Stanislau Hlebik
5961c7558a mononoke: filelog metadata problem fix
Summary:
Mercurial filelog entries may have metadata fields in the beginning, usually used to track copies/renames. Previously mononoke eden server returned this metadata as part of the file blob.
This diff changes it. Now `get_content()` method returns file content without metadata, and to make it consistent, both `get_content()` of the blobrepo and revlog repo do the same.

This decision certainly has it's tradeoffs, because now it's more difficult to get metadata (`get_raw_content` needs to be used).
But we'll probably change how metadata is stored anyway, that's why I think changing `get_content` method is fine.

This diff also cleans up server/src/main.rs file, because previously it had to strip metadata itself.
Also diff fixes problem in metadata parsing - it previously failed if file is less than 2 bytes

Reviewed By: farnz

Differential Revision: D5901476

fbshipit-source-id: f3ade0179710352590068c238e6a733aab68a512
2017-09-26 00:36:55 -07:00
Stanislau Hlebik
17613ba4e7 mononoke: add hghave
Summary:
Mercurial test suite have #testcases features. It allows to use the same test
file for two different tests while tweaking just small parts of it.

I used testcases in test-eden-server.t, but I used it incorrectly - #files test
case wasn't actually used at all. This is because hghave is not present in the
repo.

This diff adds hghave. It's a copy-paste from upstream mercurial

Reviewed By: farnz

Differential Revision: D5901439

fbshipit-source-id: 2131733d8c523b7f7ce9e6a087c77fed6a427e6d
2017-09-26 00:36:55 -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
Lukas Piatkowski
4fbc0213a3 server: read config repo instead of command line arguments to start the server
Reviewed By: StanislavGlebik

Differential Revision: D5833380

fbshipit-source-id: bad649592a2aa15ad5bc1448266986bed4c6f989
2017-09-22 09:22:18 -07:00
Stanislau Hlebik
c474b57a9e blobimport: add an option to postpone compaction
Summary: Compaction can slow down blobimporting a lot. Let's add an option to postpone it till the end

Reviewed By: farnz

Differential Revision: D5882003

fbshipit-source-id: 0611a8e94b3d7331bdacf909d820526f547414a0
2017-09-22 08:33:25 -07:00
Stanislau Hlebik
ab14a6f6c9 mononoke: support rocksdb blobstore in eden server
Reviewed By: lukaspiatkowski

Differential Revision: D5861654

fbshipit-source-id: 036249899910c7aa1acda0632e6a3dcd15bf8f72
2017-09-21 08:25:23 -07:00
Stanislau Hlebik
62bf1ee5b5 mononoke: add simple utility to generate dependencies in TARGETS files
Summary:
Manually adding all the dependencies in the TARGETS file is quite annoying. This simple tool does it for you!
It queries buck to get list of files for the target, and also queries all the rust_library mononoke dependencies.
Then it parses source files and generates TARGETS list.

Tool is super-simple and that's why it's not always correct (for example, it fails to find a deps if hasn't been used in mononoke before), but it works good enough for many use-cases (see test plan).

Reviewed By: lukaspiatkowski

Differential Revision: D5861828

fbshipit-source-id: ab8cc96d8bc394af172ee09da3aceb0ffb7493e8
2017-09-20 04:19:45 -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
Siddharth Agarwal
d24cf40483 make eden-server and mononoke server bookmarks be in the same dirs
Summary: I'm going to move this to a common location very soon.

Reviewed By: jsgf

Differential Revision: D5850319

fbshipit-source-id: 09937659330de93cf74bf827f225418dd413865d
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
Stanislau Hlebik
1087dfc4b3 mononoke: use method to get file blob in eden server
Reviewed By: jsgf

Differential Revision: D5553374

fbshipit-source-id: 7390fd6ed09319c3a10ece3dfcf44c1c4f3cd057
2017-08-09 08:39:07 -07:00
Stanislau Hlebik
22b6b350a1 mononoke: add eden server method that returns content of the manifest entry
Summary: Method that returns content of the manifest entry in json format.

Reviewed By: sid0

Differential Revision: D5527659

fbshipit-source-id: 1832b645f69da40cbd620a6bff318e25594c5148
2017-08-09 08:39:07 -07:00
Jeremy Fitzhardinge
5a0efcfc3b mononoke: make server support multiple repos
Summary:
Server can construct boxed Repo instances, and performs all client protocol operations in terms of trait methods. This allows the repo to be set dynamically.

This currently makes the repo type a single setting which applies to all repos; this can be generalized to a per-repo setting later.

Reviewed By: sid0

Differential Revision: D5540670

fbshipit-source-id: ac450b078849d9bd65d6e3dc91b73d652ca86ce7
2017-08-02 17:43:24 -07:00
Stanislau Hlebik
ed4e09ba6e mononoke: regex-based url handling
Summary:
Soon I'm going to add more different url handlers. And current url handling is
neither robust nor extendable. Let's use regexes to do url handling

Reviewed By: jsgf

Differential Revision: D5489445

fbshipit-source-id: f418c3f40892903b573a33e57899b47e5719a5ea
2017-08-02 01:01:55 -07:00
facebook-github-bot
2b6af6b941 Initial commit
fbshipit-source-id: f75baa4ff6aa71973f677b752d7aba582cf4927f
2017-07-27 18:00:19 -07:00