Commit Graph

83208 Commits

Author SHA1 Message Date
Chad Austin
05ab2eb53d use the compiler-defined _WIN32 define
Summary:
WIN32 is defined by windows.h. _WIN32 is defined by the compiler. The
latter is more reliable under refactoring.

Reviewed By: xavierd

Differential Revision: D47528663

fbshipit-source-id: 494f18d94968d9c8ea38fe395881e87c0368728e
2023-07-17 15:18:23 -07:00
Jun Wu
f4dfef01d0 testing: make AssertionError fail tests
Summary:
In tests, `assert False` should be considered failure even if the output
"AssertionError" matches. This avoid blindly `-i` test update that silently
breaks test intention.

Reviewed By: sggutier

Differential Revision: D47524273

fbshipit-source-id: fb96d59ef46f0986265ca0b1d6c1a42017f4ae6f
2023-07-17 14:46:20 -07:00
Jun Wu
8d4e5b20ef fileset: AssertionError -> ProgrammingError
Summary:
In the next change we'll make AssertionError fail tests.
Update the fileset test to not use AssertionError.

Reviewed By: sggutier

Differential Revision: D47524272

fbshipit-source-id: 7698badc5dad0367997c4eb151036e5ac5239ffa
2023-07-17 14:46:20 -07:00
Open Source Bot
54c2fe31d9 Updating submodules
Summary:
GitHub commits:

0b9bc02474
157a97255a
0abb456a5c
7f386f8db3
facde51cbd
a140ccd1c9
e8cc4de228
4a21ea0d1b
4606f780b5

Reviewed By: jailby

fbshipit-source-id: bd6c422aee49168b5fba9081cdadb9e8d94661c0
2023-07-17 13:25:56 -07:00
Open Source Bot
23445b24e3 Updating submodules
Summary:
GitHub commits:

7d488441d9
b1cac0abfd
acf93cc8ed
66f448a307
9b944c8021
d0032e0d9d

Reviewed By: jailby

fbshipit-source-id: 66d076ae17eafa9834cc9b5d4be9f0c042e9ca9c
2023-07-17 12:03:55 -07:00
Zeyi (Rice) Fan
0d61ab668c fix test_file_locked_change_content
Summary:
In D47099273, we changed the behavior when it comes handling conflicts, breaking this test.

The desired behavior is changed with that. The update is aborted when there is a conflict (by extension, when files are locked).

This diff fixes the test to test the new desired behavior

Reviewed By: quark-zju

Differential Revision: D47489412

fbshipit-source-id: 733f51d485b81ba135c880182bd0c3ebfad5ef73
2023-07-17 11:57:25 -07:00
Jun Wu
9462d4e7df dag: log slow paths caused by incompatible VerLinks
Summary:
Add logging under `dag::algo` prefix about when slow paths are used due to
incompatible `VerLink`s. Bump slow paths to `warn` level. This would provide
insights about why slow paths are used.

Reviewed By: zzl0

Differential Revision: D47490348

fbshipit-source-id: 08b42ae2578906ddf39506715ce81b5121ec5578
2023-07-17 11:51:18 -07:00
Jun Wu
9b060a3c6e dag: preserve VerLink on open or persist
Summary:
On IdDag/IdMap open, try to reuse previously assigned VerLink.
On IdDag/IdMap persist/flush, cache the storage version with the current VerLink.

This should reduce "compatibility" issues when the Python world invalidates and
re-creates the changelog, as in `dbsh`:

  In [4]: v1=repo.changelog.dag.version()
  In [5]: repo.invalidatechangelog()
  In [6]: v2=repo.changelog.dag.version()
  In [7]: v1.cmp(v2)
  Out[7]: 0

For example, take the example in D47383634 summary, now

  r1.cmp(r2)

evaluates to `-1` instead of `None` meaning that r2 has
"append-only" changes on top of r1. Although we cannot
yet get rid of D47376881.

Reviewed By: zzl0

Differential Revision: D47488534

fbshipit-source-id: 33e9ec6294ce77f85b04d5d3af02d81a1a6c9282
2023-07-17 11:51:18 -07:00
Jun Wu
069dfdebf5 dag: remove remove_non_master API and tests
Summary: They are no longer needed as we now have more flexible "strip" APIs.

Reviewed By: zzl0

Differential Revision: D47488532

fbshipit-source-id: 932c1ff8b041aa663c7006cec3b572a91bee6647
2023-07-17 11:51:18 -07:00
Jun Wu
be9bf235ee indexedlog: expose Log::version like MultiLog::version
Summary: We have `MultiLog::version`. This diff adds `Log::version` to match the API.

Reviewed By: zzl0

Differential Revision: D47488531

fbshipit-source-id: 0be841c3f4c2263a9d88693ce44d63d904a199af
2023-07-17 11:51:18 -07:00
Jun Wu
ac42bea23b dag: add APIs to cache storage_version to VerLink mapping
Summary:
Today we recreate new `VerLink`s when loading `Dag` from disk. However, if the
on-disk content is not changed, we can actually reuse the old `VerLink` to enable
more fast paths. This diff adds APIs on `VerLink` to support that.

Reviewed By: zzl0

Differential Revision: D47488533

fbshipit-source-id: 1ffb1bd7ba84f1099506af829df7e6a4fc589ff4
2023-07-17 11:51:18 -07:00
Jun Wu
89c23bb9fb localrepo: revert no longer necessary D46590498
Summary:
D47482810 makes the Rust NameDag invalidate the "missing" cache. So D46590498
is no longer necessary.

Reviewed By: zzl0

Differential Revision: D47483597

fbshipit-source-id: f2d1fed0f26ae090f0b6981606e083f3d6dc0dbd
2023-07-17 11:51:18 -07:00
Jun Wu
78ad946636 dag: invalidate caches after importing (lazy) pull data
Summary:
Changing the graph require invalidating caches. `NameDag::import_pull_data`
forgot that. This diff adds the cache implementation.

This could be an alternative fix to D46590498.

Reviewed By: zzl0

Differential Revision: D47482810

fbshipit-source-id: e7091cd90c8e7e7228c51ffe60db18e27f983ecf
2023-07-17 11:51:18 -07:00
Jun Wu
76cd92ead7 dag: int_version -> storage_version
Summary:
Document that the "version" comes from the storage layer, and the storage
"append-only" concept is different from the commit graph "append-only".

Reviewed By: zzl0

Differential Revision: D47482811

fbshipit-source-id: 89cd2df5ee3a786d060d258505c965dcdc9f655a
2023-07-17 11:51:18 -07:00
Evan Krause
3a40763fa1 Fix warning about selected on <option>
Summary: VSCodeButtonDropdown was using `<select>` with `<option>`s. We were putting `selected` attributes on the `<option>`s, but it's preferred to put `selected` on the `<select>` instead. This gave a warning in tests / console.

Reviewed By: quark-zju

Differential Revision: D47479562

fbshipit-source-id: 46e0db6c34eb8bda62535c50d01d4d8bedc0da1d
2023-07-17 09:51:02 -07:00
Xavier Deguillard
9c55aea43d doctor: slightly change wording of "Blocked" VSCode extensions
Summary:
These aren't blocked so the wording is a bit misleading. The word "harmful"
better reflect their behavior, thus changing the name to be more explicit.

Reviewed By: genevievehelsel

Differential Revision: D47422985

fbshipit-source-id: 20f4fdaf7901449bb7a4864b757835b36a3e50d2
2023-07-17 08:24:53 -07:00
Open Source Bot
e6cd578715 Updating submodules
Summary:
GitHub commits:

9924c7e234
283573cea8

Reviewed By: bigfootjon

fbshipit-source-id: df74d77dd549c3bdd92560ea9cb143498dbafb56
2023-07-16 23:06:52 -07:00
Open Source Bot
280683be8f Updating submodules
Summary:
GitHub commits:

960f16fe81

Reviewed By: bigfootjon

fbshipit-source-id: 525231ab382c5841adec51988dd5c797d3dbf35d
2023-07-16 15:11:43 -07:00
Open Source Bot
4c4984b2e8 Updating submodules
Summary:
GitHub commits:

0608d84e8f
ee31ac5b3a
78a833bf52
f2c46d77a8

Reviewed By: bigfootjon

fbshipit-source-id: 898b37f8d3202da98256a443aa10f1a1297a357e
2023-07-15 15:13:38 -07:00
Jun Wu
8e62088a23 smartset: in fileteredset 'xs - ys', preserve prefetch fields of ys
Summary:
For revsets like:

  reverse(master~20::master) & not(file(r're:.*'))

the `file(...)` part sets the "text" prefetch field correctly, however the `xs & not(ys)`
(which is optimized to `xs - ys`) part loses the "text" prefetch field, causing
suboptimal 1-by-1 fetches.

This diff fixes the suboptimal fetches by copying prefetch fields from `ys` to
the `filteredset` returned by `xs - ys`.

Reviewed By: zzl0

Differential Revision: D47419750

fbshipit-source-id: 8925b9c8fab1a269c342d656692ff20c9167bf3f
2023-07-15 13:18:31 -07:00
Jun Wu
161349ac99 smartset: delegate filteredset.prefetch to its "subset"
Summary:
The fitleredset iteration happens on its "subset". Prefetch settings should
apply to the set that is iterated. So let's redirect prefetch APIs to the
subset.

The old `smartset.clone` implementation does not seem to preserve ordering.
The `prefetch` is updated to change prefetch fields of the `self` set directly
instead.

Reviewed By: zzl0

Differential Revision: D47419749

fbshipit-source-id: 26f6b927db5b4e7169f0d3f7e3766d5f7b696be3
2023-07-15 13:18:31 -07:00
Open Source Bot
36e6569b16 Updating submodules
Summary:
GitHub commits:

b397fe2645

Reviewed By: bigfootjon

fbshipit-source-id: d7e689c03fd5b2351260ed50f162afdb8172de7a
2023-07-15 08:54:39 -07:00
Open Source Bot
5511860037 Updating submodules
Summary:
GitHub commits:

0feed27a43
b1b6f87fbe
6c7e4c5051
7013a9bf90

Reviewed By: bigfootjon

fbshipit-source-id: f73e88397b3c4382834d83090c7b5102b0b17934
2023-07-14 17:26:26 -07:00
Chad Austin
ac1434cbfe replace off_t file offsets with a new FileOffset type compatible with Windows
Summary:
off_t is not suitable on Windows because it is a 32-bit signed
type. Introduce a new FileOffset type for use in EdenFS.

Reviewed By: kmancini

Differential Revision: D47406784

fbshipit-source-id: 9cc9585b4b118c54a1ca148c2ba7e7ccfb6f278c
2023-07-14 16:23:19 -07:00
Open Source Bot
2c914c1409 Updating submodules
Summary:
GitHub commits:

ba68c2f0e9
4b77339e65
ab393aa88d

Reviewed By: bigfootjon

fbshipit-source-id: 4c1d63bd8f3c764cffae005bfe549a116a734cbd
2023-07-14 16:22:28 -07:00
Open Source Bot
c110dd3a0b Updating submodules
Summary:
GitHub commits:

c2c0b3ba40
92db9fea82
93ba5b87f8
1ef274fc4d
d8254920df
ee9d42b27a
7833055db3
756ee8e9f5
432d921980
ec14beb383
82e6f4c59c
5c3a101c05
838c74ba1d

Reviewed By: bigfootjon

fbshipit-source-id: 609ecc317f138cd93fb55e19fa8b0423cd46dfa3
2023-07-14 15:18:18 -07:00
Michael Cuevas
ed903733db fix typo in comment
Summary: it bothered me

Reviewed By: fanzeyi

Differential Revision: D47480229

fbshipit-source-id: b7c63986fd4ac95b074b5673456ce5458d1cb62e
2023-07-14 13:47:43 -07:00
Open Source Bot
b669ff47a4 Updating submodules
Summary:
GitHub commits:

b74dec6ed5
6a99f470b8
81b0048c19
a1851e76e9
9fe360aeec
bc44e34bc5
bc0db33483
bce749bcf2
87390dfd14
1e99aa314f
abddc1bbcc
ae932f6edd
afd2d9db49
4a9cfd6ea5
08aba67f8b
2a002a4989
7b8257c8a4
193ebf5271
78dd7b2e33
4a3931ace0
c9362f65fb

Reviewed By: bigfootjon

fbshipit-source-id: e187cc7350fd7d5d7d58e5898e2011b8062ae146
2023-07-14 13:28:06 -07:00
Chad Austin
f317c5ac30 add a getpid benchmark and have ProcessId::current use get_cached_pid on unix
Summary:
getpid() is an unconditional syscall on Linux/glibc. Therefore, it
costs about 250 nanoseconds. There are a couple places in EdenFS where
getpid() is an inner-ish loop so use folly::get_cached_pid() instead.

Reviewed By: kmancini

Differential Revision: D42044221

fbshipit-source-id: e9c8f8a00febeaf6c9a0a3481879040d739038f5
2023-07-14 12:14:40 -07:00
Jun Wu
0e058a36e4 Back out "phases: recalculate when the associated dag becomes incompatible"
Summary:
While the `public()` revset is updated, there could be other "stale" revsets
that are using incompatible versions that triggers slow paths.

Original commit changeset: c8a5c9e0d5dd

Original Phabricator Diff: D47384752

Reviewed By: fanzeyi

Differential Revision: D47478975

fbshipit-source-id: f4eca716bf4268e5ac1e750430f31de2c9751cb1
2023-07-14 12:02:13 -07:00
Jun Wu
018277adc2 changelog: skip commit hash verification for readfiles
Summary:
liubov-dmitrieva reported in P788939965 that commands like:

  hg log -r " reverse(master~1000::master) & not(file(r're:.*'))"

causes lots of 1-by-1 location -> hash lookups. This diff resolves it by
skipping the problematic code path:

  File "edenscm/revset.py", line 1456, in matches
    files = getfiles(x)
  File "edenscm/changelog2.py", line 382, in readfiles
    text = self.revision(node)
  File "edenscm/changelog2.py", line 495, in revision
    p1, p2 = self.parents(node)[:2]
  File "edenscm/changelog2.py", line 648, in parents
    parents = list(self.dag.parentnames(node))
  error.UncategorizedNativeError: Resolving id exceeds threshold 10 set by EDENSCM_REMOTE_ID_THRESHOLD

The troublesome code path was found by setting
`EDENSCM_REMOTE_ID_THRESHOLD=10`.

Reviewed By: zzl0

Differential Revision: D47417522

fbshipit-source-id: 2830e825a362c6a1ea26f2627fef65dd5b7dcf4b
2023-07-14 09:59:47 -07:00
Jun Wu
ec426ff2fe sshpeer: update bash script detection
Summary:
Now `#!/usr/bin/env bash` is used for bash scripts (by D47269779) we need to
update the bash detection for test compatibility.

Reviewed By: evangrayk

Differential Revision: D47457479

fbshipit-source-id: c6a449f53fb265f8a01d6368fe807e0b8bae03aa
2023-07-14 09:56:10 -07:00
Saul Gutierrez
200ff484a7 symlinks: make symlinks appear on Windows on checkout
Summary:
Partially enables symlink support on Windows by making symlinks appear on Windows as actual symlinks as opposed as regular files containing only the place where the symlink would point in other systems.

Creating new commits with symlinks also works (after editing `fscap.py` on hg's side as well as the requirements file for the current directory for enabling symlinks on Windows EdenFS) when the symlinks are in the same directory.

Reviewed By: xavierd

Differential Revision: D44218035

fbshipit-source-id: 0e3094dc5a13cabef1cd24f8fe18cc73ca40d4a8
2023-07-14 08:42:03 -07:00
Saul Gutierrez
26b1e9eb41 symlinks: add gating for TreeEntry:: getType and TreeEntry:: getDtype
Summary:
The methods mentioned in the title changed a bit on Windows, now allowing them to respond that a TreeEntry can be a symlink.

In order to gate this change, on Windows now there is a helper method that is used for reverting the changes for `TreeEntry:: getType` to its previous behavior, in order to be able to tell whether symlinks are enabled for the current Eden checkout or not. Where possible, (which is in most places) the config for whether symlinks are enabled or not on the Eden checkout is passed down.

The non-gated changes are kept since in those cases we actually want to register that a TreeEntry is actually a symlink, even when symlinks are "not enabled".

Originally this was intended to be part of D44218035, but was split for clarity.

Reviewed By: xavierd

Differential Revision: D47326228

fbshipit-source-id: be6cfae6626bf3a32aa119d25bf8b5fe6a549898
2023-07-14 08:42:03 -07:00
Daniel Mueller
9e296d8e9d Update num_cpus to 1.16.0
Summary:
Update num_cpus to version 1.16.0. We need this version as it is a requirement
of libbpf-sys v1.2.1+v1.2.0, which is to be imported subsequently.

Reviewed By: zertosh

Differential Revision: D47380958

fbshipit-source-id: d1fa12a1c8a974686d70d47876e990da4a73b839
2023-07-13 19:19:42 -07:00
Chad Austin
6c8c2ed747 clang-tidy advice
Summary:
clang-tidy had some automated suggestions for our code. Apply the ones
that make sense.

Some of them didn't, like removal of all uses of `volatile`. I
manually reverted those changes.

Reviewed By: genevievehelsel

Differential Revision: D41051052

fbshipit-source-id: 3fe22a91e929d3bb8e6346126c2c7bf9f027eb32
2023-07-13 16:30:55 -07:00
Evan Krause
47f180cb2f Allow making some commit message field types read-only
Summary:
Some fields in internal commit messages are not intended to be set by the user, like Reviewed By. Before this change, these would not get parsed correctly, and often ended up inside another fields like `Reviewers: "person1 Reviewed By: person2"`

Instead, we can mark these fields in our schema as read-only, so they only get rendered if they have content, and otherwise don't show.

Reviewed By: quark-zju

Differential Revision: D47420928

fbshipit-source-id: d77ac293d599f88870f96ec16284c24850c2ab23
2023-07-13 15:47:10 -07:00
Evan Krause
3d07e08050 Show tokens for tokenized fields even when not editing them
Summary:
Tokenized fields, like reviewers etc would show as little typeahead rectangles when editing, but just crammed together when viewing.

Let's be more consistent and extract the token rendering for both.

Reviewed By: quark-zju

Differential Revision: D47420927

fbshipit-source-id: fe76e583da26a1a19e670593220934156c789b24
2023-07-13 15:47:10 -07:00
Chad Austin
cff6d95f19 break XAttr's dependency on folly/Range
Summary: We should prefer string_view over folly::StringPiece..

Reviewed By: xavierd

Differential Revision: D47406695

fbshipit-source-id: 0c557c1d933a8196f4c5b7fbe97c3ca8bda06bda
2023-07-13 11:52:33 -07:00
Chad Austin
1f36519be9 remove some unnecessary FOLLY_MAYBE_UNUSED
Reviewed By: genevievehelsel

Differential Revision: D47387429

fbshipit-source-id: 7d514560a40384384595a2849875f24ee3d16529
2023-07-13 11:47:00 -07:00
Chad Austin
4b3e01c644 gracefully handle getPeerEffectiveCreds returning nullopt
Summary:
I'm not sure when or how this is possible, but EdenFS should handle
the possibility that getPeerEffectiveCreds returns nullopt.

Reviewed By: genevievehelsel

Differential Revision: D47421072

fbshipit-source-id: c77746b5d9476e131fcb0173e13d63e36e4a61d9
2023-07-13 11:39:35 -07:00
James Gill
da30da5ee8 Add cookies and native-tls feature to reqwest
Summary: As title.

Reviewed By: Imxset21

Differential Revision: D47439588

fbshipit-source-id: 8c624c28e2e9987ed8050c1f7a3260b17a52b243
2023-07-13 10:31:30 -07:00
Chad Austin
4478dc3d1b print process ID and name in eden trace hg
Summary:
We have seen reports of people seeing unexpected fetch activity. This
diff plumbs process ID through HgImportRequest so it can be streamed
to `eden trace hg` output.

Reviewed By: kmancini

Differential Revision: D42040798

fbshipit-source-id: 0a18fba6a55e584a4334088efde761a7c1d8fe6e
2023-07-13 09:43:19 -07:00
Chad Austin
a71c8f532b replace some getpid calls with ProcessId::current()
Summary: Add an infallible ProcessId::current() to replace uses of gitpid() and GetCurrentProcessId().

Reviewed By: kmancini

Differential Revision: D42037244

fbshipit-source-id: b5b7dced241d0a70e9d43b40827d741d7049345d
2023-07-13 09:43:19 -07:00
Chad Austin
1ad34b0d2a migrate ObjectFetchContext to ProcessId
Summary:
Now that ProcessId exists, we should use it instead of pid_t in
ObjectFetchContext.

Reviewed By: genevievehelsel

Differential Revision: D42037216

fbshipit-source-id: 34cd89f78be35a15d73b26edc840e917fd642723
2023-07-13 09:43:19 -07:00
Rajiv Sharma
ea18dfc343 Fix clippy lints
Summary: As in title

Reviewed By: markbt

Differential Revision: D47365557

fbshipit-source-id: 103e5245a4f5fe486113c18fa7f54babe0cfea68
2023-07-13 01:14:52 -07:00
Zhaolong Zhu
cb2f6e0520 copytrace: add commit info to the rebase prompt message
Summary: Add additional context (commit and new file name) to the rebase prompt message, this will help avoid conflict resolution errors.

Reviewed By: quark-zju

Differential Revision: D47312287

fbshipit-source-id: 2ed162ae44eb518a33d23aa17f6720ad137d4a04
2023-07-12 19:17:32 -07:00
Zhaolong Zhu
e34b9eea27 pycopytrace: expose the commit info to Python world
Summary: expose the commit info to Python world, it will be used in the following diff to add more context to the rebase prompt messages

Reviewed By: quark-zju

Differential Revision: D47312286

fbshipit-source-id: c896d913660cabffc4c654ba83b8fa9a1e2b24ef
2023-07-12 19:17:32 -07:00
Zhaolong Zhu
a709d050dc copytrace: add the new path to the TraceResult::Deleted/Added
Summary: this will be useful to users as well

Reviewed By: quark-zju

Differential Revision: D47389984

fbshipit-source-id: 05a13e1085820a6dd779e230f9ae98df38243354
2023-07-12 19:17:32 -07:00
Chad Austin
fb91276d18 return SemiFuture from EdenServer::unmount and friends
Summary:
In preparation for unifying unmount() in FsChannel, return SemiFuture
from EdenMount::unmount.

Reviewed By: kmancini

Differential Revision: D45300725

fbshipit-source-id: 4eeb7a19d4140f9985c8a46dd357f7631ff9d490
2023-07-12 15:46:52 -07:00