Commit Graph

16 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
679729b5e5 mononoke: fix com/lpt encoding auxencoding
Summary: I checked mercurial pathencode, and 'com3x', 'xcom3', 'auxx' etc shouldn't be encoded.

Reviewed By: jsgf

Differential Revision: D5679798

fbshipit-source-id: f2de60a81cbba95d06d1afea6dee72295fb9ac00
2017-08-23 05:13:50 -07:00
Stanislau Hlebik
48776b34a3 mononoke: move data/ and meta/ prefixes to fsencode_* functions
Summary:
Core mercurial takes "data/" and "meta/" prefixes into account when does
fsencode.
It doesn't make a difference now, but it will make a difference when we'll add
hashencode to the fsencode() function.

Reviewed By: jsgf

Differential Revision: D5670748

fbshipit-source-id: 661974c25e00979eedffb30b432518135f0dc631
2017-08-23 05:13:50 -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
5849f4687d mononoke: better fsencode in mercurial_types::Path
Summary:
Previously `fsencode()` worked incorrectly if Path was a directory. We didn't notice it before because we've never used Path to store directories, but we will use it for TreeManifest.

I considered two options when implementing it.
1) Put some kind of flag `isDir` inside Path struct. But that would create complications with `join()`  method. For example, you can't join anything to the file - what should we do in this case? panic? return result?
2) and another `fsencode_dir()` method. Clients need to know what kind of Path they have. I choose this option because it requires less changes and brings less complications compared to the option 1

Reviewed By: sid0

Differential Revision: D5574847

fbshipit-source-id: c4c476a7fc3b884de847c431a56ff5f313c1389f
2017-08-18 04:40:23 -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
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
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
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
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
facebook-github-bot
2b6af6b941 Initial commit
fbshipit-source-id: f75baa4ff6aa71973f677b752d7aba582cf4927f
2017-07-27 18:00:19 -07:00