Summary: Bail out if any untracked files' content differs from that of target revision.
Reviewed By: sggutier
Differential Revision: D49375569
fbshipit-source-id: 07e654b27a56399773d5f9b866f415e3ed1f1242
Summary:
This lets check_unknown_files check unknown files in O(unknown) instead of O(checkout).
I also got rid of the "new_file" flag since it didn't seem useful.
Reviewed By: sggutier
Differential Revision: D49375568
fbshipit-source-id: 3de90cdf0d5db73121c076f16ce2f3752550fa95
Summary:
We originally tried to pass in a FilteredObjectId into the underlying BackingStore's getBlob() function. This obviously won't work. This diff parses out the underlying ObjectID and passes that to the underlying BackingStore instead.
In addition, one might think that importManifestForRootId would need the same parsing logic for the Manifest parameter. However, any manifest we receive from Eden will not be "filtered", so we don't need to parse out the underlying Manifest and can simply pass that straight through. We do however have to parse the RootID we receive.
Reviewed By: genevievehelsel
Differential Revision: D49171303
fbshipit-source-id: 7c8e8de2c3fe1ed040bc171b5e79624dbd1a49b8
Summary: The RootId comes before the FilterId (i.e. <RootId><FilterId>) in the non-parsed representation, so it makes sense to return the RootId first.
Reviewed By: jdelliot
Differential Revision: D49171302
fbshipit-source-id: 0e1afe6edb18cca26826b68688be7680593f39ae
Summary: We sometimes want to know what type of BackingStore type a checkout is currently using. We should use the existing BackingStoreType to query/report what BackingStore is in use. This will be used in a later diff to query whether a FilteredBackingStore is being used by a mount.
Reviewed By: kmancini
Differential Revision: D49171301
fbshipit-source-id: 63dff567532b92cd7d634a818fb300dc026c753e
Summary: This will allow us to use BackingStoreType in CheckoutConfig
Reviewed By: jdelliot
Differential Revision: D49171300
fbshipit-source-id: e8f4a3d6f34ebc1d02db6f69c4a2913dcaa85bfa
Summary:
After significant discussion, it was decided that the ID of the active filter would be passed into Eden via thrift parameters. Every thrift call that requires a commit to be specified will also take an optional filterID parameter.
If Mercurial knows a filter should be applied to the repo (i.e. FilteredFS is in use), it will pass in the optional FilterID parameter in the form of `{path_to_filter}:{commit_hash}` where commit_hash corresponds to the last commit that modified the filter.
Eden will parse that parameter and create a RootId in the form `{len_of_commit_hash}{binary_commit_hash}:{path_to_filter}:{hex_commit_hash}` where `len_of_commit_hash` is a varint that indicates how many bytes long the `binary_commit_hash` is. The FilteredBackingStore can then use this information to parse out the `binary_commit_hash` and FilterID from the original RootID.
With this info, the FilteredBackingStore can fetch the root tree from the underlying BackingStore, filter the tree using the FilterID, and create a filtered RootTree result that serves as the basis for filtering the repository.
Reviewed By: muirdm
Differential Revision: D49041136
fbshipit-source-id: c690d21d8b5024066e5deec1c1e432de3d1a06b5
Summary:
anyhow-1.0.73 [uses][1] the new `Error::provide` API. This API is
available starting in Rust 1.73. This means that if you want backtraces,
you need one:
- anyhow-1.0.72 & Rust 1.72
- anyhow-1.0.73 & Rust 1.73
Since we're still on 1.72, pin the version to avoid accidentally losing
backtraces.
There are no real changes between anyhow-1.0.71 and anyhow-1.0.72. But
update to anyhow-1.0.72 so that we're right up until the point where we
get backtrace support.
[1]: https://github.com/dtolnay/anyhow/pull/319
Reviewed By: shayne-fletcher
Differential Revision: D49970958
fbshipit-source-id: 1193611e6d16bc840e63b689e932ea3d33562152
Summary:
Current behavior:
```
$ sl pr -h
sl pr <submit|get|link|unlink|...>
[...]
```
The issue is there is no `get` command in in Github pr
Pull Request resolved: https://github.com/facebook/sapling/pull/737
Reviewed By: evangrayk
Differential Revision: D49970313
Pulled By: genevievehelsel
fbshipit-source-id: 63fb50675ef2cd0e4200db0aacce1873ec637ac1
Summary:
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.25 to 8.4.31.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/postcss/postcss/releases">postcss's releases</a>.</em></p>
<blockquote>
<h2>8.4.31</h2>
<ul>
<li>Fixed <code>\r</code> parsing to fix CVE-2023-44270.</li>
</ul>
<h2>8.4.30</h2>
<ul>
<li>Improved source map performance (by <a href="https://github.com/romainmenke"><code>@romainmenke</code></a>).</li>
</ul>
<h2>8.4.29</h2>
<ul>
<li>Fixed <code>Node#source.offset</code> (by <a href="https://github.com/idoros"><code>@idoros</code></a>).</li>
<li>Fixed docs (by <a href="https://github.com/coliff"><code>@coliff</code></a>).</li>
</ul>
<h2>8.4.28</h2>
<ul>
<li>Fixed <code>Root.source.end</code> for better source map (by <a href="https://github.com/romainmenke"><code>@romainmenke</code></a>).</li>
<li>Fixed <code>Result.root</code> types when <code>process()</code> has no parser.</li>
</ul>
<h2>8.4.27</h2>
<ul>
<li>Fixed <code>Container</code> clone methods types.</li>
</ul>
<h2>8.4.26</h2>
<ul>
<li>Fixed clone methods types.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/postcss/postcss/blob/main/CHANGELOG.md">postcss's changelog</a>.</em></p>
<blockquote>
<h2>8.4.31</h2>
<ul>
<li>Fixed <code>\r</code> parsing to fix CVE-2023-44270.</li>
</ul>
<h2>8.4.30</h2>
<ul>
<li>Improved source map performance (by Romain Menke).</li>
</ul>
<h2>8.4.29</h2>
<ul>
<li>Fixed <code>Node#source.offset</code> (by Ido Rosenthal).</li>
<li>Fixed docs (by Christian Oliff).</li>
</ul>
<h2>8.4.28</h2>
<ul>
<li>Fixed <code>Root.source.end</code> for better source map (by Romain Menke).</li>
<li>Fixed <code>Result.root</code> types when <code>process()</code> has no parser.</li>
</ul>
<h2>8.4.27</h2>
<ul>
<li>Fixed <code>Container</code> clone methods types.</li>
</ul>
<h2>8.4.26</h2>
<ul>
<li>Fixed clone methods types.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="90208de880"><code>90208de</code></a> Release 8.4.31 version</li>
<li><a href="58cc860b4c"><code>58cc860</code></a> Fix carrier return parsing</li>
<li><a href="4fff8e4cdc"><code>4fff8e4</code></a> Improve pnpm test output</li>
<li><a href="cd43ed1232"><code>cd43ed1</code></a> Update dependencies</li>
<li><a href="caa916bdcb"><code>caa916b</code></a> Update dependencies</li>
<li><a href="8972f76923"><code>8972f76</code></a> Typo</li>
<li><a href="11a5286f78"><code>11a5286</code></a> Typo</li>
<li><a href="45c5501777"><code>45c5501</code></a> Release 8.4.30 version</li>
<li><a href="bc3c341f58"><code>bc3c341</code></a> Update linter</li>
<li><a href="b2be58a2eb"><code>b2be58a</code></a> Merge pull request <a href="https://redirect.github.com/postcss/postcss/issues/1881">#1881</a> from romainmenke/improve-sourcemap-performance--phil...</li>
<li>Additional commits viewable in <a href="https://github.com/postcss/postcss/compare/8.4.25...8.4.31">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=postcss&package-manager=npm_and_yarn&previous-version=8.4.25&new-version=8.4.31)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/facebook/sapling/network/alerts).
</details>
Pull Request resolved: https://github.com/facebook/sapling/pull/744
Reviewed By: evangrayk
Differential Revision: D49969789
Pulled By: genevievehelsel
fbshipit-source-id: 6096a4e0825cb6be7ba35eee04b71ba5c041fe53
Summary:
This is a stack to refactor GlobNode out of inode directory as much as possible.
I'm working on fine grained watchman subscription and i need to use GlobNode for globbing, which will have fs files depend on inode files. According to Katie, we want inode to be the top level.
Since the api im using won't require inode, the plan is to move the part that doesn't require inode into utils and have the inode glob search remain in inode
To split inode and tree implementation in this file, we need to make `evaluateImpl` and `evaluateRecursiveComponentImpl` stop referring to inodes, which is very hard without rewriting the methods because both methods do double recursion inside.
This code is hacky as it reuses runtime error for lines that we know will never reach during compile time. But I think this file is already using this hacky way multiple times https://www.internalfb.com/code/fbsource/[6cf48e74661705c6aefc18ebaecd7e229d71cb99]/fbcode/eden/fs/inodes/GlobNode.cpp?lines=122
I think with modern c++ we can probably get away this exception with constraints. But I'm not confident to do big refactor on this file for now
Reviewed By: kmancini
Differential Revision: D49900357
fbshipit-source-id: a769137238da78aba1da2720f9f1fc07f7e3ad6e
Summary: This test used "!glob:..." to effect an exclude rule. However, I don't think this was intended. It happened to work because, internally, the sparse extensions prepends "!" to represent negative rules.
Reviewed By: quark-zju
Differential Revision: D49928290
fbshipit-source-id: 72af609b25ebfdc62cb7df408aa1811e885f6a13
Summary:
Add bindings the Python sparse extension can use to create treematchers representing the sparse profile.
We return a list of treematchers and rule details instead of a single matcher because the sparse "explain" functionality only exists at the Python matcher level, so passing a single Rust matcher would lose that information.
Reviewed By: quark-zju
Differential Revision: D49928284
fbshipit-source-id: 828c931f4d6c1f17a43a506bee0e7b2227817900
Summary:
Previously the rule origin contained only the breadcrumb of the sparse profile trail leading to the rule. Now the origin also contains the leaf rule itself.
This makes it easier to support the debugsparseexplainmatch output when using the Rust sparse library (later in stack).
Reviewed By: quark-zju
Differential Revision: D49928286
fbshipit-source-id: 91956990315598a1ad2079e91e78eadcb3e568d3
Summary:
For compatibility w/ the Python "sparse" extension debugging commands, add the ability to override the top level profile versions and to skip the "catch all" include rule when there are otherwise no include rules.
I got rid of the "always" special case since that was an extra place I would need the catch-all check. The "always" stuff was an optimization for an empty sparse profile (read: not very important).
Reviewed By: quark-zju
Differential Revision: D49928295
fbshipit-source-id: e34c4d5b87f23439b7f4a0df9cd028edc9a306b6
Summary: This was always set to True except in the empty-profile case, where it didn't make any difference.
Reviewed By: quark-zju
Differential Revision: D49928292
fbshipit-source-id: 46e4d3ca86b409e3b034f5734f4148bf767386f7
Summary:
Move "tempsparse" logic up out of build_matcher. This lets build_matcher return the sparse::Matcher instead of the more opaque UnionMatcher/DynMatcher.
I'm going to use this to replace corresponding Python logic.
Reviewed By: quark-zju
Differential Revision: D49928294
fbshipit-source-id: 696f01e94d87319994da69c4abba5b3e7f2f2d60
Summary:
Globset implements case insensitive matching by turning all the patterns into one giant regex. The regex is slower to evaluate, and easily hits globset's internal 10MB regex size limit (e.g. 1000 patterns can end up creating a regex that exceeds the 10MB limit). Avoid using globset's case insensitivty, instead lowercasing the patterns and paths before giving to globset to achieve insensitivity.
Since we are dealing with only globs and not regexes, I think this is sound.
Reviewed By: quark-zju
Differential Revision: D49928289
fbshipit-source-id: cdc28343b6743505f81eb0ad433f759d671bb163
Summary:
As part of the project to remove HgImporter adding some basic telemetry for failures returned from HgImporters. This will pair up with the remaining errors returned from EdenApiMiss (which is more accurately described as backing store miss).
This should not overwhelm any collectors as it comes after we have removed the highest contributor of edenapi_miss events. That said, once landed we can contrain the data retention of this event (1 day/50GB).
Reviewed By: xavierd
Differential Revision: D49935347
fbshipit-source-id: 92d815d802d083181a9cbc74e9df025b611e1d4c
Summary:
When `HgQueuedBackingStore::prefetchBlobs` invokes `HgProxyHash::getBatch` it expects the results to be returned in the same order at the request. See https://fburl.com/code/bhca8zn9. However, the code, as written today, can re-order the results if there are any hashes loaded from the LocalStore.
It is assumed there are still, in existence, some clones that have these older proxy hashes stored in LocalStore. For those clones, if the user were to prefetch blob data, the results would be incorrect.
This change ensure that the ordering of the results is the same as the requests. In the domminante use case - where all all OjbectsIds are found to be embedded proxy hashes there will be a small slowdown in transforming the results from variants to HgProxyHashes. This is not expected to be a significant cost. In the case where there are mixed results or only hashes stored in LocalStore, there is a similar overhead, but this should be even less impactful.
Reviewed By: xavierd
Differential Revision: D49923147
fbshipit-source-id: 489c74945cd2ad33e84cf62e92f8e005aed6a05c
Summary:
D47875338 added url_to_dir tracing message in other two branches, this
diff add that message for the last branch as well, so we will know if
url_to_dir() is succeeded or not.
Reviewed By: muirdm
Differential Revision: D49954204
fbshipit-source-id: 0a6c7ec55712748f301b1856daa16e649c962af7
Summary:
we will need to implement them in order to use eagerepo for testing
eden api upload logic. This diff just add them to eagerepo, we will implement
them in the following diffs.
Reviewed By: muirdm
Differential Revision: D49954205
fbshipit-source-id: 204de0177f94c897c514ec7b34862d6700e4ccc7
Summary: As part of `PackfileItem`, we support only two variants, `Base` where the direct Git object is used and `OidDelta` where the delta is expressed w.r.t a base object specified through its Object Id. Depending upon the type of pack/bundle being generated, we might want to have deltas only in the form of offset (i.e. deltas where the base object is present at an offset from the current object in the same packfile). This diff adds support for converting `OidDelta` into `OffsetDelta` directly when writing to the pack so that the input can continue to be either `Base` or `OidDelta`. This is necessary since the input is generated through `GitDeltaManifest` and its not feasible to generate `OffsetDelta` at that stage without sequentializing the entire processing thereby slowing it down considerably.
Reviewed By: markbt
Differential Revision: D49863590
fbshipit-source-id: 8501d3b22c77bbba2c840bd96066ca6098a562bd
Summary: This diff contains utility methods and changes that will be used later when constructing Git bundle from Git Delta Manifest.
Reviewed By: markbt
Differential Revision: D49863343
fbshipit-source-id: 459022fad845dd27cf1f2b00f12fa68ce5df434c
Summary: We are using the upperbound of `<[u8]>::split`'s iterator as the value for `with_capacity`, however this is incredibly pessimistic, and as a result we overallocate. Let's just make an initial pass and count the actual number.
Reviewed By: RajivTS
Differential Revision: D49951367
fbshipit-source-id: c3ce6fa0d4125f2cac26c9ea017a0992f9291397
Summary:
merge.update() had a lot of complicated arg checking to differentiate simple working copy updates from tricker three way merges. In particular, the eden and nativeupdate code paths only support the simple update case.
To make things clearer, let's separate update() into goto() and merge(). goto() handles the simple case, and moving it to Rust will be the (achievable) goal of some upcoming work. merge() handles the full enchilada, and isn't ripe for Rustification at this point.
Reviewed By: zzl0
Differential Revision: D49058005
fbshipit-source-id: f8106c04c48bfba0e7fad244e1dd9933142674e1
Summary: I couldn't find any references to the eden.prefetchsparseprofiles and clone.nohttp config settings.
Reviewed By: sggutier
Differential Revision: D49058002
fbshipit-source-id: 833cff3b3da0531ca18cabb3ade8289bf13dfaca
Summary:
Been deprecated for a while in favor of "commands.update.check".
There is a terrible subtlety here: "commands" config settings are automatically filtered out when HGPLAIN=1. "experimental" settings are not. So, experimental.updatecheck=noconflict was active with HGPLAIN=1, but commands.update.check=noconflict is not active with HGPLAIN=1. This would be a change in behavior, though, so I set the configitems.py default value to "noconflict" which will take effect with HGPLAIN=1.
Still, there is a change in behavior in that locally configured commands.update.check behavior will no longer take effect with HGPLAIN=1. It doesn't look to be configured anywhere outside hg, so I think we are okay.
We are planning to simplify and improve the update check with upcoming Rust work, so this config knob should go away, hopefully.
Reviewed By: sggutier
Differential Revision: D49058007
fbshipit-source-id: af2d01bf7bc6fac0bbbd913b745ce5da8353f13d
Summary: implement task local ClientRequestInfo and pass thread local into task local for EdenApi
Reviewed By: quark-zju
Differential Revision: D49912043
fbshipit-source-id: 1327aecd2162a441737a0602c42899980f3c2e23
Summary: This diff updates the `DeltaInstructions` storage logic to use `flate2` Zlib encoding instead of the `async-compression` ZLib encoding to maintain consistency with how Git objects are encoded and decoded when creating packs and bundles. It also adds a unit test to validate that the round trip from storage to bytes works as expected for `DeltaInstructions`
Reviewed By: markbt
Differential Revision: D49814036
fbshipit-source-id: 2c934f392a6be47a2d419a8ff84dbf1645dc6fae
Summary: Hopefully this can further reduce confusion.
Reviewed By: muirdm
Differential Revision: D49922798
fbshipit-source-id: 6da9f05eb9f3327976640bc67be6fed724611bd3
Summary:
Make `version` show "Sapling" even when running under hg identity.
This might reduce confusion internally.
Reviewed By: muirdm
Differential Revision: D49922799
fbshipit-source-id: 41cf17b461547ac4b2e16364667486216adeec27
Summary:
We met a copytrace failure, which was caused below two combined factors:
1. lib.rs is common name
2. commit 843db9ece03c is a big commit that changed many "lib.rs" files.
Let's increase the DEFAULT_MAX_RENAME_CANDIDATES, so we will check more
candidates files in this case.
Reviewed By: muirdm
Differential Revision: D49894288
fbshipit-source-id: 442f6901d8a4b7c3edfb9ccb59b7f5ef295d4885
Summary: Update the `lru` version we use to `0.11.1`.
Reviewed By: zertosh
Differential Revision: D49889174
fbshipit-source-id: 4b8103b9f6a4a066eded1667983bc45bd9991192
Summary:
See the previous change for context. This diff updates the rest of the internal
functions, modules to use the internalconfig name.
Reviewed By: muirdm
Differential Revision: D49881848
fbshipit-source-id: 439fc82f7c9345a79d7c6d32d0d0610556901505