Commit Graph

82340 Commits

Author SHA1 Message Date
Evan Krause
ceb1c3f87f Pressing delete deletes last token
Summary: Tokens should be deletable. If you press delete it should prioritize deleting the entered text, but if there is none, then it can delete the previous token entirely

Reviewed By: quark-zju

Differential Revision: D45627741

fbshipit-source-id: f89fb86551fd757749dd71d77ca21901f4e91043
2023-05-08 15:30:28 -07:00
Evan Krause
368c0fe0dd Don't show loading spinner if some suggestions already loaded
Summary:
Small thing, I noticed if result load and then you press more keys, it would show the loading spinner again briefly before the next results load.

It's much smoother if we only show the loading spinner before any results load

Reviewed By: quark-zju

Differential Revision: D45627734

fbshipit-source-id: 4cc5c049f158749dac81a3b12cab7cf94599ba75
2023-05-08 15:30:28 -07:00
Evan Krause
6444610506 insert token on enter or click
Summary: Actually insert selected tokens on Enter or click.

Reviewed By: quark-zju

Differential Revision: D45627737

fbshipit-source-id: 02d88bc61df102391cb1a25d458c98fc843f9135
2023-05-08 15:30:28 -07:00
Evan Krause
73bc2c3a31 Make typeahead results selectable
Summary: You should be able to arrow key up/down through typeahead results, and later click or press enter to add them. This diff just adds the selection UI but not confirming.

Reviewed By: quark-zju

Differential Revision: D45627731

fbshipit-source-id: 1b06b362ed340fdbadf8f78b6841eda9ec08a53d
2023-05-08 15:30:28 -07:00
Evan Krause
c08bc84796 Show user avatar in typeahead results
Summary: The old ISL only showed usernames, but it's a nice touch to show avatars as well. We get them "For free" in our query!

Reviewed By: quark-zju

Differential Revision: D45627733

fbshipit-source-id: 95958954f303879209ce511e139cfad09cbdf6d1
2023-05-08 15:30:28 -07:00
Evan Krause
7860d4ac1c Consolidate TypeaheadResult type
Summary: It seems I duplicated this type, let's consolidate

Reviewed By: quark-zju

Differential Revision: D45627744

fbshipit-source-id: 8c4dce13d91a39c3f0ca8b287a396be6e8f9a1f8
2023-05-08 15:30:28 -07:00
Evan Krause
7360b2c3b8 Setup typeahead api for server side code review provider
Summary: Making the API that each code review provider can use to define how to do their fields' autocomplete.

Reviewed By: quark-zju

Differential Revision: D45627738

fbshipit-source-id: 5e98a385164b614437b3eeb7fe5c12659ddfcde0
2023-05-08 15:30:28 -07:00
Evan Krause
185b0abd65 wire typeahead fetch to go to the isl server
Summary: Hook up our typeahead fetch function to send a message to the server. This is where we'll be able to actually do our fetches.

Reviewed By: quark-zju

Differential Revision: D45627740

fbshipit-source-id: d5426b84fb420f06e72e6f6f583577f63b1242d5
2023-05-08 15:30:28 -07:00
Evan Krause
44eba5acdf Rename autocomplete to typeahead
Summary:
"autocomplete" means a single *inline* suggestion, like ios / github copilot / gmail

"typeahead" means a dropdown list with several results as you type, which is what we want

Reviewed By: quark-zju

Differential Revision: D45627729

fbshipit-source-id: 76ac37116db7ccf3d0e584861163ab9d9e6e25d5
2023-05-08 15:30:28 -07:00
Evan Krause
14b78706b2 Add scaffolding for tokenization and autocomplete in commit info text fields
Summary:
We want to show a typeahead/autocomplete while you're typing reviewers / subscribers / tasks/ etc. This will need to fetch data and show a list of values, then let you accept the results.

To make this nicer, we also want to show the values as tokens, instead of just text. These visual tokens distinguishes values from each other, and lets you click on the x to dismiss them more easily.

This is just the first steps in building this UX. Remaining in further commits, we need to actually fetch the right data depending on the type of field, handle the data, insert suggestions, let you delete suggestions, and deal with focus / other subtleties.

Reviewed By: quark-zju

Differential Revision: D45627742

fbshipit-source-id: d9133c04291bf6165bdf4b7efc6c22330ef68afe
2023-05-08 15:30:28 -07:00
Evan Krause
384d4d22a1 Add CommitInfoTextField
Summary: Create a new field component for one-line fields which have typeahead support. This differs from the previous implementation, which was a multi-line thing

Reviewed By: quark-zju

Differential Revision: D45627739

fbshipit-source-id: 38294ac965ca2ec4e07b7aa23141e833b11c9951
2023-05-08 15:30:28 -07:00
Muir Manders
fc6d3225fd megarepo: trigger autopull for xrepo commit lookup
Summary:
Re-implement the xrepo lookup as a namespace to map xrepo commits to local commits, and an autopull predicate to pull the translated commit.

There are a couple subtle concerns:
1. We don't want to trigger any xrepo work for normal cases such autopulling a normal commit. To achieve that, made it possible to defer the generation of an autopull attempt. This way, the xrepo autopull can cancel itself if the revision in question was successfully pulled by a higher priority autopull predicate.
2. We don't to trigger an xrepo query in `repo["deadbeef"]` (i.e. in commitctx.__init__). This could have surprising performance implications. To achieve this, we only do the xrepo translation during the autopull step. Later, the namespace lookup will only use the cached translation result.

I also moved the behavior into an extension to separate it better.

Reviewed By: quark-zju

Differential Revision: D45537964

fbshipit-source-id: 602db5218c618132672c708edabf366615646600
2023-05-08 15:28:10 -07:00
Open Source Bot
666edb0e15 Updating submodules
Summary:
GitHub commits:

2e02a85825
5c114cc5df
ded3774e52
671afe5400
c838637543

Reviewed By: bigfootjon

fbshipit-source-id: 318a4337431b081bc6a7ca28fdca7cb03436a96e
2023-05-08 15:26:43 -07:00
Saul Gutierrez
fb07625c7e tests: fix flaky test_ancestors test
Summary: This test was flaky since a long time ago we made some changes to `drawdag`, which this diff fixes

Reviewed By: zzl0

Differential Revision: D45442022

fbshipit-source-id: 5a36a70f985d81c42f822f9933e0dc43d87cb591
2023-05-08 13:48:52 -07:00
Open Source Bot
c3343c8f56 Updating submodules
Summary:
GitHub commits:

7e84d65443
8cb0a5cf79
67e2332c78
8f763bdeab

Reviewed By: bigfootjon

fbshipit-source-id: d1f615beb70073eb1451ba071092d24e81264442
2023-05-08 13:47:29 -07:00
Open Source Bot
5e3a4462a4 Updating submodules
Summary:
GitHub commits:

d5dda55910
b492dbfb3e
0e10354566
c3a6918b72
736b3c4909
eb30aaa341
7294b12f31
7637f79616
9269c0d47f
2c179cdf8b
ffdb6d39f8
c51f34611c

Reviewed By: bigfootjon

fbshipit-source-id: 71f826456762e3f62db2e7bb24ab0f7518358fad
2023-05-08 13:06:51 -07:00
Zeyi (Rice) Fan
9f2cfe4af0 add shell completion for hg {hide,unhide,show}
Summary: I use these commands often but they don't have autocompletion.

Reviewed By: zzl0

Differential Revision: D45659357

fbshipit-source-id: 6f55324116cda45e159426f463974df175f9b25e
2023-05-08 12:55:33 -07:00
Open Source Bot
28a7e82ef2 Updating submodules
Summary:
GitHub commits:

00a1a00fb2
2ea3a5de0b
19ece52afe
d2db4f9146
38600c98ad
b92ce53a86
e32f91625c

Reviewed By: bigfootjon

fbshipit-source-id: 2e680fee253062b95ec1107df505ac69d7eb7554
2023-05-08 12:02:02 -07:00
Jun Wu
7b8032985e website: use consistent file name for curl and install
Summary:
strager pointed out the URL has `%2B` in it (so curl writes the file with the
`%2B` name) and the file name below uses `+`. Use `-o` with the desired file
names to avoid issues.

Reviewed By: muirdm

Differential Revision: D45620202

fbshipit-source-id: 27c9247fada2b702888d9f888c8e80c9e3e29a8d
2023-05-08 11:10:58 -07:00
Revathy Kasipandian
bcf9089209 Make Prjfs Tracebus Tracebus size configurable by EdenConfig
Summary: Make Prjfs Tracebus Tracebus size configurable by EdenConfig

Reviewed By: kmancini

Differential Revision: D45384455

fbshipit-source-id: 716ad44474db6e5cc1046829f0e0639e1da9771e
2023-05-08 11:04:48 -07:00
Chad Austin
0b877177b2 enable rpc tests on Windows
Summary: There's nothing unix-specific about these tests, so enable them on Windows.

Reviewed By: genevievehelsel

Differential Revision: D45586168

fbshipit-source-id: 5acbcbe81c5c03b16e43fc561762dbafb47696b8
2023-05-08 11:03:07 -07:00
Open Source Bot
d2b637de38 Updating submodules
Summary:
GitHub commits:

16f7689c38

Reviewed By: bigfootjon

fbshipit-source-id: 2d7f5845e603efb306065c97f96f1813b6ccd9c3
2023-05-08 10:58:03 -07:00
Mark Shroyer
fe7f58d5bf Error if user passes empty --config-dir to edenfsctl
Summary:
If a user relies on an environment variable in their invocation of edenfsctl,
e.g. `--config-dir=$EDEN_DEV_STATE`, then if the user accidentally leaves the
variable unset they may inadvertently specify an empty string as the path to
their config dir.

When running `edenfsctl stop`, the effect of an empty config dir path is to
shut down your main eden daemon instead of your dev daemon, so this has proven
a bit of a footgun.

Reviewed By: xavierd

Differential Revision: D45591968

fbshipit-source-id: 6df6eb8c05d94dafcaee1d6976a52310454a42d4
2023-05-08 10:36:51 -07:00
Evan Krause
7c10b5ddb9 Add tests for changing cwd
Summary:
Add some test cases making sure changing cwd resets states properly. I can definitely imagine edge cases here so this will be a good place for future tests as well.

Note that I had to invert the nesting of <Tooltip> and <VSCodeRadio> to make the test mocks happier, it doesn't really affect much.

Reviewed By: quark-zju

Differential Revision: D45615005

fbshipit-source-id: e1398aa8e5918c42115f4562dfba946d095ee49f
2023-05-08 09:48:40 -07:00
Evan Krause
befd510c25 Don't use eventemitter for cwd changes
Summary:
I noticed we had a million "possible EventEmitter memory leak detected. 11 listeners added" warnings in our tests, even though we disposed our event emitters correctly. That's because we legitimately had more than 10 subscribers to our cwd changing, which seems like way too low a limit.

I think it's better to just implement this "onChangeCwd" ourselves. This also may help us remove the eventemitter polyfill from the client side (it's actually a node thing, so webpack must be polyfilling it for us when we import it from events)

Reviewed By: quark-zju

Differential Revision: D45610780

fbshipit-source-id: e4fd994db4628975766b2faac2efc2b61009d004
2023-05-08 09:48:40 -07:00
Evan Krause
4207e39d9f Add clearOnCwdChange atom effect
Summary:
Some atoms in ISL should clear their state back to the default when the repository is changed. For example, the list of previous and queued operations. If your active repo is now a different repo, those operations aren't really comparable. So it's better for us to just hide them.

Here we introduce an atom that makes it easy to declaratively reset your atom state on repo change.

Reviewed By: quark-zju

Differential Revision: D45593018

fbshipit-source-id: ad3dd0eff875d54b1083d63ab8197a88e68a8f80
2023-05-08 09:48:40 -07:00
Evan Krause
12f02481cd Restart client subscriptions when the repository/cwd changes
Summary:
After the last diff, we now support changing your active repo/cwd.

This requires the client to forget most of its state—in a new repo, none of this would apply. This could have been quite difficult, but we were already basically set up to support this via serverApi.onConnectOrReconnect. A slight superset of this is the new serverApi.onSetup, which handles connect/reconnect, but also handles changes to the cwd/repo.

All our atoms which depend on server state will then automatically re-send their init message, which will then get a response pretty quickly with new info.

This seems to work well in my testing, though it's possible that for there to be some subtle bugs here.
Need to dig in a big to look for anything that might not be getting invalidated. For example, the last run command in the progress thing at the bottom does not get cleared when changing repos. Kind of a tradeoff here, because we'll lose your history of commands since it's not persisted anywhere. That's probably ok though, better have it consistent.

Reviewed By: quark-zju

Differential Revision: D45592101

fbshipit-source-id: 609a1cea64034175514764f39429cf711a491939
2023-05-08 09:48:40 -07:00
Evan Krause
77671843ad Handle changing cwd/repo in isl-server
Summary:
Now that we show a dropdown selector to change your repo, start handling the changeCwd message to actually update your repo.

This requires some slight restructuring. Instead of getting the repository reference in onClientConnection, we have ServerToClientApi know how to make repo references.

This is a slight inversion of control, but since we need repository reference creation to happen in response to messages from the client, it kind of makes sense to do it in ServerToClientAPI.

Reviewed By: quark-zju

Differential Revision: D45592197

fbshipit-source-id: cdc5f6ef63e608998b0e6483cf2b4454bce5065e
2023-05-08 09:48:40 -07:00
Evan Krause
bbf9af8fe9 Show available cwds in cwd selector dropdown
Summary:
Some platforms, like vscode, will allow you to change your cwd/repository among several options. In vscode, you may have multiple workspace folders. Each one should allow you to change your active directory.

We need to surface this list of options, based on vscode's mounted workspace folders, so you can click them to change the current repo.

This process will differ for each platform, although the UI can probably remain similar between them. So we hook this UI state up with platform-specific messages shared between client&server.

Reviewed By: quark-zju

Differential Revision: D45592198

fbshipit-source-id: 35a261370bc13f9feead3bbe9971f473c8701d13
2023-05-08 09:48:40 -07:00
Revathy Kasipandian
707879fc5c Do not hard-fail when edenrc is corrupted
Summary: Do not hard-fail when edenrc is corrupted

Reviewed By: xavierd

Differential Revision: D45550209

fbshipit-source-id: 88b5e7249a7da2ef4c6df69a4c65f08b7832d8d2
2023-05-08 08:23:03 -07:00
Open Source Bot
692c7e1198 Updating submodules
Summary:
GitHub commits:

b2785afbd4
500c975d44
b4a2017e58
23fc525f5a
f83f17fbd6

Reviewed By: jurajh-fb

fbshipit-source-id: f0706d9dd11c287ecf9ccc187448ba74dc9c6e44
2023-05-06 16:05:00 -07:00
Pierre Chevalier
888a60239a non-oss work 10/n
Differential Revision: D45600762

fbshipit-source-id: f802d2ae9a6296edc200b916374fbb1356395b44
2023-05-06 01:47:17 -07:00
Pierre Chevalier
6df12dbea7 non-oss work 9/n
Differential Revision: D45599777

fbshipit-source-id: c31fa8447c33b3a6f69f35986518708a22b064f1
2023-05-06 01:47:17 -07:00
Pierre Chevalier
ef92f5defe non-oss work 8/n
Differential Revision: D45599536

fbshipit-source-id: 7f0fb5262aeefbc56f6207037a66a2f4e3c68d03
2023-05-06 01:47:17 -07:00
Pierre Chevalier
9bba345d85 non-oss work 7/n
Differential Revision: D45599418

fbshipit-source-id: 4b81a03a9290884a2eb47760d4887dc53d5bc024
2023-05-06 01:47:17 -07:00
Pierre Chevalier
4b9c5ae2fe non-oss work 6/n
Differential Revision: D45575956

fbshipit-source-id: 590f31e707b4f0fab5dfdd267f7998b4719bdf04
2023-05-06 01:47:17 -07:00
Open Source Bot
890d787abe Updating submodules
Summary:
GitHub commits:

38d28cb7c8

Reviewed By: jurajh-fb

fbshipit-source-id: 3a1159c0077a6768a2eb847055d44e4db0c8ae20
2023-05-05 21:12:10 -07:00
Open Source Bot
1f7e85bbad Updating submodules
Summary:
GitHub commits:

3747afea6b
37ca507347
40782d7017

Reviewed By: jurajh-fb

fbshipit-source-id: 5c98792131c2833a8ab5f4733cd066f3576f8f45
2023-05-05 14:57:34 -07:00
Chad Austin
a3a8586a79 fix a crash in NFS graceful restart
Summary:
After a takeover, the new socket was initialized with a "remote
EventBase", causing stopAccepting to be asynchronous, tripping an
assertion.

There was a latent bug here: it might have been possible for a new
connection to be accepted by the old process after takeover begun.

Reviewed By: xavierd

Differential Revision: D45584154

fbshipit-source-id: cdd8118d82100bc1e19f6f19676cc2fa412b8775
2023-05-05 14:18:00 -07:00
Jun Wu
d8e1f0027a stack: use useSetRecoilState
Summary:
Address comments in D45358289. By using `useSetRecoilState` it sounds like it
might avoid re-renders sometimes.

Reviewed By: muirdm

Differential Revision: D45595856

fbshipit-source-id: 74c9f2d42af81736cab564189684717a237875e1
2023-05-05 14:17:43 -07:00
Jun Wu
387d93c2d9 stack: make undo tooltip more descriptive
Summary:
Update the tooltip to include what operation is done at what commit(s).
This is done by changing the operation description from a string to a
structure, then providing a function to render it.

The i18n part feels a bit repetitive and a bit annoying - initially I'd
like to include text like "$commit and $n dependencies" but "1 dependency"
is annoying. In the future, maybe we can try using turning-complete code
(instead of static string mapping with replacements) to implement i18n.
I learned this way of i18n from https://github.com/Yidadaa/ChatGPT-Next-Web/tree/main/app/locales

I initially thought that maybe it's okay to store `ReactElement` in the
`history` state. But ChatGPT says that is not recommended. While in our
case it seems our `ReactElement` would be pure and maybe okay to store,
I took the advice and made `history` decoupled from `ReactElement`.

Reviewed By: muirdm

Differential Revision: D45595855

fbshipit-source-id: 1470f911c14e0de3f8fe05dd8dacadbad0c7ce72
2023-05-05 14:17:43 -07:00
Jun Wu
b18981ed42 stack: track reorder offset in ReorderState
Summary:
The offset information is useful. For example, to test if the reoder is a no-op
quickly, or generate a descriptive message about the operation like
"move x down by n commits".

Reviewed By: muirdm

Differential Revision: D45595854

fbshipit-source-id: 9fc98ba1f71b3d18705ed94df7b0969ebc2d9133
2023-05-05 14:17:43 -07:00
Open Source Bot
f2a873bb1d Updating submodules
Summary:
GitHub commits:

fd51f52f7d
cfcc5cc5cb

Reviewed By: jurajh-fb

fbshipit-source-id: 457468781b88f40727810e570d48dcfdc1ba6901
2023-05-05 13:26:38 -07:00
Open Source Bot
15d7a1ba68 Updating submodules
Summary:
GitHub commits:

a94eb5d0dc
eaec76ef99

Reviewed By: jurajh-fb

fbshipit-source-id: 007dcc57ca44d8f61e086cf461b2417bd5aae238
2023-05-05 12:07:39 -07:00
Muir Manders
107eeb3fdb lock: kill Python makelock()
Summary: This is no longer used in favor of Rust locking.

Reviewed By: quark-zju

Differential Revision: D41998651

fbshipit-source-id: 8cadbe737ef064ac64b41bae1389b2123ef672b3
2023-05-05 11:41:29 -07:00
Muir Manders
c312030cbe lock: remove Python releaselock() impl
Summary: This is no longer used since we rely solely on Rust repo locks.

Reviewed By: quark-zju

Differential Revision: D41998654

fbshipit-source-id: 0f955821add1cf10f3220abf70238343fc5c9f8e
2023-05-05 11:41:29 -07:00
Muir Manders
03ec25635e debuglocks: deprecate ability to force lock release
Summary: The force release behavior is broken, and may no longer be necessary. It is broken because it unlocks by deleting the legacy compatibility lock file, which is not load bearing for locking anymore. It could be updated to delete the right lock files, but I don't think that is necessary since locks on all platforms are released automatically when the locking process exits.

Reviewed By: quark-zju

Differential Revision: D41998655

fbshipit-source-id: f3833e07668d108b7a2464dd272a03c76379f32b
2023-05-05 11:41:29 -07:00
Muir Manders
71b8f1e43c lock: kill python "releaselock" function
Summary: This was only used by the "debuglocks" command. Instead, make it get the lock information from the LockHeld exception. This is a better approach since it is "atomic" with regard to the corresponding lock contention (i.e. there is no race condition going to read the lock contents when they might have changed since the lock contention).

Reviewed By: quark-zju

Differential Revision: D41998653

fbshipit-source-id: 3c80b2321a97b052025ef1f316defce3177c60ef
2023-05-05 11:41:29 -07:00
Muir Manders
da8d540283 lock: remove now unused pythonlock class
Summary: Now that everything is using the rust_only locking mode, revert back to having a single "lock" class, but with the rustlock guts.

Reviewed By: quark-zju

Differential Revision: D41998650

fbshipit-source-id: f216df93e3758597c3df7e8c434bebcc8c64160d
2023-05-05 11:41:29 -07:00
Muir Manders
872fd55a71 repolock: share locks between Python and Rust
Summary:
Hook things up so the Python repo.lock() and repo.wlock() functions delegate to the Rust repo's RepoLocker object. This way, repo locks that Python acquires are re-entrant across calls into the Rust workingcopy.

In particular, this fixes a deadlock when calling into the Rust status code since the status code needs to acquire the wlock to update the treestate.

I tweaked the out-of-order lock detection to allow the wlock to be released before the store lock if the wlock had been acquired out-of-order via a no-wait/non-blocking acquisition. The Python status code does `repo.wlock(wait=False)` in a best effort attempt to update the dirstate. The store lock may already be held, so in this case they locks are acquired out of order, and released out of order (but there is no risk of deadlock, so it is okay).

In general I've taken a conservative approach to maintain all the existing Python logic, such as acquire/release callbacks, warnings, shared wlock acquisition, etc. I considered a more aggressive change where we push more into Rust, but we can do that later.

Reviewed By: sggutier

Differential Revision: D45510005

fbshipit-source-id: 178b2213db7e6ec57c3e59c66ca3e21d27674cbf
2023-05-05 11:41:29 -07:00