Commit Graph

13 Commits

Author SHA1 Message Date
Thomas Orozco
3e955e6d7a mononoke: LFS: emit copy metadata
Summary:
We're currently not emitting any copy metadata in LFS in response to getfiles. As it happens, this appears to fine (clients still get the right metadata), because getreepack includes file copy data and so the client isn't bothered by the fact that the LFS pointers we return don't include it.

That said, it's probably a good idea to clean this up and include copy data. After all, we have it, and we should return to the client whatever they sent us.

Reviewed By: farnz

Differential Revision: D16282793

fbshipit-source-id: 6671f87de2acae2c5da1c754510bbb61de5768d3
2019-07-17 08:13:28 -07:00
Stanislau Hlebik
2ea0f7e6d3 mononoke: remove dead_code
Reviewed By: farnz

Differential Revision: D16263583

fbshipit-source-id: 00a1d1cce271b3bb1e538ca9b3e101ff359dbc3b
2019-07-16 03:47:56 -07:00
Stanislau Hlebik
6282f84a36 mononoke: introduce core unode structs
Summary:
This is the first step in adding unodes into Mononoke.

Unode is a datastructure that allows finding file/directory history easily.
Among other things it will be used by fastlog and blame.

This diff introduces core unode datastructures.

Reviewed By: krallin

Differential Revision: D16262587

fbshipit-source-id: 484800ea8d1ccb82ee9213adc5ba9de68fbaa9b2
2019-07-16 03:47:56 -07:00
David Tolnay
fed2ac83f4 rust: Head start on some upcoming warnings
Summary:
This diff sets two Rust lints to warn in fbcode:

```
[rust]
  warn_lints = bare_trait_objects, ellipsis_inclusive_range_patterns
```

and fixes occurrences of those warnings within common/rust, hg, and mononoke.

Both of these lints are set to warn by default starting with rustc 1.37. Enabling them early avoids writing even more new code that needs to be fixed when we pull in 1.37 in six weeks.

Upstream tracking issue: https://github.com/rust-lang/rust/issues/54910

Reviewed By: Imxset21

Differential Revision: D16200291

fbshipit-source-id: aca11a7a944e9fa95f94e226b52f6f053b97ec74
2019-07-12 00:56:44 -07:00
Greg Cowan
041770b090 Transition fbcode Rust crates to 2018 edition
Summary: Marking all Cargo.tomls in fbcode as 2018 edition.

Reviewed By: jsgf

Differential Revision: D15951175

fbshipit-source-id: edf18449c214ee1ff285d6a2cb61839aaf58a8cd
2019-06-24 13:15:17 -07:00
Pavel Aslanov
7c7e084825 Convert MPathElement to a newtype around Bytes
Summary: We are copying `MPath` a lot, this change should reduce amount of allocations and memory reuse for `MPath`

Reviewed By: farnz

Differential Revision: D15939495

fbshipit-source-id: 8da8f2c38f7b46f27d0df661210c9964aed52101
2019-06-21 15:40:55 -07:00
Johan Schuijt-Li
02a82f4f0b types: speed up hex encode and decode
Summary:
Hex encoding and decoding is in the hot path for gettreepacks, particularly
when we have large fetches (for example with clones), we can easily do this in
the order of tens or hundreds of thousands.

Switch to using a SSE/AVX2 optimized hex encoding/decoding which results in
a 10x performance improvement for decoding. Encoding was already using a
relatively optimized version, so gain is expected to be much lower for encoding.

Reviewed By: farnz

Differential Revision: D15940209

fbshipit-source-id: 28734f45f7508a94b110e25c01e1baa955ebd4e4
2019-06-21 10:48:46 -07:00
Pavel Aslanov
a0a3a421f2 make HgEntryId an enum
Summary: `HgEntryId` is much more useful in a typed from (enum of `(FileType, HgFileNodeId)` and `HgManifestId`), most of the time we now which type entry should contain and it makes it harder to make and error, all other use cases which require just hash should use `HgNodeHash` instead. This diff includes minimal changes which are necessary to make it work. Some of the cases which do sequence of `Entry::get_hash().into_nondehash() -> HgManifestId::new() | HgFileNodeId::new()` are left for future diffs.

Reviewed By: farnz

Differential Revision: D15866081

fbshipit-source-id: 5be9ecc30dbfd0a49ae6c5d084cdfe2dac351dac
2019-06-18 11:11:52 -07:00
Pavel Aslanov
88ac29f2aa add benchmark for get_hg_from_bonsai_changeset
Summary:
This synthetic benchmark/simulation:
- it creates `BlobRepo` which contains delayed implementation for main components, but also includes all caches enabled, since most of our code heavily depends on caching
- it also includes stack generator which can produce stack of changesets
- this particular benchmark exercises bonsai->hg generation path

Reviewed By: StanislavGlebik

Differential Revision: D15166925

fbshipit-source-id: 8ca7fcf1df1400af6c61616218a84eac655c276f
2019-05-21 12:25:51 -07:00
Thomas Orozco
8e4d9e32af mononoke: add support for encoding obsmarkers
Summary: This adds supporting in mononoke for encoding obsmarkers, according to Mercurial's V1 format for obsmarkers.

Reviewed By: StanislavGlebik

Differential Revision: D14932828

fbshipit-source-id: fe7283554c9cdcfdeb303e19b28af60d49c26722
2019-05-21 12:25:16 -07:00
Zeyi (Rice) Fan
6bc1af095d update to Rust 1.34.0
Reviewed By: jsgf

Differential Revision: D14963608

fbshipit-source-id: 550d63cd10c52e8bcbb25137bc29811955da0b20
2019-05-21 12:25:14 -07:00
Pavel Aslanov
a257f82f7c remove some extern crates and #[macro_use]
Summary:
Convert to `2018` version and remove `#[macro_use]` and `extern crate` from following folders:
- blobrepo
- blobstore
- mercurial_types
- mononoke_types

Reviewed By: StanislavGlebik

Differential Revision: D14827294

fbshipit-source-id: 4b8a2edb5d9ad1fe75083e172cd0da359fa6dc2e
2019-05-21 12:25:03 -07:00
Kostia Balytskyi
e561682ecd mononoke: rename crates to contain underscores instead of dashes
Summary: Let's not use dashes in crate names.

Reviewed By: StanislavGlebik

Differential Revision: D14341596

fbshipit-source-id: 85a7ded60cf2e326997ac70ee47a29116af97590
2019-03-06 07:18:28 -08:00