Commit Graph

87955 Commits

Author SHA1 Message Date
Richard Barnes
0a06f101a5 Fix deprecated use of 0/NULL in common/time/TimeZoneWithoutScuba.cpp + 3
Summary:
`nullptr` is typesafe. `0` and `NULL` are not. In the future, only `nullptr` will be allowed.

This diff helps us embrace the future _now_ in service of enabling `-Wzero-as-null-pointer-constant`.

Reviewed By: meyering

Differential Revision: D54163067

fbshipit-source-id: 3473ba42193c8dd3cd61b8f170d20c7279f88521
2024-02-25 22:18:39 -08:00
Open Source Bot
ab37096c17 Updating submodules
Summary:
GitHub commits:

0d46256eba
3c42c03718
708dd9f420
82230956da
697c3ab0c4
ec40fccc07
55cc0f1b88
6de9c814de
0fb315837c
d02e7ac78f
9d69010fd7
2bba5ccd87

Reviewed By: jailby

fbshipit-source-id: 2d40d325c51ffb8274d17108a3c836f4aa4f06ae
2024-02-25 09:32:01 -08:00
Open Source Bot
4a37bcbd53 Updating submodules
Summary:
GitHub commits:

1b3a4867a3
fe588ff738
a1ca956542
ff3463a6b4
55cda7aebd
1596979507
b88e4f4706
d70f9fa509
7d3517529d
a0d6569d28
1657484135
10f6050d41
25d38a4806

Reviewed By: jailby

fbshipit-source-id: 4f0cff0fbe0c74496408890c1a8ceb0c43b2ec6d
2024-02-24 09:34:25 -08:00
Open Source Bot
2fe60ca9f8 Updating submodules
Summary:
GitHub commits:

34a1659930
fa438c98f8
f2d9ebb68b
7352c9ffa6
ec680d2693
332029fe81
23892d22d3
05c2df2e86
707aa9b1cd
9f939745c6
2940acac00
dd4425b49d
05e6c908d1
11c0b6b8c2
9deb5e9439
a1a39764cd
b2bb68ba7d
3e4a26a05a
dc209666f0

Reviewed By: jailby

fbshipit-source-id: a189d0888ca0739de17c4fd236ae515ebab7866d
2024-02-23 21:44:42 -08:00
Genevieve (Genna) Helsel
7b9f34f60f add RefPtrBenchmark.cpp to TARGETS
Reviewed By: jdelliot

Differential Revision: D54130725

fbshipit-source-id: 31802f03471ad960a5e0942997c75da2ebaa4363
2024-02-23 16:39:52 -08:00
Genevieve (Genna) Helsel
30fea9c71c add ThriftUtil.cpp to TARGETS
Reviewed By: jdelliot

Differential Revision: D54130388

fbshipit-source-id: a34e5d17de0629c95ebf7656b0dde6c125c178a1
2024-02-23 16:39:52 -08:00
Zhaolong Zhu
77639420da streampager: expose the detailed pest parser error to users
Reviewed By: markbt

Differential Revision: D53169697

fbshipit-source-id: 6d022077f61dc74cc17e81518bdddf1371f1785c
2024-02-23 15:47:18 -08:00
John Elliott
713c9f4df7 Refactor LogEvent - extract DynamicEvent
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.

This change extracts DynamicEvent from LogEvent so that it can be moved to edencommon in a later diff.

Reviewed By: kmancini

Differential Revision: D54046152

fbshipit-source-id: b50bae2b155f8640a8b319f9b0353e7f44110100
2024-02-23 15:46:42 -08:00
John Elliott
c07bebc856 Move Throw.h from eden to edencommon
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.

This change moves Throw.h and it's related tests from eden to edencommon.

Reviewed By: genevievehelsel

Differential Revision: D54046153

fbshipit-source-id: 669d702c13e70536d9c0b58ff8ff17f826237851
2024-02-23 15:46:42 -08:00
Alex Coleman
7f923750b3 Don't include commit title in PR body (#822)
Summary:
Don't include commit title in PR body

Seems redundant to include the commit title in both the PR body and title, so this strips out the title.

Had some trouble building to test this out (ran into `error[E0658]: use of unstable library feature 'stdsimd'`)

Pull Request resolved: https://github.com/facebook/sapling/pull/822

Reviewed By: zzl0

Differential Revision: D52938280

Pulled By: quark-zju

fbshipit-source-id: ffe70aa9c35125f09de5d2e0e63243af96e61236
2024-02-23 15:28:10 -08:00
gclandres@gmail.com
ea26d89297 Added responsive styles (#703)
Summary:
[ReviewStack.dev Home Page] Added responsive styles

* Added responsive width in footer
* Added flex column on mobile devices for the gif image.

Before:
![image](https://github.com/facebook/sapling/assets/35460167/4c641330-172f-4514-ac6e-78cd56678409)

After:
![image](https://github.com/facebook/sapling/assets/35460167/c85b6a7c-0711-465a-8d26-d45ac0c92877)

### Change of gif image:
Before:
![image](https://github.com/facebook/sapling/assets/35460167/dfc54c12-9c26-4a64-83f6-a3829e534197)

After:
![image](https://github.com/facebook/sapling/assets/35460167/9dd7a2cb-f827-4bbb-aa72-810dc1f52083)

Pull Request resolved: https://github.com/facebook/sapling/pull/703

Reviewed By: muirdm

Differential Revision: D54140704

Pulled By: quark-zju

fbshipit-source-id: dbefa7b6ce5452ca32dd9f87278bc0b371c1d49c
2024-02-23 15:25:36 -08:00
Alex Coleman
ff1dd95f48 Add file decoration provider (#717)
Summary:
Add file decoration provider

Inspired by the built-in git extension's decoration provider, highlights changed/add files in the tabbar / file explorer (ex. by showing "M" for modified, and a yellow color). This came up as a gap from using git with vscode that led to people not adopting sapling.

Based on: ec041fc442/extensions/git/src/decorationProvider.ts (L166)

See: cd717bb419/release-notes/v1_53.md (tab-decorations) and https://stackoverflow.com/questions/66905124/vscode-how-to-remove-git-decorator-information-from-file-tabs

Pull Request resolved: https://github.com/facebook/sapling/pull/717

Reviewed By: evangrayk, sggutier

Differential Revision: D52929137

Pulled By: quark-zju

fbshipit-source-id: d1d596b1f72073e33ddd999525512996750d7a5b
2024-02-23 15:20:25 -08:00
Alex Coleman
99d7295321 Fix commit message template (#821)
Summary:
Fix commit message template

Fixing an issue where the commit template from `sl debugcommitmessage` would be overridden due to `Internal.getCustomDefaultCommitTemplate`. This is because the check `customTemplate?.trim() !== ''` would return `true` for undefined, leading to the template being overwritten with `undefined`.

After this fix, a template correctly loads into ISL with "Summary" and "Test Plan" by default.

Also updated the "ignore line" regex to include the trailing linebreak (optionally), to prevent a bunch of blank lines in templates.

Pull Request resolved: https://github.com/facebook/sapling/pull/821

Test Plan:
Confirmed after this fix, the default template of:
```
<Replace this line with a title. Use 1 line only, 67 chars or less>

SL: Enter commit message.  Lines beginning with 'SL:' are removed.
SL: Leave message empty to abort commit.
SL: --
SL: user: Alex Coleman <alex@statsig.com>
SL: changed addons/isl-server/src/Repository.ts        |  5 +++--
SL: changed addons/isl-server/src/ServerToClientAPI.ts |  2 +-
SL:  2 files changed, 4 insertions(+), 3 deletions(-)
```

was now transformed to:
```

```

And then correctly appeared in ISL:

Reviewed By: mitrandir77

Differential Revision: D52937981

fbshipit-source-id: aac4f333bc79645fb8f18e6f550006337c1addc1
2024-02-23 14:51:19 -08:00
Michael Cuevas
b3af7c7b8c fix FilteredFS clone bug
Summary: The correct format of the .hg/sparse file is `%include {filter}`. This didn't show up in tests because hg only complains if you try to change the filter.

Reviewed By: fanzeyi

Differential Revision: D54134450

fbshipit-source-id: 5e3b784f5aaa7b6f232f3fed6b932fb9d1e570cb
2024-02-23 14:40:40 -08:00
Alex Coleman
4c07058e77 Default to showing blame (#817)
Summary:
Default to showing blame

Blame feature has been out for a while and seems functional generally. I often get questions about how to enable this.

Seems like it should be good to just enable by default, but if that conflicts with an internal blame or something I could try and ensure we set this setting in all our repos instead

Pull Request resolved: https://github.com/facebook/sapling/pull/817

Reviewed By: evangrayk

Differential Revision: D52877062

Pulled By: quark-zju

fbshipit-source-id: a53f909d167ddb256d0514f14a8709a6e74dea2a
2024-02-23 14:18:01 -08:00
Genevieve (Genna) Helsel
c0a0212e1e add DirType.cpp to TARGETS
Reviewed By: MichaelCuevas

Differential Revision: D54128124

fbshipit-source-id: 2748732d85ac1f946a269ee827172544d1a6968e
2024-02-23 13:47:22 -08:00
Richard Collins
7015ceab09 Configurable branch name template for pull requests (#772)
Summary:
Configurable branch name template for pull requests

Addressing issue:
* https://github.com/facebook/sapling/issues/642

This change adds the config option `github.pr.branch-name-template` to configure the name of the branch created when submitting pull requests, using standard Sapling templates.

The default config value is `pr{github_pull_request_number}`, to match the existing branch naming scheme.

More complex templates are possible, e.g.:
```
sl config --user github.pr.branch-name-template="prs/{sub(r'<[^>]*>|\W', '',
strip(author))}/{sub(r'\W+', '-', lower(strip(firstline(desc))))}_pr{github_pull_request_number}"
```
Then when submitting a commit with title "This changes stuff!" authored by "John Doe <jd@example.com>" as a PR, the new branch for the PR will be named: `prs/JohnDoe/this-changes-stuff_pr1234`.

Alternatively, you can choose the branch name at the time of submission with e.g.:
```
sl pr submit --config github.pr.branch-name-template=this-is-the-branch-name
```

Pull Request resolved: https://github.com/facebook/sapling/pull/772

Test Plan:
* Created a stack of simple commits in a test repo.
* Submitted stack to Github with `sapling pr submit`.
* Observed that the PR branches are of the form `pr1`, `pr2` etc. (as before).
* Ran `sl pr unlink -r .` on each commit.
* Ran the `sl config ...` line above to adjust the branch template.
* Submitted the stack again to Github, as new PRs.
* Observed that the PR branches are of the form `prs/RichardCollins/test-commit_pr3` etc..

(I also tested resubmitting/updating an existing PR with a different template, to ensure that existing branches are kept under their original name.)

Reviewed By: quark-zju

Differential Revision: D51242274

fbshipit-source-id: 0fa9cbefeffebc13ca1a9d6e8ddf00266f749350
2024-02-23 13:33:30 -08:00
Alex Coleman
fa68f75f79 Don't auto-close drawer when window isnt loaded (#827)
Summary:
This was triggering frequently for me, auto-closing my ISL after I closed the sidebar and reopened it later.

This case seems irrelevant and likely indicative that the frame just isnt loaded yet, so just skipping the autoclose.

https://github.com/facebook/sapling/issues/768

Pull Request resolved: https://github.com/facebook/sapling/pull/827

Reviewed By: evangrayk

Differential Revision: D53138052

fbshipit-source-id: 1a548019652da481effeec0f054dab6947855dc4
2024-02-23 13:25:50 -08:00
Shayne Fletcher
6d2a9bede4 verify use of structured annotations (2/2)
Summary:
the intent is to test conversion to rust structured annotations for a subset of fbcode (have chosen 'fbcode/configerator/structs/scm/mononoke')

this diff  relies on D53674463 (should land in conjunction with this one) where .thrift files are updated so that rust unstructured annotations are replaced by their structured equivalents.

Reviewed By: dtolnay

Differential Revision: D53676407

fbshipit-source-id: a3f71bd94354f2cf4f6400cf773c71f08b73966e
2024-02-23 12:57:31 -08:00
Jun Wu
e8d223f033 oss: attempt to disable dependabot PRs
Summary:
The dependabot PRs for Javascript and Rust cannot be used as-is because our
monorepo requires "offline mirrors" for dependencies that dependabot cannot
directly update. So let's just limit the dependabot PR to 0. I guess this
does not disable security alerts which are shown separately
(https://github.com/facebook/sapling/security/dependabot).

Reviewed By: zzl0

Differential Revision: D54129988

fbshipit-source-id: b98cd903786b4a0245a17c0343733b22a1f000c6
2024-02-23 12:52:06 -08:00
Bradley Turek
63f2d0543f Fix wayward backtick (#829)
Summary:
The backtick was accidentally including the aside, now it only encompasses the command.

Pull Request resolved: https://github.com/facebook/sapling/pull/829

Reviewed By: quark-zju

Differential Revision: D53185153

fbshipit-source-id: af8c932101d612a07dd2fdbecf716d9b86f94107
2024-02-23 12:10:57 -08:00
Keunhong Park
b593fdc026 Fix reviewstack not detecting new sapling footer. (#837)
Summary:
ReviewStack was broken by https://github.com/facebook/sapling/pull/779. Fixes: https://github.com/facebook/sapling/issues/826

Pull Request resolved: https://github.com/facebook/sapling/pull/837

Reviewed By: quark-zju

Differential Revision: D53813909

fbshipit-source-id: 7d41d7aacf5c18376636caa90cc9ad328c1ad72a
2024-02-23 12:04:46 -08:00
generatedunixname89002005287564
efeb8cd887 eden (5003156845066480047)
Reviewed By: genevievehelsel

Differential Revision: D53914310

fbshipit-source-id: f56669c44d28f7e327b7918ed52647dcd2b0cfbf
2024-02-23 11:30:48 -08:00
Michael Cuevas
a71c6e26ff refactor BackingStoreOptions
Reviewed By: jdelliot

Differential Revision: D54032139

fbshipit-source-id: a49662b4d62c8388f5bd187fc20a98ab6d852409
2024-02-23 11:27:15 -08:00
Michael Cuevas
50ac261ab0 rename native backing store options
Reviewed By: jdelliot

Differential Revision: D54032122

fbshipit-source-id: 568a535ff59aedbae0d88e54ff4c0a45948c079b
2024-02-23 11:27:15 -08:00
Michael Cuevas
949e59a81a Add annotations to filteredhg tests
Summary: I accidentally ran Pyre for this file. Might as well add the annotations to the test functions.

Reviewed By: genevievehelsel

Differential Revision: D53840666

fbshipit-source-id: 45aa1a07521b31b51b3f598a15ee648ef3c9fd48
2024-02-23 11:27:15 -08:00
Michael Cuevas
78739b7f79 HgDatapackStore: use C++ options to stop using legacy filters
Reviewed By: jdelliot

Differential Revision: D53840247

fbshipit-source-id: c93c3f13ce39e4c059eebb3cf113f97a4bae6d07
2024-02-23 11:27:15 -08:00
Michael Cuevas
f4dec55b65 HgDatapackStore: add C++ options
Reviewed By: jdelliot

Differential Revision: D53840246

fbshipit-source-id: 03c70ff24e5bc4c8c63dbc6b3e3edc079565abe3
2024-02-23 11:27:15 -08:00
Michael Cuevas
ddb3468622 HgDatapackStore: refactor options
Reviewed By: genevievehelsel

Differential Revision: D53840248

fbshipit-source-id: ce5b08cc36e3e726e964cdbc9cc77150f5d0fd7a
2024-02-23 11:27:15 -08:00
Jun Wu
0798a93ebf regenerate textmate code
Summary: Done by `yarn textmate`.

Reviewed By: evangrayk

Differential Revision: D54127706

fbshipit-source-id: 57865606d74675aee76ff07284e332aa7faad632
2024-02-23 11:04:36 -08:00
Jun Wu
739153706e update textmate script to match ISL's version
Summary:
Include changed on the ISL side:
- Drop monaco-editor dep.
- Migrate off `--experimental-specifier-resolution=node` which is incompatible
  with the latest node.

except for the require -> import change since reviewstack is not using ESM.

Reviewed By: evangrayk

Differential Revision: D54127707

fbshipit-source-id: 1c961bd554204740d766098498fcebe63d11c3be
2024-02-23 11:04:36 -08:00
Mark Juggurnauth-Thomas
37ee9986eb exchange: add mutations in raw form
Summary: When adding mutations received from the server, we should add them in raw form, and not add implicit links like we would when adding them locally.

Reviewed By: quark-zju

Differential Revision: D54121327

fbshipit-source-id: fcaa1b3f3f302eb1d0541a5e98276b417039c327
2024-02-23 11:03:37 -08:00
Rajiv Sharma
9f9a40e005 Migrate no_bad_filenames hook configuration to config_json
Summary: As aprt of https://fburl.com/gsd/nviep5e1, migrating hooks from hardcoded and ugly config to json based configerator backed config. Also includes some additional cleanup.

Reviewed By: gustavoavena

Differential Revision: D54118068

fbshipit-source-id: fbd4cb9801c47282217b6ff764f5ec8f0814bd11
2024-02-23 10:49:55 -08:00
Jun Wu
32080aa46a textmate: re-generate files
Summary: Done by `yarn textmate`.

Reviewed By: evangrayk

Differential Revision: D54104071

fbshipit-source-id: b24516c57ed2da9a58a38230d77d1d7dc0a67074
2024-02-23 10:11:29 -08:00
Jun Wu
f7d3b81485 textmate: fix node compatibility
Summary:
node is dropping the `--experimental-specifier-resolution=node` support.
The new pattern requires relative imports to use `.js` suffix. Update imports
to do that. `tsc` is smart enough to look for `.ts` instead of `.js`.

Reviewed By: evangrayk

Differential Revision: D54104072

fbshipit-source-id: e0e30569dbc80b6b8ae4db17e359d068e7ff7d3d
2024-02-23 10:11:29 -08:00
Open Source Bot
9b8c2e91fc Updating submodules
Summary:
GitHub commits:

5fadf50ff2
dcf7594264
15ea14c8b1
6ace96b741
3df1df4b6a
92a620093d
7d0b5fef4b
7ed0191a6b
9f28af70be
d1386de632
69a269748d
cbd5c6544c
848ef39989
f70422ded2
8006dfc8dd
802d519435
31ac01e7c6
0d02c8f9f3
c261d7199f
3f21d173d4

Reviewed By: jailby

fbshipit-source-id: 23539599211afe8c003eb3c1899c20d282412914
2024-02-23 09:33:11 -08:00
Mark Juggurnauth-Thomas
d504f9ebb5 hooks: add convenience function for parsing options out of hook config
Summary: This pattern is likely to be used in all hooks, so make it available as a method on `HookConfig`.

Reviewed By: liubov-dmitrieva

Differential Revision: D54114602

fbshipit-source-id: 3da89175a6dff28bcbf9e1726cdb5b7564b0ac2b
2024-02-23 05:48:57 -08:00
Youssef Ibrahim
d215730399 metadata_diff: properly handle empty files
Summary: When adding an empty file we currently return that one new line was added because we calculate it based on the number of new lines. We also return Some(1) as the first added line instead of None. This diff special cases empty added files to properly handle this

Reviewed By: RajivTS, singhsrb

Differential Revision: D54113155

fbshipit-source-id: 7cd32f160ef2a767c6ceb29bd48365a807c5806e
2024-02-23 04:17:19 -08:00
Gustavo Galvao Avena
1e50c3d8c3 Expand git submodule file changes
Summary:
## What
Implementation of submodule changes expansion for forward syncing (i.e. small to large repo).

## Why
For more details, see T174902563 or [this doc](https://fburl.com/gdoc/xik9okw8).

## Notes
- Apologies for the big diff, but breaking this up was hard to do without straining the reviewer to go back and forth many diffs. I also synced with a couple of people offline about this and they preferred to review it this way as long as they could see the E2E flow and good integration tests.
- I tried to add lots of comments, but this is an extensive feature that can be inherently confusing, so **please ask many questions** if something sounds very confusing.
  - **I'm happy to update/extend the documentation**, but at this point I need some feedback to do so.
- The integration test is probably the best way to view the feature working E2E, so I might add some diff comments there to facilitate review.

## What's next
- Debug and fix deletion in submodules and of submodules. Meaning:
  - When submodule is deinitialized and deleted, its expanded directory in the large repo should be deleted as well.
  - Deleting files in a submodule commits and updating the source repo to point to that commit should also delete the files in the expanded directory.
- Go over the test / edge cases in T174902563 to make sure important cases are covered (add/extend integration tests if they aren't).
- Start implementation to generate the submodules metadata file that will be needed to backsync submodule changes.
- Import whatsapp/iphone in the test repo and check that everything worked as expectedly.

Reviewed By: mitrandir77

Differential Revision: D54006211

fbshipit-source-id: 6938c428f3e92d0a1436af4a9aa10f893b975166
2024-02-23 01:13:56 -08:00
Liubov Dmitrieva
d07b1f0396 disable transfer speed timeout for upload changesets
Summary:
disable transfer speed timeout for upload changesets

Currently, server sends the "upload_changesets" response once it is fully completed,
disable min speed transfer check to avoid premature termination of requests.

https://www.internalfb.com/code/fbsource/[b8c0216665249f8d691eaa155572372313bf2b7d]/fbcode/eden/mononoke/edenapi_service/src/handlers/commit.rs?lines=342

The timeout is more relevant to transferring data endpoints. This endpoint is not fast.

This is to fix the

```
error.HttpError: [28] Timeout was reached (Operation too slow. Less than 1500 bytes/sec transferred the last 60 seconds)
```
in S397015

We still have another timeout mentioned here: D50969586
Currently, 15 minutes, so we should manage to upload larger stacks.

Reviewed By: quark-zju

Differential Revision: D54085068

fbshipit-source-id: b9bfbcf104ceb21b70b32dc47cf65ff5d9fb3635
2024-02-22 23:58:08 -08:00
Katie Mancini
dfcc656491 invalidate after a torn read so the file is accessible
Summary:
All future reads to these files will error until the file metadata caches
are cleared. This diff triggers a delayed invalidation after a file is
read with the incorrect size. This makes the file accessible again.
It's possible (though it doesn't always happen) that EdenFS's internal state
could be inocorrect for the file. a future `eden doctor` run will be able
to fix it up.

Reviewed By: MichaelCuevas

Differential Revision: D52278628

fbshipit-source-id: 580746bb91d21c79f87d16d5e442843617ac779c
2024-02-22 19:34:50 -08:00
Katie Mancini
a7bb705027 getFileData: don't crash if length is too long
Summary:
Currently, EdenFS crashes if ProjFS requests to read more bytes than we have
available for a file. I am able to repro this, by blocking the read so that
it starts before an `hg checkout` that shortens file contents and completes
after.

I am making eden return an error when we don't have enough data available.
Unfortunately, it seems there is no error code that indicates to projfs it's
view is stale and make it flush it's caches and retry. All error codes seem to
be propagated to the user. These ones are the most promising to make PrjFS do
something we want: https://learn.microsoft.com/en-us/windows/win32/projfs/provider-overview#callback-return-codes

But all those still result in errors to the user. I tried a few more common
HRESULT return codes: https://learn.microsoft.com/en-us/windows/win32/seccrypto/common-hresult-values

But all errors still get propagated to the user. Invalid argument seems to be
the most accurate reflection of the issue, so I'm going with that for now.

It would be better if we could just return the amount of data that we have, and
not have to error. However, PrjFS will still think the file is the longer
length and will add null bytes. This will leave the file in an inconsistent
state and leave `hg status` dirty. This seems worse than erroring because it
causes EdenFS to corrupt the file.

Ideally we would fix this by preventing the length from getting out of sync
from the contents we should read the data from. As far as I see there are two
options, but they are both more involved:
- Failing the checkout when we try to invalidate the contents and
it fails. This would be a bit disruptive to the user as background reads
can interfere with a checkout. but it matches the what a native filesystem would
do.
- Keeping the version of the file to read in the placeholder so the version and
length are never out of sync. The file contents would then be the old contents.
This would leave the file modified and make status dirty, which is still not a
great user experience, but at least the file would be in a consistent state.

I've reached out to ProjFS about other solutions -- maybe there is or could be
a particular error that eden can send that will make ProjFS retry and
gracefully deal.

For now error is better than crash

Reviewed By: mshroyer, MichaelCuevas

Differential Revision: D50193962

fbshipit-source-id: 6ca05a4195c29996a0cd255bfd461a98f7dd5fa6
2024-02-22 19:34:50 -08:00
Katie Mancini
5b68b731ef move some utils into EdenTestCase
Summary:
I I wanna use some of this in an EdenHgTestCase, I can't inherit from this class
because EdenHgTestCase and EdenRepoTest are incompatible. I need to move these
methods down some of the layers, might as well put them on the widely used
EdenTestCase so that we can use them in all eden integration tests.

Reviewed By: genevievehelsel

Differential Revision: D50193866

fbshipit-source-id: da4bb8296b335939fec29f77d1abe5bf4e3ce76d
2024-02-22 19:34:50 -08:00
Carlos Fernandez
ec321ea423 eden cli: Retry rmdir after killing processes (on Windows) (redo)
Summary:
Now that we have the ability to kill processes from the previous diff, this one adds the logic to retry if the process kill is successful.

(note: Replacing a previous diff that was giving me some rebase pain)

Reviewed By: MichaelCuevas

Differential Revision: D54070610

fbshipit-source-id: 7a085c7eccba2bf1544de55c3b5dca7a53533ef3
2024-02-22 17:45:03 -08:00
Kazuki Sakamoto
d78f6a25a2 Update termwiz to the latest
Summary:
```
terminfo = "0.8"
termwiz = { version = "0.22", features = ["widgets"] }
```

for ratatui.
ratatui+termwiz will be used for remote debugging.
https://docs.google.com/document/d/1ze3O-b_ki-8ULBBXq5-SlBgSH-7z347lBQ9N2Gk1U8w/edit?usp=sharing

https://www.internalfb.com/intern/wiki/Rust-at-meta/Third_Party_Libraries/Managing_fbsource_third-party_with_Reindeer/

```
fbcode/common/rust/tools/reindeer/vendor
```

Reviewed By: dtolnay

Differential Revision: D52958400

fbshipit-source-id: 37ff1b15e8b2fa4b868c81bcd25beab8b7302295
2024-02-22 15:42:29 -08:00
Kazuki Sakamoto
cb76725edf Fix build error with termwiz v0.22.0
Summary:
```
eden/scm/saplingnative/bindings/modules/pysptui/src/lib.rs:217:49
    |
217 |                 let mods = Modifiers::from_bits(mods).ok_or_else(|| {
    |                            -------------------- ^^^^ expected `u16`, found `u8`
    |                            |
    |                            arguments to this function are incorrect
    |

help: you can convert a `u8` to a `u16`
    |
217 |                 let mods = Modifiers::from_bits(mods.into()).ok_or_else(|| {
    |                                                     +++++++
```

Reviewed By: dtolnay

Differential Revision: D53616859

fbshipit-source-id: 9fec2d93015936fa20541812e985260d097cd530
2024-02-22 15:42:29 -08:00
Liubov Dmitrieva
2e9aa39ef3 improve alter_snapshot API
Summary:
improve alter_snapshot API

**using streams for "single item" requests is implementation details.**

this API should return a single item, all work with streams should happen
inside the implementation, and be implementation details, since the API takes 1
item always and returns 1 result always.

We should use `fetch_single` method that does exactly the wrapping to a stream and unwrapping from the stream.

https://www.internalfb.com/code/fbsource/fbcode/eden/scm/lib/edenapi/src/client.rs?lines=409

https://www.internalfb.com/code/fbsource/fbcode/eden/scm/lib/edenapi/trait/src/response.rs?lines=62

Reviewed By: quark-zju

Differential Revision: D54064966

fbshipit-source-id: cbc4293b8c473d09de4f420e33929c7928dda364
2024-02-22 12:35:10 -08:00
Liubov Dmitrieva
6e6e3e15b5 improve fetch_snapshot API
Summary:
improve fetch_snapshot API

**using streams for "single item" requests is implementation details.**

this API should return a single item, all work with streams should happen
inside the implementation, and be implementation details, since the API takes 1
item always and returns 1 result always.

We should use `fetch_single` method that does exactly the wrapping to a stream and unwrapping from the stream.

https://www.internalfb.com/code/fbsource/fbcode/eden/scm/lib/edenapi/src/client.rs?lines=409

https://www.internalfb.com/code/fbsource/fbcode/eden/scm/lib/edenapi/trait/src/response.rs?lines=62

Reviewed By: quark-zju

Differential Revision: D54064811

fbshipit-source-id: 91bc0606ee96f50bdef2bb17ef637b0c0e0f9749
2024-02-22 12:35:10 -08:00
Liubov Dmitrieva
927283fd36 replace manual parcing of response stream with fetch_single that does the same
Summary: replace manual parcing of response stream with fetch_single that does the same

Reviewed By: quark-zju

Differential Revision: D54064065

fbshipit-source-id: f9ac63a210e816bcf08cf8f829f2a8a33c7c4705
2024-02-22 12:35:10 -08:00
Liubov Dmitrieva
fa26803e36 improve process_single_file_upload API
Summary:
improve process_single_file_upload API

**using streams for "single item" requests is implementation details.**

this API should return a single item, all work with streams should happen
inside the implementation, and be implementation details, since the API takes 1
item always and returns 1 result always.

We should use `fetch_single` method that does exactly the wrapping to a stream and unwrapping from the stream.

https://www.internalfb.com/code/fbsource/fbcode/eden/scm/lib/edenapi/src/client.rs?lines=409

https://www.internalfb.com/code/fbsource/fbcode/eden/scm/lib/edenapi/trait/src/response.rs?lines=62

Reviewed By: quark-zju

Differential Revision: D54063727

fbshipit-source-id: 8fd2761ee423f1b79a55bb68d58f24a40ea59b38
2024-02-22 12:35:10 -08:00