Summary: Let's pass just one field instead of 4
Reviewed By: farnz
Differential Revision: D8889899
fbshipit-source-id: 8b30496a86950ed534439f5469f8740ee32345b8
Summary:
Now bundle2 resolver first tries to parse `b2x:commonheads`. If it exists then
it then assumes it's a pushrebase bundle. Otherwise it assumes it's a normal
push bundle.
The actual handling of pushrebase bundle will be implemented in the next diff
Reviewed By: farnz
Differential Revision: D8858318
fbshipit-source-id: de5879abec2b3ed82e3b505d621c45754ab4d4d2
Summary:
I'm planning to add a separate function that will resolve pushrebase bundle. In
this diff let's just move resolving of normal bundle to a separate function
Reviewed By: farnz
Differential Revision: D8858184
fbshipit-source-id: 085d1e013135d9d557183058d11b2031b0bdf083
Summary:
This is a series of patches which adds Cargo.toml files to all the crates and tries to build them. There is individual patch for each crate which tells whether that crate build successfully right now using cargo or not, and if not, reason behind that.
Following are the reasons why the crates don't build:
* failure_ext and netstring crates which are internal
* error related to tokio_io, there might be an patched version of tokio_io internally
* actix-web depends on httparse which uses nightly features
All the build is done using rustc version `rustc 1.27.0-dev`.
Pull Request resolved: https://github.com/facebookexperimental/mononoke/pull/7
Differential Revision: D8778746
Pulled By: jsgf
fbshipit-source-id: 927a7a20b1d5c9643869b26c0eab09e90048443e
Summary:
We need to be able to distinguish logical transaction failure from
infrastructure failure, so change the `Transaction::commit` future to
`Future<Item=bool, Error=Error>`, where `false` indicates a logical transaction
failure. This allows the caller to determine whether a retry or other recovery
logic is needed.
Reviewed By: lukaspiatkowski
Differential Revision: D8555727
fbshipit-source-id: 8ab64f3019f2644e7eaabc8d699d99aa8eb08fbb
Summary:
It's easier to use scuba when you separate the part of log that identifies the log from the part that can have arbitrary data in it.
It's also easier to search for code after a sample was found
Reviewed By: jsgf
Differential Revision: D8625612
fbshipit-source-id: 7d7e382530dd5d7e5d69c6d34caccda4b6d2921b
Summary: more logging more fun
Reviewed By: StanislavGlebik
Differential Revision: D8577655
fbshipit-source-id: 92a160ea8f8c0b8e012a1461fbd3f5d71b4bd171
Summary: We had a suspicion that this computation is slow and affects the performance of pushes. Later we found many other different reasons why push is slow and we never rechecked if this diff is still valuable, but this will change anyway with Bonsai Changesets coming.
Reviewed By: StanislavGlebik
Differential Revision: D8549429
fbshipit-source-id: 878127677ea6d3f76661da5bc8a7e54f5ba7485e
Summary:
Prior to this diff when we constructed list of child entries to be passed to CreateChangeset we have been walking the tree of manifests and appending everything that we have found to the child entries list, which often include the entries of the commit parent if it is pushed in the same unbundle command.
After this diff we append only the things that are connected to the diff to be created filtering out the ones that will be handled by parent creation.
This code assumes that the client doesn't send us entries that are part of parent that were pushed in a separate unbundle command. If we wouldn't make that assumption then we would need to consult the blobstore in order to filter out those entries.
Reviewed By: StanislavGlebik
Differential Revision: D8547867
fbshipit-source-id: ac72f1b6066c15b1fea029e0224fe0ebf9a2db59
Summary:
Fetching the blob is still required to compute the node hash, but we don't have
to reupload it.
Reviewed By: farnz
Differential Revision: D8508462
fbshipit-source-id: 341a1a2f82d8f8b939ebf3990b3467ed7ad9244c
Summary:
This will also allow file blob sharing between the Mercurial and Mononoke
data models.
Reviewed By: farnz
Differential Revision: D8440330
fbshipit-source-id: a29cd07dcecf0959dffb74b7428f3cb11fbd3db6
Summary:
Store manifests as Thrift blobs instead. Required fixing up a lot of
different places, but they should all be pretty clear now.
Reviewed By: farnz
Differential Revision: D8416238
fbshipit-source-id: 523e3054e467e54d180df5ba78445c9b1ccc3b5c
Summary:
Since file and manifest nodes are going to be stored differently, rename this to
get_hg_raw_content to make it clear that it'll work for both files and
manifests.
I tried allowing a `Chain` to be used, but ran into https://github.com/carllerche/bytes/issues/213. Boo.
Reviewed By: farnz
Differential Revision: D8413001
fbshipit-source-id: 2f06affa265beaed2ac0a48ee4fec8ce922307da
Summary:
Implementation of generic `store|fetch` for bonsai types.
- bonsai types have unique typed hashes associated with each bonsai type, I'm leveraging this fact to implement generic `store|fetch` methods on `BlobRepo`
Reviewed By: farnz
Differential Revision: D8254810
fbshipit-source-id: 5f798fade4cb8d1ac851f94c7ad7e64636bbca65
Summary:
Unfortunately `HgParents` can't represent all valid parents, because
it can't represent the semantically important case where `p1` is `None` and
`p2` is not. (For incoming changesets we'd like to keep full fidelity with
Mercurial.)
All the Thrift definitions store `p1` and `p2` separately anyway, so just make
that change throughout `RevlogChangeset` and `BlobChangeset`.
Reviewed By: StanislavGlebik
Differential Revision: D8374125
fbshipit-source-id: 63674daaad05d4d4cae3778744dbf1c14b3c2e3b
Summary: the newly added context should add much more visibility into why an error was returned
Reviewed By: jsgf
Differential Revision: D8286343
fbshipit-source-id: d65387f40da2c14964e85552ae1ec7e75a135c47
Summary:
This change screams for using something like "await", but because we don't have it yet we need to reorganize this code into a chain of `and_then`.
Thanks to that if we attach a context to a future inside `and_then` the context will be properly reported when an error happens inside that future.
This is a bit of a simplification, but the previous code used the equivalent of `map` rather than `and_then` and this resulted in Errors returned from within f.e. `upload_changesets` to have a context of "While resolving B2xInfinitepushBookmarks" attached which was confusing.
Reviewed By: StanislavGlebik
Differential Revision: D8284606
fbshipit-source-id: b8a4bd63b9732caea53089f1b9088f2624a42f87
Summary:
Now it is as it should be: mercurial_types have the types, mercurial has revlog related structures
burnbridge
Reviewed By: farnz
Differential Revision: D8319906
fbshipit-source-id: 256e73cdd1b1a304c957b812b227abfc142fd725
Summary: The data logged there is too large, so print only a subset of it (changesets hashes) and only as context for error
Reviewed By: farnz
Differential Revision: D8235881
fbshipit-source-id: c81eeca2baf26def4d24b288f9d29dd8c23823d8
Summary: There is nothing we can do with it ATM
Reviewed By: StanislavGlebik
Differential Revision: D8090873
fbshipit-source-id: 232024938fe33583e328ad3231d9213dd6792601
Summary:
Previously, we assumed that all content hashes came from Mercurial;
this is not going to remain true, as we will want to be able to upload manifests
that have been synthesised from Bonsai Changesets. Turn the previous boolean
into a tri-state, and fix up all callers to get the behaviour they expect.
Reviewed By: StanislavGlebik
Differential Revision: D8014911
fbshipit-source-id: 9156b9fab4542ceb269626ad005e1b28392b5329
Summary:
Rust 1.26 adds many new language features. In particular `impl Trait` is now
stable, so we no longer need `conservative_impl_trait`.
There also seems to have been changed in the (unstable) TryFrom with respect to
usize, and the behaviour of the never type `!`.
There are still a few deprecation warnings, but they don't cause the build to
fail.
Path remapping is now stable, so the buck config needs to change to use it
rather than the unstable command line option.
TODO:
- get aarch64 rust-crates-io build (can defer to a later update)
Reviewed By: Imxset21
Differential Revision: D7966091
fbshipit-source-id: 2e61e262c21eb01c852a36f49c6a6369cdaddcdb
Summary:
This will make it easier to change the "real" bookmark type from AsciiString to
String if we decide to do that.
BookmarkPrefix is a separate type because we may want to change it from
AsciiString to String. Also we don't want to confuse a bookmark prefix with a
bookmark name.
Reviewed By: jsgf
Differential Revision: D7909992
fbshipit-source-id: 3d4d075c204ed5ef1114a743430982c2836bac04
Summary:
The commits that are blobimported have out of order or simply incorrect lists of changed files.
Because we have to persists Changesets as is we are passing the untouched list of files here to be used by Changeset.
Reviewed By: farnz
Differential Revision: D7830310
fbshipit-source-id: 56adec2c317896decaa9176b3a6bfb0cab187ed0
Summary: The deltas are meant to be applied on raw filenode content that has incorporated copy/move information. Make it so
Reviewed By: jsgf
Differential Revision: D7777329
fbshipit-source-id: 23ce90269cdf5dbb8a16aab026c031c2af68fccb
Summary: The current behavior of delta::apply will panic Mononke server when the client sends malformed delta request. This change will instead propagate an Error explaining why the delta was malformed.
Reviewed By: jsgf
Differential Revision: D7775544
fbshipit-source-id: a64c27c7b9f13323b8be70eb8c2cdf315ce8f08d
Summary: Being able to push multiple bookmarks in a single hg push is required for using hg push as tailing of fbsource which contains few remote bookmarks
Reviewed By: StanislavGlebik
Differential Revision: D7743737
fbshipit-source-id: ba24445762baafbaa5b3295dc8995fe871f97872
Summary: The eden integration test contains a commit with no content which new_blobimport couldn't import. With this changes the commit API is capable of handling such commits.
Reviewed By: jsgf
Differential Revision: D7709243
fbshipit-source-id: 7d55eb2ec421820d189ab05b0f8cb4411f850a7b
Summary:
We know that the hashes for non-root-tree-manifests and filenodes
should always be consistent. Verify that.
Reviewed By: farnz
Differential Revision: D7704087
fbshipit-source-id: 7f6207878c5cd372b272aa6970506dd63b5a3c7c
Summary:
As the comment explains, sometimes the hashes don't match the
contents. Accept such pushes.
Reviewed By: farnz
Differential Revision: D7699930
fbshipit-source-id: 376f01b6cf03f6cad84c2c878d192d55f8d81812
Summary:
We're going to keep this around for now as part of double-writing.
All the hashes here are definitely Mercurial hashes, so use them that way.
Reviewed By: lukaspiatkowski
Differential Revision: D7683890
fbshipit-source-id: 270091cd11f3cec7ef4cf565de5ef913fcf7adea
Summary:
file::File works entirely in the Mercurial domain, so these
conversions are good.
Reviewed By: StanislavGlebik
Differential Revision: D7665973
fbshipit-source-id: 8a192c5d1886492ad21593693b080c8e5ddf8f7e
Summary:
This is because these Mercurial entries are (at least currently) going
to be stored as they come in, and this data structure is entirely in the
Mercurial domain.
Reviewed By: lukaspiatkowski
Differential Revision: D7664972
fbshipit-source-id: 9de5475eed0d7ab7085c29fd0282f205043cfe5a
Summary:
This is the first step to getting bonsai changesets into the blob store.
So far the code just waits for content blob uploads to be done. In future diffs Mononoke will synthesize this information into a bonsai changeset as well.
Reviewed By: lukaspiatkowski
Differential Revision: D7627784
fbshipit-source-id: da0c96772ce4d18aed579cecca6135137a8dbe18
Summary: In the next diff this code is going to start using `ContentBlob` instances. To avoid confusing Mononoke blobs with Mercurial ones, rename these types and add an `Hg` prefix.
Reviewed By: StanislavGlebik
Differential Revision: D7661571
fbshipit-source-id: 4985cc0c7934667966ca60b64bef349af853c2a0
Summary:
This confused me at first -- took me a while to figure out what's going on
here. Hopefully these comments will help the next person who stares at this
code.
Reviewed By: StanislavGlebik
Differential Revision: D7659993
fbshipit-source-id: a009041501f9108d2c01532e9df793cfcecb5496
Summary:
The list of arguments is becoming too long, and I need to add even
more here.
Reviewed By: StanislavGlebik, farnz
Differential Revision: D7652096
fbshipit-source-id: 62a4631e163e95cf5c950a949e72facab629ea54
Summary: Going to add more to this in upcoming diffs.
Reviewed By: StanislavGlebik
Differential Revision: D7652094
fbshipit-source-id: e52e248c64f5a754ad0c3abe54ca38a4a32514d5
Summary:
I'm going to add more stuff to this and I don't want to keep adding
parameters to `upload_changesets`
Reviewed By: StanislavGlebik
Differential Revision: D7648077
fbshipit-source-id: 9b0cbf3efe1bd8d43c0b3c5269c9119f0075428c
Summary:
Now that `BlobNode` no longer returns `None`:
* don't expose the `BlobNode` API outside the crate because it turns out to not be very useful (it should probably go away eventually?)
* make the `File` API not return `Option` types
* Add a new `file_contents` that returns a brand-new `FileContents` (this is the first time we're tying together Mercurial and Mononoke data structures!)
Also remove a `Symlink` API that isn't really correct honestly.
Reviewed By: StanislavGlebik
Differential Revision: D7624729
fbshipit-source-id: 38443093b8bfea91384c959f3425cf355fac9f65
Summary: The Hg prefix is unique now so let's not use verbose mercurial::
Reviewed By: sid0
Differential Revision: D7620112
fbshipit-source-id: 0aece310ed817445fef4c94b32f78fda3a3b1c49
Summary: mercurial_types::DChangesetId should be replaced by types from mononoke_types in most cases and by mercurial::HgChangesetId in others. This rename should help with tracking this
Reviewed By: sid0
Differential Revision: D7618897
fbshipit-source-id: 78904f57376606be99b56662164e0c110e632c64
Summary:
I'm adding a non-`HgBlob` path separately, and using `HgBlob` here is
inconvenient.
Reviewed By: StanislavGlebik
Differential Revision: D7589854
fbshipit-source-id: 21e425e7d70691b982dbd66b1ea4996d1e0eef66