Summary: This prefix makes this file harder because it isn't valid JSON. Per discussion with quark-zju, remove it.
Reviewed By: singhsrb
Differential Revision: D8769139
fbshipit-source-id: f45703c963898202775e90d536dde2894e5029bb
Summary:
It's handy. Mercurial's json serialization is different from the stdlib json
module since it can round-trip binary content. stdlib json cannot be
reliably used when there are content involving paths.
Reviewed By: ryanmce
Differential Revision: D8392078
fbshipit-source-id: 423bd5c68ea317605991a20b30ae870291249d1c
Summary:
For chg's usecase, it'd be nice to learn the actual arguments being
executed. So let's just change `pycompact.sysargv`.
An alternative would be assigning it to `ui.argv`. Given the current
codebase is using `pycompact.sysargv` in multiple places. It seems easier to
just change it.
Reviewed By: ryanmce
Differential Revision: D8392081
fbshipit-source-id: e327e04e556ea00e7b62a68b1c62c834ce927293
Summary:
A recent change made delta base's be Option types, and when we
encounter a None we treat that as the end of a delta chain. In the python
translation layer code we turned this into a Key of ("", nullid) when it
should've been (filename, nullid). This broke a test.
Reviewed By: phillco, quark-zju
Differential Revision: D8768592
fbshipit-source-id: 858a8eadad8699d2e7e99040486f836710381a4f
Summary: This is useful to split dev_command_timer rows based on how many files were rebuilt.
Reviewed By: DurhamG, singhsrb
Differential Revision: D8737307
fbshipit-source-id: 18d52c0fd13184d789daaa8a74f85360554da703
Summary:
This isn't 100% finished and is missing handling some
error cases, but I wanted to put it out there to get some knee-jerk
reactions and suggestions on how to handle some things.
This diff adds a `grep.usebiggrep` config option to `hg grep`. The idea is
that we'll default this to on when the repo requires `eden` (or when we pull in
the eden specific site configuration). When run in big-grep mode, we'll first
ask big grep for the results and then compute the local differences and run
only those through the local grep process, and avoid materializing files
locally.
I'm not 100% sure if the current `repo.status` call will yield the correct
results for the case where the current rev is behind the biggrep
corpus revision.
Reviewed By: quark-zju
Differential Revision: D8416360
fbshipit-source-id: 952badb7a7ec74096b5c77cd79aa25e2327a7659
Summary:
Treedirstate could have `None` _nonnormalset or _otherparentset. Check them
before calling `.clear()`.
Reviewed By: markbt
Differential Revision: D8752216
fbshipit-source-id: 7c72e3a31a405ee2b0464ea08d93b8dd3a187597
Summary: Same fix as the previous diffs in this stack -- the issue is a slow `hg files` path that can be better done with grep.
Reviewed By: quark-zju
Differential Revision: D8753437
fbshipit-source-id: 05655b1d8677c1e9b7c1326f3704f15412152b94
Summary: This goes from 17s to 8.25s on my laptop, and 9.7s to 3.14s on my devserver.
Reviewed By: DurhamG
Differential Revision: D8753229
fbshipit-source-id: ce176dae0a2fb1aa10dd888b6cef223b953bf840
Summary: This cuts the speed on my laptop from 1.3 min (78s) to 8.9s.
Reviewed By: quark-zju
Differential Revision: D8738675
fbshipit-source-id: f6bd0857c949ad96b0eea54d8ddbd9a0427e8895
Summary:
The recent change from delta.base being a Key to an Option<Key> needed
to update pyrevisionstore as well. I'll add this to buck build soon so we can
catch this.
Reviewed By: phillco, quark-zju
Differential Revision: D8752910
fbshipit-source-id: ecf6d2a8a74b72d10b6dc0fb24c7b9346f0f7ed8
Summary: Create a simple rust reader for our loose file format. One of Mercurial’s simplest file formats is the loose file format. fbsource/fbcode/scm/hg/hgext/remotefilelog/remotefilelog.py:_createfileblob() is the python writing implementation.
Reviewed By: DurhamG
Differential Revision: D8731050
fbshipit-source-id: 80eb2abde2a2e5bb672d7e8ffa8ba58ed62184c1
Summary:
Instead of using random nodes, let's use ones based off a seeded
generator.
Reviewed By: quark-zju
Differential Revision: D8741139
fbshipit-source-id: a90e6f092adac6aef35149ee6c4bf2b47c469602
Summary: Implements the get_delta_chain function of the DataStore trait.
Reviewed By: quark-zju
Differential Revision: D8598658
fbshipit-source-id: 708bca63e2da3aae6064ed18076a9a1f1282a756
Summary:
Deltas may not have bases if they are a full text. Let's represent
that as an Option instead of as a magical null id value. This has the nice
effect of moving the decision to serialize a missing delta base down into the
serializer instead of up at the delta chain construction level.
Reviewed By: quark-zju
Differential Revision: D8739231
fbshipit-source-id: b58bd40dae45cb85890812db21e7eeff46aa6b4e
Summary:
The gitignore implementation in core is more complete (support "!" rules)
and efficient (in native Rust). So let's drop the gitignore support in
hggit.
Reviewed By: singhsrb
Differential Revision: D8744807
fbshipit-source-id: faecace0ab0d5a0e015f50473dd1e0c232d013ff
Summary: It seems to work well. Let's turn it on by default.
Reviewed By: singhsrb
Differential Revision: D8744808
fbshipit-source-id: 61a8b8750f53d91ae94d019a88f27697309cfd66
Summary:
Previously only function names are checked. Let's extend the check to
variable names.
Existing names breaking the rule are whitelisted.
Reviewed By: DurhamG
Differential Revision: D8744130
fbshipit-source-id: ca52d938305ccc3b2e1ea59e4e8f9c0dadff5970
Summary:
Currently many users use hg up to move own commits between the repos because unaware about cloud sync.
The hint will be shown on ambiguous prefix only, so it will not distract anyone.
Reviewed By: markbt
Differential Revision: D8732276
fbshipit-source-id: ae8fa10b28873134da013bc56ff9ebc33e9ed303
Summary:
Previous code format attempt (D8173629) didn't cover all files due to `**/*.py`
was not expanded recursively by bash. That makes certain changes larger than
they should be (ex. D8675439). Now use zsh's `**/*.py` to format them.
Also fix Python syntax so black can run on more files, and all lint issues.
Reviewed By: phillco
Differential Revision: D8696912
fbshipit-source-id: 95f07aa0c5eb1b63947b0f77f534957f4ab65364
Summary:
Make `lib` a cargo workspace so building in subprojects would share a
`target` directory and `cargo doc` will build documentation for all
subprojects.
Reviewed By: DurhamG
Differential Revision: D8741175
fbshipit-source-id: 512325bcb23d51e866e764bdc76dddb22c59ef05
Summary:
This speeds up the matcher against several prefixes, helps commands
like `hg files subdir`.
Reviewed By: phillco
Differential Revision: D8721759
fbshipit-source-id: 8b1b35abc5bde7d3265c0874796808a39eb8810f
Summary:
This adds `repo.dirstate._map.keys(prefix=prefix)` API that returns tracked
files for a subdirectory quickly. If `prefix` ends up with `/`, it selects
the subdirectory and all files in it recursively. Otherwise it's an exact
match of a single file.
Reviewed By: phillco
Differential Revision: D8721758
fbshipit-source-id: 200def986e08fd3b9842b6c8012cb7f8350f0822
Summary:
Implements the get_meta function of the DataStore trait. This caught a
bug in how we record lengths as well.
Reviewed By: quark-zju
Differential Revision: D8598661
fbshipit-source-id: 566dca1770d6666e4215fa1fd8f33babdede2f90
Summary:
We want to be able to format error strings, so we can't return a static
str anymore.
Reviewed By: quark-zju
Differential Revision: D8598659
fbshipit-source-id: 44d7a73c06416efca51ca4d0f24a0c8911af8582
Summary:
A mutabledatapack also needs to be readable as a normal store. Let's
start implementing the DataStore trait, starting with get_missing
Reviewed By: quark-zju
Differential Revision: D8598657
fbshipit-source-id: 1f8bc89fae2be73fe789bc0ef1cdd922222019a2
Summary: Implements the last of the DataStore api, getdeltachain.
Reviewed By: quark-zju
Differential Revision: D8557950
fbshipit-source-id: 7f6530fe2064f0d035414b7920a126c6aab41beb
Summary:
In a future diff we'll be returning data read from a pack file out as a
Delta. To avoid copies, we need to be able to return an Rc from DataPack. This
seems like it will be a common pattern, so let's go ahead and make Delta contain
its data as an Rc.
Reviewed By: quark-zju
Differential Revision: D8557949
fbshipit-source-id: 276005360bfa48e9154143dedce579a21129e976
Summary:
Introduces the DataEntry structure which is able to parse data entries
from pack files. Uses it to implement getmetadata
Reviewed By: quark-zju
Differential Revision: D8556610
fbshipit-source-id: c25427c3c247970a879ad7d409b821f3695b97d9
Summary:
This adds the initial struct and opener for a datapack. Future diffs
will add actual functionality and tests.
Reviewed By: quark-zju
Differential Revision: D8553436
fbshipit-source-id: 3b17f995632e859019205f242a4cce389ac77407
Summary:
Actually write the index to disk when the mutabledatapack is
serializing.
Reviewed By: quark-zju
Differential Revision: D8552276
fbshipit-source-id: 354c7fdc3fe84b91d582f0e8cde8c6ae2494c559
Summary: This adds the logic for reading a DataIndex from disk.
Reviewed By: quark-zju
Differential Revision: D8552278
fbshipit-source-id: 611ff09c27716b8d8ff7424c1a27287b9fc42b78
Summary:
Soon we will be writing the index during pack file serialization, so
let's add the logic for serializing the index.
Reviewed By: quark-zju
Differential Revision: D8552277
fbshipit-source-id: 60829631eb060f62d266c16f6016f34080311f8e
Summary: A simple helper method for producing Node's from slices in a safe way.
Reviewed By: quark-zju
Differential Revision: D8547679
fbshipit-source-id: 85ae8fcd7749c662b1459af1d84ccf9695dd5f0b
Summary:
Let's build an inmemory hash table of the revisions that were added. A
future diff will serialize this index into a dataidx file.
Reviewed By: quark-zju
Differential Revision: D8309730
fbshipit-source-id: 9efc7f0f34129a63c52309b4d70179f2c10840b3
Summary:
Implements a fanout table trait that history pack and data pack will
use. It basically consists of logic to build and read a quick lookup table that
uses the first few bytes of a key to determine the bounding range of a binary
search.
Reviewed By: quark-zju
Differential Revision: D8309729
fbshipit-source-id: 71e398277dc8ae041447035f044e5d47ca41cf7e
Summary:
The mutabledatapack format has a one byte header containing the version
number.
Reviewed By: quark-zju
Differential Revision: D8305653
fbshipit-source-id: c4a96dc48e64acd2c5849034e5d90b87363fbc8d
Summary:
Implements the logic that builds a hash of the contents of the pack
file and uses it as the name.
Reviewed By: quark-zju
Differential Revision: D8305654
fbshipit-source-id: d1270e7519a7718aa5427f3be5cdc0cd0dee2fe2
Summary:
This is the start of a rust mutable datapack implementation. The first
diff adds a simple add function. Later diffs will add the logic that builds the
index, serializes the index, and computes the final hash name.
Reviewed By: quark-zju
Differential Revision: D8304036
fbshipit-source-id: db05c2b845e51a3552c039b7fc0b8f4cc0ff0852
Summary:
In a future diff we'll be serializing and deserializing metadata in
datapacks. Let's add the reader and writer functions for Metadata and some unit
tests.
Reviewed By: quark-zju
Differential Revision: D8303603
fbshipit-source-id: 7e7a7aa218c05179b205abf8b151b1488be674b3
Summary:
Hg's `pad()` template function can only fill with a single character. To assert this, Hg checks the length of the fill string. Because the fill string is a Python 2 `str`, Hg rejects UTF-8 `'☃'` (`'\xe2\x98\x83'`) because its length is 3.
Instead of checking the length of the fill string, check the width of the fill string while taking encoding into account. This lets us use ☃ as a pad fill character.
For ASCII fill strings in `pad()`, this diff should not change behaviour.
Reviewed By: phillco
Differential Revision: D8730727
fbshipit-source-id: ad015aa4cae274160bc2726e0cb5e570e6edcc1e
Summary: before the waiting provide all the information to the user
Reviewed By: markbt
Differential Revision: D8734860
fbshipit-source-id: 9c0203b0879091d1d367c2ded9eccd8db4ee1bb9
Summary: `hg debugfs` can report `apfs` correctly on latest mac. So let's add it to whitelist.
Reviewed By: ikostia
Differential Revision: D8725764
fbshipit-source-id: a9eb0db9d1f75cdd64c28b5c2f41451955758e18
Summary:
The output of the rename commit can vary depending on how many files hg needs
to download as part of the rename. This makes this test flaky when run with
watchman in the stress runs.
We don't actually care about the commit output here, so just match anything.
Reviewed By: mitrandir77
Differential Revision: D8731713
fbshipit-source-id: c2eded9115d2348c11fcb79eb425b923d073eddb
Summary: simpkins found a user getting a KeyError with the former.
Reviewed By: simpkins
Differential Revision: D8730525
fbshipit-source-id: 40d80f17e0ab8b2905fc53377e501546c21feaae