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
Summary:
The fastpath for adjusting linknodes using the fact that a filenode ctx was
created from a descendant rev can sometimes cause lots of treefetches. Add an
option to disable it.
Reviewed By: mitrandir77
Differential Revision: D8691202
fbshipit-source-id: f196565929a2cf9b850c1c7c35f3ba6fa90f9031
Summary:
When amending a commit containing a file rename for a file with a long history
where the original content was usually on a separate branch, we end up in
`remotefilelogctx._adjustlinknode` for every commit the file was modified in.
Each of these looks up the manifest for the file, which causes a tree fetch.
Reviewed By: quark-zju
Differential Revision: D8691179
fbshipit-source-id: 088a6b402a79d37790ce7ac4481a39c657f690ee
Summary:
This cuts the total time for this test from:
Laptop: 24s -> 12.4s
Devserver: 23s -> 5.8s
Reviewed By: quark-zju
Differential Revision: D8721177
fbshipit-source-id: f2922093a72c29f05d08967a77d83fbc65c0ed14
Summary:
Fix an issue where pathaudit failed (see [1] for what pathaudit does) files
showing up in "hg status" with fsmonitor enabled.
This is a problem with all dirstate implementation. Treestate makes it
easier exposed, as it merges "notefiles" with "nonnormalset", instead of
replacing an exisiting "notefiles" set.
[1]: https://www.mercurial-scm.org/repo/hg/rev/2cbd27f4f3c4
Reviewed By: DurhamG
Differential Revision: D8721020
fbshipit-source-id: 7c6c8c2f202c0da4c3eeee3c9b1ce10bf7970dd8
Summary:
Files with one of its directory being a symlink should be considered as
outside the repo. The test demonstrates that with fsmonitor, all dirstate
implementations have problems showing auditfail [1] files.
[1]: https://www.mercurial-scm.org/repo/hg/rev/2cbd27f4f3c4
Reviewed By: DurhamG
Differential Revision: D8721021
fbshipit-source-id: fcb9808b637993c4d0c173d771fd7220afb52d83
Summary:
Print the output from check-code.py in a way amenable to sorting (mostly, print each offense on one line instead of several)
The next diff will explain why.
Reviewed By: quark-zju
Differential Revision: D8721178
fbshipit-source-id: d814f94c151c6251f827ed6fe099e170e0b5353a
Summary:
This takes about 4.5s on my laptop. By moving it to its own file, we can run it in parallel and save from the total check-code time.
Laptop: 31.74s -> 25.53s
Devserver: 24.5s -> 22.21s
Reviewed By: quark-zju
Differential Revision: D8721156
fbshipit-source-id: 6d4d2c86517239f1762a413bc5d3dfefe184eaca
Summary:
This is a more minimal fix compared to D8676355, to handle extra calls to `markcopied` from `copies.duplicatecopies`.
Let's just make overlayworkingcontext properly support receiving copy information on (non-deleted) files, which it should do anyway.
This leaves the incorrect non-IMM behavior, but since it just involves incorrectly creating an empty commit, that's probably fine.
Reviewed By: quark-zju
Differential Revision: D8697039
fbshipit-source-id: 0c204c47e6b5031eb20928c1844be3aebcb96edb
Summary:
When watchman returns is_fresh_instance=True, it means the old clock value
cannot help watchman to do less work. Therefore the clock value needs to be
updated to make the next status call faster.
Reviewed By: phillco
Differential Revision: D8714863
fbshipit-source-id: 1eb2bf876b21bd0f17134a3b93b06b759746fd4c
Summary:
This test is 990+ lines and takes 1+ minutes to run on my laptop.
- Use `newrepo` instead of a custom reset function
- Use `enable` and `setconfig`
- Split out the auto-restack part into its own function
Reviewed By: quark-zju
Differential Revision: D8706316
fbshipit-source-id: fb48208e3225b376a0e4d06021ef82e8c4255d08
Summary:
I was thinking about what we need to enable automatic restacking on non-conflicting amends (see the next diff), but I realized the --tool :abort tool I implemented in D8493065 doesn't really work well for this for three reasons:
- It can't handle the case of mergedriver having to run, which is the other reason we'd have to break out of IMM.
- It hard-codes the merge tool. The user might want to specify another tool that doesn't recreate conflicts or solves them differently.
- It'd force callers to detect if IMM will be used (to prevent an on-disk merge hapening by mistake). A flag can implement this much more easily.
- As I learned when writing D8493065, it would require hardcoded logic in every command anyway to support the non-IMM case. (Just raising an abort will leave most commands with an interrupted state.)
So, I think we should replace it with this flag to make auto-restacking work very reliably (we could add it to graft, too). If there was some big demand for --tool :abort we could always add it back in the future.
Reviewed By: quark-zju
Differential Revision: D8701897
fbshipit-source-id: ea3b92d0a224a8ce43edb120b53bec241d92a61d
Summary: This will let us print more helpful/precise error messages.
Reviewed By: singhsrb
Differential Revision: D8699551
fbshipit-source-id: 060058eff925d94ffa8e6b4432c4e51bd93b2945
Summary: This config was needed when IMM restarts were long and painful, but now that they're not, this clunky and inaccurate hueristic can be removed, which simplifies the control flow a bit.
Reviewed By: singhsrb
Differential Revision: D8700868
fbshipit-source-id: 0aeac26e5c41f7f0260ee826f05a8f9047dbad5a
Summary: This configuration is set everywhere, and the spectre of stateful preprocess() functions was a Facebook-only abomination that hopefully won't reoccur. Delete this config.
Reviewed By: quark-zju
Differential Revision: D8700125
fbshipit-source-id: b5ef163f988b7bb79310275d54afea3eab2c23a2