Commit Graph

261 Commits

Author SHA1 Message Date
Lukas Piatkowski
936be76e75 mercurial_types: Added Sync to Box<Entry + Sync>
Summary: Would be nice to be able to return future that references a boxed Entry

Reviewed By: jsgf

Differential Revision: D5688859

fbshipit-source-id: acb7bcc461f886bca08b84f31dbebe4f692187f1
2017-08-24 02:49:37 -07:00
Stanislau Hlebik
b72949e3d1 mononoke: blob importing of tree manifest repo
Summary: Main part is `get_stream_of_manifest_entries` that creates a stream of all tree manifest entries by recursively going through all of them.

Reviewed By: jsgf

Differential Revision: D5622490

fbshipit-source-id: 4a8b2707df0300a37931c465bafb1ed54d6d4d25
2017-08-18 09:51:17 -07:00
Stanislau Hlebik
ee917edf1b mononoke: add path join method
Summary:
Adds method similar to https://doc.rust-lang.org/std/path/struct.Path.html#method.join.
Will be used in the next diff to prepend path prefix to the tree manifest entries

Reviewed By: jsgf

Differential Revision: D5563808

fbshipit-source-id: 3637275093c301bf159083cb9bfedaa0e490a75e
2017-08-18 04:40:23 -07:00
Stanislau Hlebik
c33e4afddf mononoke: same storage keys for manifest entries as for the file entries
Summary:
A preparation step before blob importing of tree manifest repos to blobrepo.

`get_parents()` method of BlobEntry reads parents from the blobstore. It works fine for file entries because file entries can stores its parents in the blobstore. With tree manifests BlobEntry can contain also tree manifest entries, and that means that tree manifest entries parents should also be stored somewhere in the blobstore.

I suggest to use the same logic for the tree manifest entries as for the file entries. File and manifest entries have two blobstore entries - one stores hash of the content and parents, another stores the actual content.

To do this I moved `RawNodeBlob` and `get_node()` to the separate module and made fields public.

Reviewed By: jsgf

Differential Revision: D5622342

fbshipit-source-id: c9f0c446107d4697b042544ff8b37a159064f061
2017-08-15 10:37:34 -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
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
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
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
facebook-github-bot
2b6af6b941 Initial commit
fbshipit-source-id: f75baa4ff6aa71973f677b752d7aba582cf4927f
2017-07-27 18:00:19 -07:00