Commit Graph

1727 Commits

Author SHA1 Message Date
Stanislau Hlebik
91d587e052 mononoke: change Path implementation
Summary:
Instead of storing `Vec<u8>`, let's store `Vec<PathComponent>`, where PathComponent is Vec<u8> without b'\'.
To make sure len() is still `O(1)` let's store it too.

Reviewed By: sid0

Differential Revision: D5573721

fbshipit-source-id: 91967809284d79bf0fcdcabcae9fd787a37c318b
2017-08-10 05:24:42 -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
ad876328e4 mononoke: add get_file_blob() method to Blobrepo
Summary:
Let's create a separate function `fetch_file_blob_from_blobstore` that will be
used to get content of the blob without creating file::BlobEntry.
file::BlobEntry requires Path and type parameters that won't be passed to eden
server.

Reviewed By: jsgf

Differential Revision: D5537647

fbshipit-source-id: 13fb2fbba7d3068b88aac2d842cc92b4da6ca80c
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
Stanislau Hlebik
467bcb1bd7 mononoke: add get_size method
Summary: Will be used by eden server in the next diff

Reviewed By: jsgf

Differential Revision: D5553955

fbshipit-source-id: 196e2da597d0456b4337a6d9ada8fe188075e87e
2017-08-09 08:39:07 -07:00
Siddharth Agarwal
587db4ddf8 factor out code to initialize parents
Summary: We're going to use this code in another context very soon.

Reviewed By: StanislavGlebik

Differential Revision: D5581807

fbshipit-source-id: 6d43eb114b3d82fd97a9b9cce775f1f398853e84
2017-08-08 10:06:56 -07:00
Siddharth Agarwal
9754ad3e66 rustfmt the mercurial-types crate
Summary: I'm going to make significant changes to this crate in upcoming diffs.

Reviewed By: StanislavGlebik

Differential Revision: D5581790

fbshipit-source-id: 2a3a4b183b554ca46c3bc611452e55eb17238f20
2017-08-08 10:06:56 -07:00
Siddharth Agarwal
758669577e make linkrev non-optional
Summary:
I don't think it's possible for linkrevs to be `-1` (not sure why it was
written as `!0` -- jsgf, any idea why?)

Reviewed By: StanislavGlebik

Differential Revision: D5581780

fbshipit-source-id: 69d685d863ee51adc846e889eb766f3fecc47681
2017-08-08 10:06:56 -07:00
Siddharth Agarwal
372ea24b88 factor out code to grab filelogs once lock is acquired
Summary: We're going to reuse this code in an upcoming diff.

Reviewed By: StanislavGlebik

Differential Revision: D5581683

fbshipit-source-id: 08724333c2f637bbf2c2e534855c9802c15328ee
2017-08-08 10:06:56 -07:00
Siddharth Agarwal
d882d544d7 rustfmt changes to the mercurial crate
Summary: I'm making significant changes to this crate.

Reviewed By: StanislavGlebik

Differential Revision: D5581677

fbshipit-source-id: a300ddd1def1de5ac78b63aede15a03e97e0dde1
2017-08-08 10:06:56 -07:00
Siddharth Agarwal
ec0219d850 allow dead code for MemHeads::new
Summary:
`buck check` for all targets in `scm/mononoke` was failing because of
this.

Reviewed By: StanislavGlebik

Differential Revision: D5581555

fbshipit-source-id: 2039de4f3a69fac85cf7a8e503eaf59915c93c13
2017-08-08 10:06:56 -07:00
Siddharth Agarwal
afe358b381 change 'renamed' to 'copied' in BlobNode
Summary:
Mercurial treats copying as its first class operation, not renaming.
Using 'renamed' instead of 'copied' is pretty confusing.

Reviewed By: StanislavGlebik

Differential Revision: D5579408

fbshipit-source-id: 4494aa4bf56bd2c00f4331da9edd88d756525dd2
2017-08-08 10:06:56 -07:00
Siddharth Agarwal
cbb30b685a add a couple of clarifying comments
Summary: These comments make it a bit clearer to me what's going on.

Reviewed By: StanislavGlebik

Differential Revision: D5579411

fbshipit-source-id: 84cbd650208f200a04462cb6dda5d05a9d8e6196
2017-08-08 10:06:56 -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
Jeremy Fitzhardinge
025c4ace72 mononoke: hgproto: generic Repo error
Summary: Add placeholder error in hgproto for errors from Repo operations. This is intended to be chained onto the real error.

Reviewed By: sid0

Differential Revision: D5540669

fbshipit-source-id: dedf12c9c749c40ba77444fb0adb30c8ddc868ed
2017-08-02 17:43:24 -07:00
Jeremy Fitzhardinge
aa4fe84373 mononoke: repo: allow Repo to be boxed into trait object
Summary: Add helpers to allow an implementation of a Repo object to be boxed up into a type-erased trait object.

Reviewed By: sid0

Differential Revision: D5540673

fbshipit-source-id: c16332f6a548d053125dd3376e7e06d0ddffadf9
2017-08-02 17:43:24 -07:00
Jeremy Fitzhardinge
573256c18a mononoke: Repo: add bookmarks
Summary: Add a `get_bookmarks()` method to the Repo trait and implement it for RevlogRepo and BlobRepo.

Reviewed By: sid0

Differential Revision: D5540667

fbshipit-source-id: 710849e50b1d358be1c4f95a1cbd61efb7c2cf6b
2017-08-02 17:43:24 -07:00
Jeremy Fitzhardinge
22baa86eac mononoke: blobrepo: use chaining for Heads and Blobstore errors
Summary: Blobrepo can take any Heads or Blobstore implementation, each of which may have their own error type. Error chain doesn't support type parameters, and can only have foreign links for specific concrete types. To handle this we have a couple of placeholder errors in Blobrepo's errors which are chained onto the real underlying error.

Reviewed By: sid0

Differential Revision: D5540676

fbshipit-source-id: 9543e204754f22dfd68a04aec5a484fa85d53ff8
2017-08-02 17:43:24 -07:00
Jeremy Fitzhardinge
144bea971a mononoke: bookmarks: add helpers for boxing Bookmarks trait objects
Summary:
Add BoxedBookmark to assist in boxing a Bookmark trait, and implement Bookmark
for Box<_> and Arc<_> Bookmark trait objects.

Reviewed By: sid0

Differential Revision: D5540675

fbshipit-source-id: 7582adbd2858f6814d57b7e54089b922886a4d54
2017-08-02 17:43:24 -07:00
Jeremy Fitzhardinge
09b25e1507 mononoke: bookmarks: fold ListBookmarks into Bookmarks
Summary:
In practice, no users of Bookmarks will not want listing, and all
implementations need to be able to support it.

Reviewed By: StanislavGlebik

Differential Revision: D5540672

fbshipit-source-id: d64a3894c7cd14d329bd23809525935461289bc3
2017-08-02 17:43:24 -07:00
Jeremy Fitzhardinge
6cfc6704b6 mononoke: stockbookmarks: make Error a parameter
Summary: Allow the error type to be any type the internal errors can be converted to.

Reviewed By: sid0

Differential Revision: D5540671

fbshipit-source-id: 1077132d25bcc13ba2a3a509c916f2e07ac10dcf
2017-08-02 17:43:24 -07:00
Stanislau Hlebik
8027459013 mononoke: use correct path for file node
Summary:
blobimport appends ".bincode" in the end of the file.
Let's do the same in blobrepo

Reviewed By: sid0

Differential Revision: D5527661

fbshipit-source-id: d54fe52c1d282f038a47ac2f2cd0aaf917a92227
2017-08-02 01:01:59 -07:00
Stanislau Hlebik
1ef546243e mononoke: add #![deny(warnings)]
Reviewed By: farnz

Differential Revision: D5524331

fbshipit-source-id: b3bb99877021b8f1edab526641cf5f97a37bb065
2017-08-02 01:01:55 -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
Siddharth Agarwal
8d7e114d2c explain why only uncompressed bundles work for now
Summary: It's because of an upstream Mercurial bug.

Reviewed By: StanislavGlebik

Differential Revision: D5535362

fbshipit-source-id: 4a035b7e70d52b0211a4a2d5e9df580152f43fac
2017-08-01 09:53:37 -07:00
Siddharth Agarwal
d76eae6e99 mention in README that Mononoke supports Mercurial
Summary: Closes https://github.com/facebookexperimental/mononoke/pull/1

Differential Revision: D5520573

Pulled By: sid0

fbshipit-source-id: 8f3619a0d2c842dfd2f480e757ffaf2b4e8b4cfa
2017-07-28 14:41:37 -07:00
facebook-github-bot
2b6af6b941 Initial commit
fbshipit-source-id: f75baa4ff6aa71973f677b752d7aba582cf4927f
2017-07-27 18:00:19 -07:00