Commit Graph

10 Commits

Author SHA1 Message Date
Andres Suarez
cf36295fa4 Yearless license header
Summary:
This diff updates all license headers to use the new text and style.
Also, a few internal files were missing the header, but now they have it.
`fbcode/common/rust/netstring/` had the internal header, but now it has
GPLV2PLUS - since that goes to Mononoke's Github too.

Differential Revision: D17881539

fbshipit-source-id: b70d2ee41d2019fc7c2fe458627f0f7c01978186
2019-10-11 13:52:34 -07:00
Pavel Aslanov
1bb01bb7a1 move mercurial related creates to mercurial subdirectory
Summary:
Start moving mercurial related stuff to `mercurial` directory:
- rename `mercurial` to `mercurial_revlog` and moved to `/mercurial/revlog`
- move `mercurial_types` to `/mercurial/types`
- move `mercurial_bundles` to `/mercurial/bundels`

Reviewed By: farnz

Differential Revision: D16783728

fbshipit-source-id: 79cf1757bb7cc84a6273a4a3c486242b1ef4cd00
2019-08-14 04:03:00 -07:00
Jeremy Fitzhardinge
820395cb2a Convert scm/mononoke to Rust 2018
Summary:
Rust 2018 updates to:
  //scm/mononoke:admin-rust-build-info-lib
  //scm/mononoke:aliasverify
  //scm/mononoke:aliasverify-rust-build-info-lib
  //scm/mononoke:aliasverify-unittest
  //scm/mononoke:blobimport
  //scm/mononoke:blobimport-rust-build-info-lib
  //scm/mononoke:blobimport-unittest
  //scm/mononoke:blobstore_healer-rust-build-info-lib
  //scm/mononoke:bonsai_verify
  //scm/mononoke:bonsai_verify-rust-build-info-lib
  //scm/mononoke:configlint-rust-build-info-lib
  //scm/mononoke:dumprev
  //scm/mononoke:dumprev-rust-build-info-lib
  //scm/mononoke:idxdump
  //scm/mononoke:idxdump-rust-build-info-lib
  //scm/mononoke:mononoke-rust-build-info-lib
  //scm/mononoke:populate_healer-rust-build-info-lib
  //scm/mononoke:revlogrepo
  //scm/mononoke:revlogrepo-rust-build-info-lib
  //scm/mononoke:revlogrepo-unittest

Reviewed By: fanzeyi

Differential Revision: D15465530

fbshipit-source-id: 616db5cc0a8584ccb05f4c3c446b1b3ffd343695
2019-05-23 11:14:19 -07:00
Lukas Piatkowski
515a2909eb monononoke hashes: remove usages of borrows of hashes which are Copy
Summary: The Copy trait means that something is so cheap to copy that you don't even need to explicitly do `.clone()` on it. As it doesn't make much sense to pass &i64 it also doesn't make much sense to pass &<Something that is Copy>, so I have removed all the occurences of passing one of ouf hashes that are Copy.

Reviewed By: fanzeyi

Differential Revision: D13974622

fbshipit-source-id: 89efc1c1e29269cc2e77dcb124964265c344f519
2019-02-06 15:11:35 -08:00
Zeyi Fan
c1b1005d91 clean up HgBlob and HgBlobHash
Summary: This commits change `HgBlob` from an enum into a struct that only contains one Bytes field, completely removes `HgBlobHash` and changes the methods of `HgBlob` from returning `Option`s into directly returning results.

Reviewed By: farnz

Differential Revision: D9317851

fbshipit-source-id: 48030a621874d628602b1c5d3327e635d721facf
2018-08-19 15:52:34 -07:00
Jeremy Fitzhardinge
23fdf4b4f7 tp2: rust-1.28.0 update
Summary: update to Rust release 1.28

Reviewed By: farnz

Differential Revision: D9150356

fbshipit-source-id: 3dd237cfadc9ca1e9b0586d628a0ce4718df505b
2018-08-03 13:50:53 -07:00
Lukas Piatkowski
a4cd4005df mercurial: refactor RevlogRepo to expose less methods publicly
Summary:
RevlogRepo exposes a ton of methods that are almost equvalent to taking Revlog directly and ignoring the RevloRepo abstraction above it.
This diff cleans this up a bit, there are still some methods that the "old" blobimport uses, but the "new" one shouldn't need to do that.

Reviewed By: StanislavGlebik

Differential Revision: D7289445

fbshipit-source-id: ac7130fe41c4e4484d6986fe5b19d5adc751369a
2018-03-20 11:53:09 -07:00
Jeremy Fitzhardinge
ac31713c84 rust: failure cleanup pass
Summary:
Don't use failure's bail!() and ensure!() macros.

Instead, failure_ext provides:
- bail_err!(err) - Converts its single parameter to the expected error and returns; ie `return Err(From::from(err));`
- bail_msg!(fmt, ...) - takes format string parameters and returns a `failure::err_msg()` error
- ensure_err!(), ensure_msg!() - corresponding changes

Also:
- remove all stray references to error-chain
- remove direct references to failure_derive (it's reexported via failure and failure_ext)
- replace uses of `Err(foo)?;` with `bail_err!()` (since `bail_err` unconditionally returns, but `Err(x)?` does not in principle, which can affect type inference)

Reviewed By: kulshrax

Differential Revision: D6507717

fbshipit-source-id: 635fb6f8c96d185b195dff171ea9c8db9e83af10
2017-12-07 14:10:17 -08:00
Jeremy Fitzhardinge
dc5e78c1c1 rust: mass convert scm/mononoke/... to use failure
Summary:
Convert scm/mononoke to use failure, and update common/rust crates it depends on as well.

What it looks like is a lot of deleted code...

General strategy:
- common/rust/failure_ext adds some things that are in git failure that aren't yet in crates.io (`bail!` and `ensure!`, `Result<T, Error>`)
- everything returns `Result<T, failure::Error>`
- crates with real error get an error type, with a derived Fail implementation
  - replicate error-chain by defining an `enum ErrorKind` where the fields match the declared errors in the error! macro
- crates with dummy error-chain (no local errors) lose it
- `.chain_err()` -> `.context()` or `.with_context()`

So far the only place I've needed to extract an error is in a unit test.
Having a single unified error type has simplified a lot of things, and removed a lot of error type parameters, error conversion, etc, etc.

Reviewed By: sid0

Differential Revision: D6446584

fbshipit-source-id: 744640ca2997d4a85513c4519017f2e2e78a73f5
2017-12-05 18:11:13 -08:00
facebook-github-bot
2b6af6b941 Initial commit
fbshipit-source-id: f75baa4ff6aa71973f677b752d7aba582cf4927f
2017-07-27 18:00:19 -07:00