Commit Graph

89338 Commits

Author SHA1 Message Date
Jun Wu
ab7b222946 config: move line number calculation to a method
Summary:
Internally, config tracks "source" at byte offset level. But that is not
friendly for end-users. Update "source" to provide a line number.

Reviewed By: sggutier

Differential Revision: D56592496

fbshipit-source-id: 2a67922abf811b8d08d5cff1285ae5bd7ed00850
2024-04-26 17:19:49 -07:00
Jun Wu
9171388acd gitstore: integrate with progress
Summary:
This should stop `git fetch` (triggered via the gitstore layer) from polluting the stderr and integrate with `IO`
and pager well.

Reviewed By: sggutier

Differential Revision: D56610228

fbshipit-source-id: 3cda83e6671ad6ea7fe081d12882cdb4f54d4f57
2024-04-26 17:19:49 -07:00
Jun Wu
fe544e0d97 run_cargo_tests: ignore a thrift codegen error
Summary:
Thrift codegen can produce bad code, like:

  error[E0583]: file not found for module `mock`
   --> ...\cargo-target\debug\build\fb303_core_clients-b3d87b870456fabb\out\lib.rs:9:1
    |
  9 | pub mod mock;
    | ^^^^^^^^^^^^^
    |

Do not treat it as failure.

Reviewed By: muirdm

Differential Revision: D56607940

fbshipit-source-id: 23d3e0602085f01f6fd5ed195589cd46c66124fc
2024-04-26 17:19:49 -07:00
Randall Bennett
3d3f507ab1 Allow websockets to connect to the current browser's port of choice (if available) (#886)
Summary:
Allow websockets to connect to the current browser's port of choice (if available)
Adds a check for the current window's protocol. Defaults to ws:// but will switch to wss:// in secure contexts. This assumes the upstream server will handle converting from wss to ws.

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

Test Plan:
Import github project to replit. Run a server by doing:
`sl web --no-app`

open the replit webview with the token, see if it loads the smartlog.

Reviewed By: quark-zju

Differential Revision: D56526564

Pulled By: evangrayk

fbshipit-source-id: d241e2f2bfc7fb3fb30d9be9e8206970b8d57cd3
2024-04-26 16:10:21 -07:00
Evan Krause
06be25b0a4 Track when configuring external merge tool
Reviewed By: quark-zju

Differential Revision: D56655859

fbshipit-source-id: fe0105c3b91c979e9d23aa7874e0c29d3ddbed7c
2024-04-26 16:03:21 -07:00
Evan Krause
2368e359ea Auto-run merge drivers before sl continue
Summary:
Add a config flag to control if you want to run `sl resolve --all` before `sl continue`. This runs automated merge drivers to regenerate generated artifacts.

Sometimes `sl continue` would complain, "you have generated artifacts, run `sl resolve --all` to regenerate". We should just do this automatically for you. We provide a setting so you can opt out of the behavior. That might be useful since merge drivers can be expensive sometimes.

I support we should be doing this in sapling itself? Maybe via a flag when called from ISL?

If we do as a separate command, you'll see if it's `sl resolve --all` that's taking a long time when running in the UI (as opposed to `sl continue`). So we could add special UI documentation that shows that explains it's running merge drivers.

For OSS, I think merge drivers may be less common, so I made this false by default. We could reevaluate this later, and anyone who hasn't tweaked the setting would get the new default.

I also made an inline setting checkbox next to the continue/abort buttons to control this. But only for internal users, since it would likely just be clutter for OSS users. If we determine from analytics that everyone always leaves this active, we could just leave this buried in settings and not show it inline.

Reviewed By: quark-zju

Differential Revision: D56642944

fbshipit-source-id: a8ad580eaf98a618360c92b65d46a0101da4ba31
2024-04-26 16:03:21 -07:00
David Tolnay
ebef6ec6cb Update autocargo component on FBS:master
Reviewed By: zertosh

Differential Revision: D56655848

fbshipit-source-id: 3ff1c47bd562e6fa88e17432f1535dd7002044f5
2024-04-26 15:39:05 -07:00
Saul Gutierrez
b11bb8cdad tests: add support for %b in printf
Summary: This feature was previously not supported, and it's a nice to have

Reviewed By: muirdm

Differential Revision: D56598268

fbshipit-source-id: 29d8247fef5841f5feae5b16ba1b81055befa8dd
2024-04-26 15:34:29 -07:00
Carlos Fernandez
6d2a793814 eden rm: Make process that failed to be killed a list instead of a string
Summary:
Splitting D56490217

This one makes "failed_to_kill" a list instead of a string as we want to log all processes that we couldn't kill instead of one (currently we give up on first fail, but I believe since the user will have to do some manual work we might as well do as much work as we can).

(note: change on behavior other than this will happen in the last diff of the stack)

Reviewed By: jdelliot

Differential Revision: D56588913

fbshipit-source-id: 596a0ad34e7f0e75e93c418aeba7515c80d51748
2024-04-26 15:28:07 -07:00
Luisa Vasquez Gomez
e8ec8b0430 commit cloud: Add utils for hex encoded changeset ids
Summary: In `xdb.commit_cloud` we store CSIDs hex-encoded. These functions add a little abstraction so we can run the same query but slighly different depending on wheter we're using a mysql database or an sqlite one.

Reviewed By: markbt

Differential Revision: D56586031

fbshipit-source-id: 29237d79fc31b177b48d314003d9eb3aa289e442
2024-04-26 14:29:19 -07:00
Luisa Vasquez Gomez
90dd24a304 commit cloud: Allow specifying db type
Summary: The commit cloud service needs some extra operations when we execute queries so we're backwards compatible with the existing db. E.g commits are hex encoded in `xdb.commit_cloud`, so when retrieving data we need to be able to decode them to then pass them up the service.

Reviewed By: markbt

Differential Revision: D56193597

fbshipit-source-id: b45e233a09ab581d6aed7a6193e864fae9faf3f1
2024-04-26 14:29:19 -07:00
Luisa Vasquez Gomez
4a85f15c83 commit cloud: Add edenapi service to hg client
Summary: Most endpoint are unimplemented rigth now. Will fill them out little by little

Reviewed By: markbt

Differential Revision: D56042552

fbshipit-source-id: 2dbeb2ed7c8ce339b7c00f7b7ca8353319150540
2024-04-26 14:29:19 -07:00
Genevieve (Genna) Helsel
bac202a1f1 add the ability to turn off in-memory blob caching
Summary: When debugging a slow `hg st`, I saw that a lot of time was spent evicting items from the `BlobCache`. This adds the ability to turn blob caching off. This mirrors the same option from `TreeCache`

Reviewed By: MichaelCuevas

Differential Revision: D56045141

fbshipit-source-id: 8c401bf9b9b302352fa5a85365b1e10838ef86a8
2024-04-26 14:23:51 -07:00
Evan Krause
017d34ac89 Increase drag target on the right of commits
Summary:
If you drag & drop a commit to rebase, we want the drag target to be a bit forgiving. Currently, it's only EXACTLY the title. So if you dragged onto the diff badge or buttons, it wouldn't work.

This often feels incorrect, for example if you have a commit with a long title, you drag from near the end of the title upwards, near remote/main, it won't preview the rebase unless you get exactly onto the bookmark name.

Instead, we can extend the non-layout part of the <DragToRebase> so that it recieves dragEnter events.

This is done the same way we support dragging from the avatar, with a positive padding and negative margin. This keeps layout the same, but increases the area available for mouse events.

Note that we need to be careful doing this to make sure this new area is not stealing mouse events that were intended for buttons or other UI elements. We can do this with z-index, which seems to work pretty well in my testing.

Reviewed By: jakebolam, sggutier

Differential Revision: D56649406

fbshipit-source-id: 7f091ba4cbd3a675597ca2da370dcd3626657d4a
2024-04-26 14:00:44 -07:00
Genevieve (Genna) Helsel
69e4b191a4 add eden debug gc-inodes
Summary: This is the GC that runs in the background on Windows and in `eden doctor`, we've had a user request to manually run this, but rather than having to run `eden debug thrift`, this adds this endpoint as its own debug command for ease of use, and because the `age` parameter is silghtly confusing.

Reviewed By: jdelliot

Differential Revision: D56478945

fbshipit-source-id: d46f38d7626af5753da8db2111af4aa4d5876755
2024-04-26 13:46:42 -07:00
Muir Manders
efd603d819 smartlog: fix smartlog-default-command hint
Summary:
The hint was firing when just running "sl". This was because the Rust dispatcher was setting Python's `sys.argv` to its args post-processing (which includes adding the default command "sl" on to the list of args). This made it impossible for Python to know if the user typed "sl" or "sl sl" (always appearing as the latter).

Fix by initializing the Python interpreter with the original args. We still pass the processed args to `sapling.run()`, so this should only affect the value of `sys.argv`.

Reviewed By: evangrayk

Differential Revision: D56640367

fbshipit-source-id: 43f2e20edccc54750a170319f806ad8dc79d9ca9
2024-04-26 12:47:23 -07:00
Facebook Community Bot
b9737b72d5 Re-sync with internal repository
The internal and external repositories are out of sync. This Pull Request attempts to brings them back in sync by patching the GitHub repository. Please carefully review this patch. You must disable ShipIt for your project in order to merge this pull request. DO NOT IMPORT this pull request. Instead, merge it directly on GitHub using the MERGE BUTTON. Re-enable ShipIt after merging.
2024-04-26 10:57:20 -07:00
Saul Gutierrez
881f0d5d8f tests: further modernize test-eden-clone.t
Summary:
This is done in preparation for D56220000. In all of our new kind of tests,
`modernclient` and `newclientrepo` should be used instead of the `eagerepo`
from `tinit.sh` since this function causes a number of issues when used.

Additionally, a relatively new feature, updating on clone, is tested here.

Reviewed By: muirdm

Differential Revision: D56220003

fbshipit-source-id: bb54a016b382e2eec138618b7e8c9118a3fb14cf
2024-04-26 10:25:36 -07:00
Saul Gutierrez
ee4740273b tests: allow newclientrepo to get a drawdag as an input
Summary:
On .t tests `drawdag()` allows creating a commit graph and at the same time
create bookmarks there. If we start having many tests that clone eager
repos and want to easily push all of our bookmarks there, just like we do in
D56220003, allowing to do both steps in the same bash function should be
easier.

Reviewed By: muirdm

Differential Revision: D56220002

fbshipit-source-id: 097e7624e5e958e240136358ea45d3a61a285d86
2024-04-26 10:25:36 -07:00
Saul Gutierrez
00f57a8bf7 tests: make echo command behave closer to actual bash echo
Summary: It turns out that the bash echo command prints escaped newlines as actual newlines on bash; we need this kind of behavior in D56220002, so let's fix that

Reviewed By: muirdm

Differential Revision: D56598270

fbshipit-source-id: de590fbf1262e7d35d2000eea434f124611a6608
2024-04-26 10:25:36 -07:00
Evan Krause
a250d7d4e3 Use <RadioGroup> for cwd selector
Summary: Use <RadioGroup> instead of <VSCodeRadioGroup> for the cwd selector in the cwd dropdown

Reviewed By: muirdm

Differential Revision: D56499709

fbshipit-source-id: fbb4d1109aa67a759a3d0d4f32f9729dd04d14f4
2024-04-26 10:01:50 -07:00
Evan Krause
ea7a2b4942 Use ButtonDropdown selector to quickly change cwd
Summary:
If there's more than one cwd available, make the cwd tooltip into a ButtonDropdown, so you can quickly change cwds. This is a bit of a shortcut to the larger UI. This addresses a complaint I've heard that it's harder to change cwd, which some repos do a lot.

This UX pattern is a bit peculiar I suppose, but it feels intuitive enough to me. Open to any opinions about this.

Reviewed By: quark-zju

Differential Revision: D56498233

fbshipit-source-id: 6b909292a24eab4a6a1408e22c8534f24c743a78
2024-04-26 10:01:50 -07:00
Evan Krause
bda074d2ad Use <Column alignStart> in DebugToolsMenu
Summary: Use the new prop for aligning here

Reviewed By: muirdm

Differential Revision: D56532296

fbshipit-source-id: 15556622d18302dacf86e19ebd760a8da8d5de61
2024-04-26 10:01:50 -07:00
Evan Krause
bad1c4a815 Add prop to Column for align-items: flex-start
Summary:
<Column> is very useful, but the default is to center align items. flex-start is very often useful (perhaps even more often than center??).

Add a prop to set the align-items to flex start so you can use `<Column alignStart>` instead of `<Column style={{alignItems: 'flex-start'}}>` which is cumbersome.

Reviewed By: muirdm

Differential Revision: D56532249

fbshipit-source-id: fb61b447037ef6b908dcce19d971c589c6f3facc
2024-04-26 10:01:50 -07:00
Evan Krause
af216bac39 Update <Checkbox> in DebugToolsMenu
Summary: Migrate these checkboxes

Reviewed By: muirdm

Differential Revision: D56531872

fbshipit-source-id: c138889b7ee29c4f2e83c8a48120a92db9747d0c
2024-04-26 10:01:50 -07:00
Evan Krause
6ec8e337a2 Use <Checkbox> for FileStackEditor
Summary: This component is not directly accessible in the UI, but let's migrate their checkboxes anyway.

Reviewed By: muirdm

Differential Revision: D56531553

fbshipit-source-id: fe26bc529d597bcd05891e10a273d6837d3213ec
2024-04-26 10:01:50 -07:00
Evan Krause
c46e257cbb Support disabled prop in <Checkbox>
Summary: Add `disabled` prop

Reviewed By: muirdm

Differential Revision: D56531413

fbshipit-source-id: dda02116f4ec9ea771400ee28bb01b4dcc2a3958
2024-04-26 10:01:50 -07:00
Evan Krause
858bb9e16b Migrate ChangedFile <Checkbox>
Summary:
Migrate from <VSCodeCheckbox>. One small spacing adjustment is needed when there's no children of the checkbox.

This allows us to remove a hacky use of `onClick` instead of `onChange`, which we prefer.

Reviewed By: muirdm

Differential Revision: D56531022

fbshipit-source-id: a343d2c98edcab649ee6a27fd97ac59167077ade
2024-04-26 10:01:50 -07:00
Evan Krause
8a9108b9ef Migrate FileStackEditPanel to <RadioGroup>
Summary: This is the last user of <VSCodeRadioGroup>.

Reviewed By: muirdm

Differential Revision: D56529591

fbshipit-source-id: 5bb66ec43e252eae5c3281665b98225113d509fc
2024-04-26 10:01:50 -07:00
Evan Krause
e5dde07ed1 Migrate CommitInfoView to <RadioGroup>
Summary: The commit/amend selector can migrate to <RadioGroup>. This does require adding a "horiztonal" mode, but it's quite easy to do.

Reviewed By: muirdm

Differential Revision: D56528619

fbshipit-source-id: 856f93dccb42b0156dc18677ffd9055fb705865f
2024-04-26 10:01:50 -07:00
Evan Krause
692f780a0e Migrate PartialFileSelection to <Checkbox>
Summary: Use <Checkbox> now that it supports indeterminate states

Reviewed By: muirdm

Differential Revision: D56527595

fbshipit-source-id: 8f24523e4d66789b36f1c3837dfe3eebc5a8b8b0
2024-04-26 10:01:50 -07:00
Evan Krause
49f260f5bf Support indeterminate checkbox
Summary:
This indeterminate state is useful for checkboxes that represent a condensed view of child checkboxes, and if some are checked and some are unchecked, we show neither true nor false.

<VSCodeCheckbox> has this too, and we use the same sort of styling (rounded rectangle inside)

Reviewed By: muirdm

Differential Revision: D56526950

fbshipit-source-id: e2e3ab28b72d6e199c6f13ba3c5fd4d7a030cd84
2024-04-26 10:01:50 -07:00
Evan Krause
d193196c9d Migrate PartialFileSelection to <RadioGroup>
Summary: Updating to <RadioGroup>

Reviewed By: muirdm

Differential Revision: D56526126

fbshipit-source-id: e4859a90f3d903cedb6f8fbf87beeea301037231
2024-04-26 10:01:50 -07:00
Evan Krause
eb7bcd8076 Update <RadioGroup> to accept tooltips for items
Summary: This lets you give more description for elements

Reviewed By: muirdm

Differential Revision: D56499710

fbshipit-source-id: e6c228d243df70fc0d377c55b39965d2b30dac4e
2024-04-26 10:01:50 -07:00
Evan Krause
199a99ae94 Support data-testId in ButtonDropdown
Summary: Allow specifying a testid for ButtonDropdown, for use in tests

Reviewed By: quark-zju

Differential Revision: D56599851

fbshipit-source-id: fb425b351706a7a7347e83b6eddb23b2c099dc01
2024-04-26 10:01:50 -07:00
Evan Krause
32aded38bf Add icon-style ButtonDropdown
Summary: Add styles for `kind='icon'` for `<ButtonDropdown>`. This styles it like a `<Button icon>`. We previously didn't support this because we added it before we had the border around icon buttons. Now it fits much better. This lets us do more subtle dropdown selectors.

Reviewed By: muirdm

Differential Revision: D56496853

fbshipit-source-id: 72433d4bd774536142b0739ede1bb44c2f1cc488
2024-04-26 10:01:50 -07:00
Evan Krause
7e084c328c Rename VSCodeButtonDropdown to ButtonDropdown
Summary: Move this file to components and rename it for consistency

Reviewed By: muirdm

Differential Revision: D56494154

fbshipit-source-id: fda53c8d31113c79a7669e325cf4768665657944
2024-04-26 10:01:50 -07:00
Alex Hornby
37be2b1cc2 add libdwarf manifest for folly to use
Summary: Give folly depends on and picks up libdwarf, add a manifest for libdwarf to make it explicit and stop it being found via other means

Reviewed By: markbt

Differential Revision: D56630711

fbshipit-source-id: 7b9386b4b93788e7efda13e51e35c9fec4fd6df2
2024-04-26 09:40:38 -07:00
Open Source Bot
2f36f3c943 Updating submodules
Summary:
GitHub commits:

3157f20aad
52676f344d
1b261fc731
47c7d9ad14
5ac73ff08e
d2d9c80267
f9ac285d3d
7ca7bf1e93
35866548b5
3b2468f5f6

Reviewed By: bigfootjon

fbshipit-source-id: bc0cd5260755634c9262a25b4b4cee4f8a69396a
2024-04-26 09:32:14 -07:00
Pierre Chevalier
19227af168 backsyncer: Log from_csid and to_csid to scuba
Summary:
Before this diff, no changeset id was logged to scuba.
This can be useful information to avoid having to jump around between the bookmark update log and the mononoke_xrepo_backsync scuba table.

Log these fields after backsync if they are present.

Reviewed By: mitrandir77, singhsrb

Differential Revision: D56628219

fbshipit-source-id: 6a139ddd7e4a43f06ad02dbb1019cdc98b10c653
2024-04-26 05:38:06 -07:00
Saul Gutierrez
66f37e4b79 tests: add tests for echo and printf commands
Summary: Seems like there are a couple of bugs in these two commands, so let's add some examples of where they fail so that we can fix them later.

Reviewed By: muirdm

Differential Revision: D56598269

fbshipit-source-id: 64fe4ee2a669745e054bd4777a8116b53fb3f044
2024-04-26 05:32:35 -07:00
Saul Gutierrez
01f5128067 tests: add support for RemoveSmallestPrefix on debugruntest
Summary: This adds support for "RemoveSmallestPrefix" substitutions in the debugruntest bash interpreter, allowing it to process arguments like `${parameter#somepattern}`. This will later be used in D56220002

Reviewed By: zzl0

Differential Revision: D56493927

fbshipit-source-id: db0b3d9f277811b5a33bc83d0d39c08b612ad701
2024-04-26 05:32:35 -07:00
Saul Gutierrez
41f319bd1e tests: enable EdenFS for test-rust-checkout.t
Summary:
One of the initial reasons for us to enabling EdenFS on .t tests was to test
differing behavior between EdenFS and non-EdenFS on various commands at the
same time. The `goto` command is known for having differences between those
two, so let's actually test this. This test in particular also has the
advantage of using the "proper" way of initializing and conducting tests
(i.e., using `modernclient` and `newclientrepo`), which also makes it a
good candidate for this.

Enabling EdenFS on this test already surfaced some differences, which will
be fixed later.

Reviewed By: muirdm

Differential Revision: D56220001

fbshipit-source-id: a5d36881c9d15ea5b52c9d2820f01f4796b3b2bc
2024-04-26 05:32:35 -07:00
Saul Gutierrez
14cab3ca04 tests: be more forgiving of sl goto output on EdenFS .t tests
Summary:
On D56220001 EdenFS will be enabled for one of our `sl goto` tests. On EdenFS we
usually don't output the number of files that have been updated, and this is
expected behavior. This diff will help us to not having to add a special case
for EdenFS on each case.

Reviewed By: quark-zju

Differential Revision: D56382866

fbshipit-source-id: 0f51f7514918b3c983a5622f63f33b0153713947
2024-04-26 05:32:35 -07:00
Saul Gutierrez
9f214159f5 tests: add a way to add a fallback function for comparing lines
Summary: In some cases, such as when comparing EdenFS test output we need to add a few exceptions. This diff should be useful for that kind of cases

Reviewed By: quark-zju

Differential Revision: D56580976

fbshipit-source-id: a6f392cf94e0c61ac6002d2c43bdfebbb6bd5b2d
2024-04-26 05:32:35 -07:00
Youssef Ibrahim
299f72140c git/protocol: make packfile generation generic over GitDeltaManifest version
Summary: We want to create a new version of `GitDeltaManifest` that uses git's diff algorithm to generate deltas, and we need to be able to use it alongside the current version. In order to do this, this diff creates traits that encapsulate what is needed out of `GitDeltaManifest` and makes the packfile generation code generic over them. This diff also implements a `fetch_git_delta_manifest` method to get whatever `GitDeltaManifest` version is configured in derived data types repo config.

Reviewed By: markbt

Differential Revision: D56578016

fbshipit-source-id: a6bf23836ebe81c421e99cb44b0b652aa74c5394
2024-04-26 04:30:42 -07:00
Liubov Dmitrieva
949fdc4784 introduce augmented manifests types
Summary:
introduce augmented manifests types (storage layer).

Background:

**Augmented Manifest** is our new data structure represented familiar tree manifest with **two** pointers: traditional mercurial hgid and a newly introduced content-addressed blake3 pointer that would be a hash of child entry serialised with a **custom serialisation format**. We also include size of that serialised blob to form a Digest compatible with CAS.

The new data structure will allow storing Source Control data in CAS, and provide efficient way for Eden to fetch AUX data together with trees, replacing the current slow and inefficient implementation, that triggers fetching lots of blobs (per leaf file entry).

The new format also supports sharing from the beginning, that is important for Mononoke performance for large manifests.

The HgAugmentedManifestEnvelope is the type internal to Mononoke for storing.

Reviewed By: markbt

Differential Revision: D55635473

fbshipit-source-id: 39d2adf1874512d3ed42b0e6d2e1cb785246b493
2024-04-26 04:30:14 -07:00
Muir Manders
c02c054204 backingstore: only reload repo if config has changed
Summary:
Every (default) 5 minutes, we will now only reload the Repo if the on-disk sapling config files have changed since last time we checked. We check for mtime/size difference, and missing/added files. Everything is "best effort" (i.e. low effort) - we don't handle errors, and there are some minor race conditions where we could miss a config update.

Previously we always reloaded the sapling Repo every 5 minutes, but this could theoretically interact badly with kernel caches (wrt the sapling cache's huge mmaped files), or have other unwanted side effects.

Reviewed By: zzl0

Differential Revision: D56501713

fbshipit-source-id: 9d7d21844422226f70afb8fb974660713fd88303
2024-04-25 18:59:52 -07:00
Muir Manders
85a6fe15ea config/loader: add entry point for EdenFS
Summary: Add config loading entry point embedded_load() for callers like EdenFS. EdenFS's embedded Sapling version string will not match the system sl version string, so we set the minimize_dynamic_gen so we don't have dynamic config flapping between EdenFS and sl.

Reviewed By: zzl0

Differential Revision: D56546444

fbshipit-source-id: a7b48173e05a8c31abe2d5072ef21c8ab41bec2a
2024-04-25 18:59:52 -07:00
Muir Manders
d30630b827 config/set: record file content hashes
Summary:
In addition to the paths, also record the content hash of each underlying config file.

I want to use a content hash so I don't have to use mtime and file size to infer changes. mtime in particular doesn't work because we intentionally update hgrc.dynamic's mtime without changing its contents.

Also, recording the content hash during config loading is the only good place to do it (if you check it later you are open to race conditions).

Reviewed By: zzl0

Differential Revision: D56546445

fbshipit-source-id: c6afe747825e7fb3bc2104693e9bfb0b76efff45
2024-04-25 18:59:52 -07:00