Commit Graph

14404 Commits

Author SHA1 Message Date
Muir Manders
6d8c87133d runlog: kebabify existing config knobs
Summary: I think we prefer dashes over underscores for config flags. These config values aren't actually configured anywhere, so it should be safe to change.

Differential Revision: D34592509

fbshipit-source-id: 4a5e808b492f65b3baa954ce37d66e8ab3bb5770
2022-03-10 18:16:05 -08:00
Genevieve Helsel
a52f2b9399 fix prefetch-profile result printing
Reviewed By: xavierd

Differential Revision: D34797642

fbshipit-source-id: 8281ca519201ad17dc259aeef2400c586debe038
2022-03-10 17:16:56 -08:00
Xavier Deguillard
993efac9b2 minitop: simplify process management a bit
Summary:
This moves code around and mostly removes TrackedProcess to just be a BTreeMap.
As a bonus, there is a small bug fix where the last access time was always
updated, while it will only be when there has been an access or a fetch.

Reviewed By: genevievehelsel

Differential Revision: D34620287

fbshipit-source-id: 08141b84a02d1cf53be2ee69b32f577c6959d228
2022-03-10 15:33:51 -08:00
Xavier Deguillard
a001da77ea inodes: fix infinite loop in traverseTreeInodeChildren
Summary:
We want to load the children overlay, not its parent. In the case where only
materialized files were requested, the code would infinitively recurse onto
non-loaded but materialized inodes.

Reviewed By: chadaustin

Differential Revision: D34775507

fbshipit-source-id: ed5f4a2cba5fb3cfd03990b6b8696d65e84dde72
2022-03-10 15:32:32 -08:00
Xavier Deguillard
4c3365e000 doctor: handle fb303_status.STOPPED like fb303_status.DEAD
Summary:
When querying the state of EdenFS via the pid file, if EdenFS doesn't respond
to thrift but is still alive we return a fb303_status.STOPPED status. We should
be running the non-healthy checks in that case.

Reviewed By: genevievehelsel

Differential Revision: D34741798

fbshipit-source-id: 9ddd5b20c0e047d9432aa941994e6f97a55440be
2022-03-10 13:38:00 -08:00
Eli Lipsitz
2c51b2eb85 workingcopy: stub out Rust status
Summary:
This diff adds the Python/Rust glue necessary to start implementing the status command in Rust. Specifically, it allows swapping out the implementation of the "dirstate status" with a Rust function, by enabling the `workingcopy.ruststatus` config key.

The status command actually has a few different pieces to it. The full status command can take two arbitrary revisions (or a revision and the "working copy") and produce a status-formatted diff between the two. The first piece (stubbed out here) computes the status between the current revision (`.`) and the working copy.

The end goal is to have the full status functionality implemented in Rust. I chose to start here (by replacing the "dirstate status") because it 1) is something that needs to be implemented anyway and 2) allows us to test it with or without watchman (the pending changes from either concrete implementation are used), even though only the without-watchman case is implemented in Rust. Eventually, the pending changes logic will be called from Rust, rather than called in Python (potentially calling back into Rust) and transferred over to Python. An EdenFS backed repo will not work (yet) -- it bypasses this logic entirely.

In the mean time, to demonstrate that the glue works, I've implemented a basic, incorrect `status` implementation in Rust. Any files modified (or added) on the filesystem are treated as "modified", and any files deleted are treated as "removed".

Reviewed By: DurhamG

Differential Revision: D34623557

fbshipit-source-id: c16e15f5c6596c494a5a385da0ed244d7f27207e
2022-03-10 13:16:04 -08:00
Muir Manders
196ce7cf9f runlog: move watchfile directly under .hg/
Summary: VSCode can't use watchman to watch the current location .hg/runlog/watchfile since watchman only lets you watch files at the top level of .hg. Move the runlog watchfile up to .hg/runlog_watchfile to compensate.

Reviewed By: DurhamG, quark-zju

Differential Revision: D34767447

fbshipit-source-id: 67f660d4255603402b0d846081db9034bced10ff
2022-03-10 12:57:15 -08:00
Dylan Kaplan
2167283891 ui: Support number choices >= 10
Summary:
`choicetuple` currently assumes that the choice will be one character.
In cases where choice is a number >= 10, we see this behavior: {P485111360}
as the entered choice will never match the list of accepted choices.
The proposed fix is to check whether the non-`&` choice is a number
string, if so use that as the choice.

Reviewed By: yancouto

Differential Revision: D34705485

fbshipit-source-id: c538ae19b9a75077b63808f0574f7ac22fef7b5b
2022-03-10 11:49:56 -08:00
Zeyi (Rice) Fan
621e6df665 store: remove prefetch from HgImporter and HgBackingStore
Summary: Now we have native prefetch everywhere, it's time to clean HgBackingStore up.

Reviewed By: xavierd

Differential Revision: D34655532

fbshipit-source-id: b57dfbd4efcc0a5a0b9abc8933fc7b00653bfc9c
2022-03-10 11:31:30 -08:00
Zeyi (Rice) Fan
9365a0217c store: move getTreeFromHgCache into HgQueuedBackingStore
Summary: This function can be moved to simplify the logic a bit.

Reviewed By: genevievehelsel

Differential Revision: D34654888

fbshipit-source-id: ad41916c311594d335112ac8d5c950737f4adadd
2022-03-10 11:31:30 -08:00
David Vernet
2588b7a46d folly: Change rcu_default_domain to return a reference to an rcu_domain
Summary:
Section 5.3.5 in the new C++ Concurrency Technical Specification 2
(http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/n4895.pdf) specifies
the following function:

rcu_domain& rcu_default_domain() noexcept;

The folly RCU header file currently exposes a very similar rcu_default_domain()
function that returns a pointer to an rcu_domain rather than a reference. This
change updates the folly RCU implementation to instead return a reference, and
updates the few callers in fbcode that were invoking it to instead expect a
reference.

Note that in doing so, we also update rcu_barrier(), rcu_retire(), and
rcu_obj_base::retire() to adhere to the new standard.

Reviewed By: yfeldblum

Differential Revision: D34622786

fbshipit-source-id: 4460ce563f9e9ef4d65cdd517707297c23091c80
2022-03-10 11:16:04 -08:00
Zeyi (Rice) Fan
94199ba4b9 cli: allow edenfsctl to show tracekback when configured
Summary:
Sometimes on Windows, we receive user reports that `edenfsctl` hangs indefinitely. We would like to see where it hangs in these cases. Adding this will allow us to see the traceback when ctrl-c edenfsctl with the environment variable set.

Note `--debug` is shared with Rust edenfsctl (where it enables verbose logging).

Reviewed By: xavierd

Differential Revision: D34731381

fbshipit-source-id: 24477d05c01d353f9f7a45fc3c5d28f29b62e3be
2022-03-10 11:15:37 -08:00
Yan Soares Couto
309e0e60e0 Use buck1 explicitly when necessary
Summary:
The team is planning on using buck as an alias to buck2, so let's use buck1 explicitly where necessary.

Turns out most scripts for buck1 just use a path, I just found this one that actually uses buck1.

Reviewed By: mitrandir77

Differential Revision: D34786872

fbshipit-source-id: 33083416ac10630af1ea84dbed8d38e9b7b9e30b
2022-03-10 09:11:45 -08:00
Mark Juggurnauth-Thomas
e168992218 tools/admin: add bookmarks subcommand
Summary: Add a bookmarks subcommand to the new admin tool, migrated from the old admin tool.

Reviewed By: farnz

Differential Revision: D34620505

fbshipit-source-id: 151efa5e9f98a18ba521887b703508880fd23465
2022-03-10 08:21:30 -08:00
Eli Lipsitz
7df04f96b2 pystatus: add conversion into native Python status
Summary:
This diff adds a helper function, `pystatus::to_python_status`, that converts a Rust `Status` into a proper `scmutil.status`, in preparation for implementing the status functionality in Rust.

This wasn't added to the `status` Rust/Python class (which essentially just wraps a Rust Status) because of inherent incompatibilities: the returned Python status *must* hold mutable lists (various Python code mutates them when consuming the object). The easiest way to do this ended up being constructing a `scmutil.status` object from Rust.

Reviewed By: DurhamG

Differential Revision: D34619611

fbshipit-source-id: 63ce6647d6e14be76ecb0c4fa8a2f278ac977b1a
2022-03-09 16:44:15 -08:00
Eli Lipsitz
ccff22c78a status: add missing FileStatus variants
Summary: When the Rust `Status` struct was originally created, it had 5 different `FileStatus` variants. However, `hg` actually considers two more: `ignored` and `clean` (although these are only revealed in `hg status` if the user explicitly requests them). In preparation for a Rust-native status command, this diff adds the missing variants. It also adds a bit of documentation to the `FileStatus` enum explaining (in what I believe to be clear terms) what each of them mean.

Reviewed By: DurhamG

Differential Revision: D34619612

fbshipit-source-id: fa07e9aab78e51a5aecf19f77bb5c5310e87df8a
2022-03-09 16:44:15 -08:00
Carolyn Busch
824064f8ef clone: remove srcpeer segmentsclone
Summary:
There are two options for cloning with segmentsclone - one using edenapi from the destrepo and one
using the srcpeer interface. The latter used to be used for tests, but now the
former handles both prod behavior and test behavior, so the obsolete call can
be removed.

Reviewed By: DurhamG

Differential Revision: D34733142

fbshipit-source-id: 2bf9316465e13be4cea6c3c12bd4e812392aac83
2022-03-09 15:35:14 -08:00
Xavier Deguillard
31411b820e minitop: use Instant instead of SystemTime
Summary:
The SystemTime type isn't guaranteed to be monotonic, and thus getting an
elapsed time from it can fail and thus crash minitop. Since we do not need the
last access time to be tied to an actual wall clock, we can simply use a
simpler monotonic clock: Instant.

Reviewed By: fanzeyi

Differential Revision: D34620286

fbshipit-source-id: e37e5eb6b57b2de78cadef7463e298a37df078de
2022-03-09 12:40:50 -08:00
Xavier Deguillard
1bd6461731 minitop: add a small Cursor abstraction for handling new lines
Summary:
There is a small bug in minitop where the cursor will never move from its
current row due to using scroll directive exclusively. In order to go to the
next row, the cursor needs to be moved down. To simplify the code, a Cursor
abstraction is added which detects when the end of the terminal is reached and
decides whether to scroll, or to go to the next line.

Reviewed By: genevievehelsel

Differential Revision: D34600897

fbshipit-source-id: 480ea919af93a8086def368dbf84afe7672f1a87
2022-03-09 12:40:50 -08:00
Chad Austin
079477a580 do not report conflicts if a file's object ID has changed but the contents have not
Summary:
When migrating to the new hg:object-id-format hash schemes, EdenFS
would sometimes report spurious conflicts from `hg update`. The issue
is that checkout treated the object ID as a proxy for equivalence,
which is not generally true. In that case, let's actually load the
inode in order to compare SHA-1s.

Reviewed By: xavierd

Differential Revision: D34742471

fbshipit-source-id: 230eed0d2d3e45315481a97e32deb41aa040d445
2022-03-09 10:52:48 -08:00
Michael Cuevas
879f204518 remove eden doctor invocation from eden rage
Summary: The invocation of `eden doctor` within rage is causing `eden rage` to hang on Windows when an existing eden mount is hanging. See T113845692 for more info.

Reviewed By: xavierd

Differential Revision: D34741692

fbshipit-source-id: 90d3ed17cec90c8d7b00e9e8315d6d99d21ff83d
2022-03-09 10:36:24 -08:00
Saul Gutierrez
021c8f8f78 init: avoid writing reponame if it already exists
Summary: Some users are seeing too many rewrites to the `reponame` file in their filesystems. This was caused by not checking if the file already existed beforehand.

Reviewed By: xavierd

Differential Revision: D34741781

fbshipit-source-id: 4f83aa2d60aa2cd0b823dfa93237a36a37864f80
2022-03-09 10:24:59 -08:00
Durham Goode
338210782d edenapi: avoid retries for "cert required" errors
Summary:
We should not retry when there are missing or expired certs.
Unfortunately we were, because we get a generic TLS RecvError, so we couldn't
distinguish between a connection failure and a cert issue. This diff adds some
hacky error-message based heuristic to determine what kind of TLS error we got,
so we can retry on some but not others.

I also got rid of the existing ssl_in_message condition, since it seemed to be a
no-op.

Reviewed By: kulshrax

Differential Revision: D34734592

fbshipit-source-id: a71b90d15784b39e7dc61dad460aacf97187f63e
2022-03-09 09:15:10 -08:00
Rajiv Sharma
53cc80cb83 Enable snapshot blobstore to enumerate and unlink data
Summary:
Presently, the bubble and underlying ephemeral store logic insist only on blobstore trait implementation for the basic needs of creating a bubble and adding content to it. This diff includes changes necessary to ensure the underlying raw stores now implement plain blobstore + enumeration + deletion traits to be used as a backing store for bubbles. Key changes in this diff include:
- Introduced trait `BlobstoreEnumerableWithUnlink` to represent blobstores whose keys can be enumerated and deleted.
- Updated `ephemeral_store` facet creation to use a blobstore implementing `BlobstoreEnumerableWithUnlink`.
- Implemented `unlink()` functionality in `PackBlob` to make it an enumerable + deletable blobstore.
- Implement `enumerate()` functionality in `ThriftManifoldBlob` to make it an enumerable + deletable blobstore.
- Added functions to query the underlying SQL store for expired bubbles and update the expiry status of bubbles.
- Added logic to parse configs for `PackBlob`, `ManifoldBlob` and `FileBlob` to construct them as `dyn BlobstoreEnumerableWithUnlink`.

Reviewed By: yancouto

Differential Revision: D34641524

fbshipit-source-id: ddc498e1b10e24c309b5bee6e8e380bf5ea530db
2022-03-09 09:03:58 -08:00
Harvey Hunt
01bb7eed1a mononoke: Fix OSS build warnings
Summary:
I noticed that there are some build warnings for the OSS build:

```
warning: unused import: `anyhow::Result`
 --> cmdlib/log/../logging/glog.rs:8:5
  |
8 | use anyhow::Result;
  |     ^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `fbinit::FacebookInit`
 --> cmdlib/log/../logging/glog.rs:9:5
  |
9 | use fbinit::FacebookInit;
  |     ^^^^^^^^^^^^^^^^^^^^

warning: unused import: `slog::Level`
  --> cmdlib/log/../logging/glog.rs:10:5
   |
10 | use slog::Level;
   |     ^^^^^^^^^^^
```

and:

```
warning: unreachable expression
  --> cmdlib/caching/src/lib.rs:42:5
   |
34 |           unimplemented!("Initialization of cachelib works only for fbcode builds")
   |           ------------------------------------------------------------------------- any code following this expression is unreachable
...
42 | /     if args.blobstore_cachelib_only {
43 | |         Caching::CachelibOnlyBlobstore(args.cachelib_shards)
44 | |     } else {
45 | |         Caching::Enabled(args.cachelib_shards)
46 | |     }
   | |_____^ unreachable expression
   |
   = note: `#[warn(unreachable_code)]` on by default
```

This diff fixes them by moving code around and only exposing the `glog` module
during an internal build.

Reviewed By: mzr

Differential Revision: D34750036

fbshipit-source-id: 5c7a7a80a8de922b44364c139d104783fb2ae363
2022-03-09 08:25:26 -08:00
Yan Soares Couto
aade827c8b snapshots: Use VFS symlink and executable handling
Summary:
VFS already has logic to write symlinks and executables, let's depend on those instead of building our own, which means less surface for bugs.

We still need to fixup the executable permissions for the stuff that we "optimised out", but let's do that in Rust with VFS instead of in python.

This gets rid of some weird issue I've seen where it fails to restore a snapshot, but wasn't able to pinpoint the cause.

Reviewed By: mitrandir77

Differential Revision: D34643939

fbshipit-source-id: acab6f9f33e19237d95861087ba57d610731f8ab
2022-03-09 07:39:33 -08:00
Yan Soares Couto
a9031e7552 Don't swallow error on DM derivation
Summary:
The derive function used a `oneshot` channel to send back the response, however, this was not necessary, as we could just await the JoinHandle from the task it wanted the response from.

From a quick look in blame, it seems this is leftover from old to new futures migration, when doing this was probably harder.

This caused this function to sometimes swallow the real error and instead output "oneshot canceled" error, which is not great to debug.

Reviewed By: farnz

Differential Revision: D34720661

fbshipit-source-id: f3b936ffa6065a5bc927cbfb265a0ae7a5b51330
2022-03-09 07:14:55 -08:00
Yan Soares Couto
a0fb491253 Use consistent test name on snapshot tests
Reviewed By: mitrandir77

Differential Revision: D34308557

fbshipit-source-id: 1081934777a9bd2cf5c94a57e9430ac57ba5aa0a
2022-03-09 06:07:50 -08:00
Simon Farnsworth
90a83dac6f Cache the actual mutable history entries
Summary: When we know we have a mutable rename on a commit, we'll look up all sorts of paths. Avoid hitting MySQL repeatedly for things we can cache, same as we did for commits having mutable renames at all.

Reviewed By: yancouto

Differential Revision: D34693551

fbshipit-source-id: ad31dc97c214d2778a75685a5af2b88937762399
2022-03-08 10:58:27 -08:00
Mark Juggurnauth-Thomas
f9669258f1 tools/admin: extract commit id parsing and printing from convert
Summary:
Extract the commit id parsing and printing functions from the convert subcommand
so that they can be used in other subcommands.  Generalise the command so we can
convert to multiple identity schemes.

Reviewed By: farnz

Differential Revision: D34620504

fbshipit-source-id: b213e1eb68b241a02beb188e1887db1b08ee38ff
2022-03-08 10:21:32 -08:00
Mark Juggurnauth-Thomas
1660c251ff commit_rewriting: make configerator sync config messages debug logs
Summary: These messages are noisy on command line tools.  Make them debug logs.

Reviewed By: HarveyHunt

Differential Revision: D34701735

fbshipit-source-id: 2338836306e9d06425a406a2ff467849395ae491
2022-03-08 10:21:32 -08:00
Harvey Hunt
b0fd932753 hg: Remove BYPASS_READONLY pushvar from commit cloud upload path
Summary:
Before Mononoke was the source of truth for hg repos, D13804545 (5ff6db64ef)
updated the hg client to pass a pushvar that allowed commits to be accepted to
a read only repo.

Since then, a couple of things have changed:
- Mononoke is the source of truth for all repos
- The `BYPASS_READONLY` pushvar is only checked when a bookmark move happens
  (D34108102 (71f58e3133))

This means that providing the pushvar is no longer necessary. Remove it from
the code.

In the future, I want to lock down use of the `BYPASS_READONLY` pushvar so that
only authorised users can use it. The first step of that is to make sure it's
only being passed when needed.

Reviewed By: farnz

Differential Revision: D34109906

fbshipit-source-id: 71c188d2322ab8cfecbe5aa7266654c2b56a4491
2022-03-08 10:00:41 -08:00
Yan Soares Couto
f39f69d299 Better support to deleted manifest on validate mode
Summary:
Two improvements I used to create the test plan for D34556462 (8d9dcc1839)
- We should add dependencies of derived data when regenerating, otherwise it just fails.
- Not printing the warning once per commit verified, but once overall.

Reviewed By: farnz

Differential Revision: D34615406

fbshipit-source-id: 05f39085f3ac10b73618f36a5691201c2fc7bc71
2022-03-08 06:01:58 -08:00
Simon Farnsworth
3405e71fa5 Fetch sitever for mutable renames from tunables
Summary: Makes it easy to change when we need to invalidate the cache

Differential Revision: D34553656

fbshipit-source-id: e6c63f11f21b851fa385906073062134ebefe9fc
2022-03-08 03:10:41 -08:00
Simon Farnsworth
b72982b327 Cache mutable renames presence information on a commit
Summary: We expect most commits to not have mutable renames, and only a few to have them

Differential Revision: D34527806

fbshipit-source-id: ec96d0f645b4db46b7c29f9df22fa80ddedb944a
2022-03-08 03:10:41 -08:00
Simon Farnsworth
37c78a9062 Check to see if this commit has mutable renames before looking it up
Summary: This doubles MySQL queries for now, but gives me a powerful point for caching (the `has_rename` method).

Reviewed By: mitrandir77

Differential Revision: D34527804

fbshipit-source-id: 762cd6644403cbb7fbf26369a13e726df1d4b58c
2022-03-08 03:10:41 -08:00
Simon Farnsworth
389b98b050 Support TTLs in cachelib variant of caching_ext
Summary: I'm going to use TTLs in Mutable Renames caching. Make it work

Reviewed By: mitrandir77

Differential Revision: D34527803

fbshipit-source-id: 3b53ee4e89153814981dcb68b838ee86f5ac7388
2022-03-08 03:10:41 -08:00
Xavier Deguillard
e2e886df96 cli: codemod Eden to EdenFS
Summary:
Let's be consistent and use EdenFS everywhere in our user facing documentation
and messages.

Reviewed By: fanzeyi

Differential Revision: D34692175

fbshipit-source-id: 6346bd9ac3516199fe47123d81833d2c457efbbc
2022-03-07 18:41:29 -08:00
Xavier Deguillard
153b5b54d3 prjfs: remove check for ERROR_ACCESS_DENIED during invalidation
Summary:
Due to changes in EdenFS architecture, recursive calls into EdenFS will no
longer lead to ERROR_ACCESS_DENIED errors, thus this is dead code, let's remove
it.

Reviewed By: chadaustin

Differential Revision: D34464273

fbshipit-source-id: e52560d11bf2b3e11742c6bf7b63b6550ffd3cc4
2022-03-07 16:18:46 -08:00
Xavier Deguillard
286b47b712 prjfs: ignore ERROR_PATH_NOT_FOUND on invalidation
Summary:
During an `hg update` Mercurial complained about the following error:
  error updating some/path: class std::system_error: Couldn't add a placeholder for some/path: 0x80070003: Error (0x80070003) The system cannot find the path specified.

While this didn't stop the update operation, this could be misinterpreted by
users leading to an increase in oncall load. The root cause of this issue is
that EdenFS has loaded TreeInodes that aren't present on disk, and would thus
try to invalidate them.

Reviewed By: chadaustin

Differential Revision: D34464274

fbshipit-source-id: 9ee54c4ab7475a8be5891325d3d1b7151a0878ed
2022-03-07 16:18:46 -08:00
Xavier Deguillard
6bb10367dd prjfs: prevent .eden from being removed
Summary:
Several tools rely on the .eden directory to be present to detect EdenFS.
Unfortunately, removing it by hand would make it disappear breaking these
tools. Thankfully ProjectedFS is providing ways to deny some rename/deletion
from happening.

Reviewed By: chadaustin

Differential Revision: D34433910

fbshipit-source-id: 4d37a6d9eeea3f16f4e1401beac20ef6d6dce71d
2022-03-07 15:36:00 -08:00
Yipu Miao
d3d10aafc0 Add more information to SetPathObjectId log
Summary: This diff will let Eden log more information like path and rootId.

Reviewed By: xavierd

Differential Revision: D34601083

fbshipit-source-id: f678b94edaf282cc20001ea6a104932fb3188ef7
2022-03-07 15:07:12 -08:00
Yipu Miao
71fdfdd9bd Add a thrift method to rm a pah and flush overlay in the end
Summary: Add a thrift method to call removeRecursively. Also enforce flushing invalidation at the end of the removal so the caller can see the up to date state.

Reviewed By: xavierd

Differential Revision: D34591442

fbshipit-source-id: 3fd1dd9d764097a6db614d59fc25792facb7b62d
2022-03-07 15:07:12 -08:00
Durham Goode
79a447b151 scmstore: fix get_missing
Summary:
I recently changed scmstore fetch's to also have an error associated
with the key if we can't find the key. It turns out the get_missing
functionality assumed that no error was returned. Now get_missing fails if
anything is missing.

Let's fix that assumption to unbreak this

Differential Revision: D34698935

fbshipit-source-id: b9a1b16371b393b6862d3501035d032cddf97e29
2022-03-07 14:58:47 -08:00
Carolyn Busch
a59649c6b3 commits: move commits trait out of bindings
Summary: Move the definition of the generic commits trait out of the pydag binding for usage in rust libraries. We're specifically looking to use this for rust changelog initialization and potentially pull.

Reviewed By: sggutier

Differential Revision: D34692193

fbshipit-source-id: 27c137e63d62cc1e1fe493630ea386bf50e8ca90
2022-03-07 14:53:57 -08:00
Yan Soares Couto
e506e715ed Make async DeletedManifestCommon methods take blobstore
Summary:
Let's change `DeletedManifestCommon` so that `lookup` and `into_subentries` also take a blobstore and a context. For DMv1, that is not really necessary, but for v2 it will be, as they might need to fetch from the blobstore.

This also changes `lookup` to return an owned id, instead of a reference.

Reviewed By: mitrandir77

Differential Revision: D34617038

fbshipit-source-id: fe0601c51585ee4125cb94a2e35edc34910519f2
2022-03-07 13:37:02 -08:00
Yan Soares Couto
cc4aab661e Make some DeletedManifestCommon methods async
Summary: Let's change `DeletedManifestCommon` so that `lookup` and `into_subentries` are async. For DMv1, that is not really necessary, but for v2 it will be, as they might need to fetch from the blobstore.

Reviewed By: mitrandir77

Differential Revision: D34612094

fbshipit-source-id: 9f4823a429a88d714894ac7876e0ec464c618b41
2022-03-07 13:37:02 -08:00
Yan Soares Couto
5068ce28ea Add some documentation to DeletedManifestCommon
Summary: Let's make it clearer what each method does.

Reviewed By: farnz

Differential Revision: D34611974

fbshipit-source-id: c04c400926d2ae42834f525e79a9a84ce50481e6
2022-03-07 13:37:02 -08:00
Mark Juggurnauth-Thomas
b9610ff7d6 blobstore: make reloading redacted message a debug log
Summary:
The "Reloading redacted config..." message is noisy on command line programs.

Make it a debug log, so it doesn't get output by default.

Reviewed By: HarveyHunt

Differential Revision: D34620506

fbshipit-source-id: 46e60fb376d3db7588b8a16004746bdb4d93c76f
2022-03-07 06:35:24 -08:00
Michael Cuevas
bf6ec60e15 change color of hg rage paste link for Windows
Summary:
by default, Windows PowerShell uses a blue background. I'm sure many users don't change this (but maybe they do and I'm weird).

The text is extremely hard to read if this is the case. We should update it to yellow on Windows (I highly doubt the yellow would clash with the typical PowerShell background).

Reviewed By: fanzeyi

Differential Revision: D34652357

fbshipit-source-id: b55d1912135b957629ffa027562e4a94db62e88f
2022-03-04 16:12:17 -08:00
Vinnie Magro
a7ef45aa73 switch to 0.11.6
Summary:
lei2022 needs this, but my patch was specifically for 0.11.4 and the
maintainer still hasn't acknowledged the pr

Reviewed By: lei2022

Differential Revision: D34643727

fbshipit-source-id: 0e3581788755053dec0f9ee97586fca6415e0cb2
2022-03-04 15:51:42 -08:00
Durham Goode
291da3c779 license: update license headers
Summary: See the task.

Reviewed By: markbt

Differential Revision: D34531919

fbshipit-source-id: 38a7f1b43cd8051d475ee3c64611adc36a2abcb2
2022-03-04 12:55:23 -08:00
Mateusz Kwapich
0ebfff0d93 treat client disconnections separately to failures
Summary:
the healthchecks are failing because we're getting lots of SendError errors
caused by client disconnections. This diff makes it very clear in our logging
that those are disconnections, not actual failures.

Reviewed By: yancouto

Differential Revision: D34640946

fbshipit-source-id: 5eac2d755e9ff249be954c3ab5ff118817f61a1c
2022-03-04 08:13:05 -08:00
Chad Austin
678c8c8610 update the cli to support variable-width object IDs
Summary:
EdenFS no longer uses 20-byte binary commit hashes and object
IDs. Instead, they're variable-width, and returned over Thrift in a
semi-human-readable format. Update the CLI to render them in a
reasonable way.

Reviewed By: kmancini

Differential Revision: D34573818

fbshipit-source-id: 11e987093db08ddae79e728435031230f5f2783e
2022-03-03 17:17:25 -08:00
Chad Austin
1b34c8026e use BackingStore to translate object IDs to human readable representations
Summary:
The BackingStore is responsible for converting between ObjectId and
human readable representations. Add an ObjectIdCodec just like
RootIdCodec to perform that conversion, and migrate our Thrift
handlers to use it.

Reviewed By: kmancini

Differential Revision: D33202497

fbshipit-source-id: cc499ec5e53c7626eb27528538c6e9d94404b468
2022-03-03 17:17:25 -08:00
Chad Austin
90b678b4cc add support for an embedded proxy hash that contains a path
Summary:
To make it possible to eliminate proxy hashes before we migrate
entirely to EdenAPI, introduce an intermediate object ID format that
includes a path.

Reviewed By: kmancini

Differential Revision: D33200747

fbshipit-source-id: 1ac95b545a6c478bca1b6f3026d1170d88e76ac4
2022-03-03 17:17:25 -08:00
Chad Austin
48a2a801f7 rename the config for the hg object id format
Summary:
There will be two embedded hg object ID formats, so a single boolean
is not sufficient. Introduce an enumeration to prepare for the
intermediate representation.

Reviewed By: kmancini

Differential Revision: D33200681

fbshipit-source-id: 6ecc1488ef000fd3707f2f07094d7940e4a67d39
2022-03-03 17:17:25 -08:00
Chad Austin
0c23915ef7 fix HgQueuedBackingStore tests
Summary:
It's possible under innocent refactoring to trip a false "Attempting
to get HgImporter from non-HgImporter thread" error. This is because
the HgImporterTestExecutor is an InlineExecutor, so the thread-local
must be set in `add`, not the constructor.

Reviewed By: xavierd

Differential Revision: D34626728

fbshipit-source-id: 267ca4ed9f4935edbb16dd425c7a5aa01b47b525
2022-03-03 17:17:25 -08:00
Chad Austin
b1e51686ba fix some laziness in the include structure
Summary:
When we migrated from Hash20 to ObjectId, we didn't fix the #include structure.
Clean that up.

Reviewed By: genevievehelsel

Differential Revision: D32977635

fbshipit-source-id: 202b02f01f22bc174c7559c22af081deb2945caa
2022-03-03 12:11:31 -08:00
Chad Austin
92840f31bd to support arbitrary object IDs in graceful restart, differentiate between no object ID and the empty ID
Summary:
To avoid shutting the door on whether a BackingStore might want to
support a valid but empty ObjectID, change the hash property in
SerializedInodeMapEntry to optional.

Reviewed By: kmancini

Differential Revision: D32977106

fbshipit-source-id: 8549d2f7e187bfa5e642f8231ccbaebbc6a1ac39
2022-03-03 12:11:31 -08:00
Chad Austin
1dba9e477c dead code
Reviewed By: xavierd

Differential Revision: D32977121

fbshipit-source-id: 7864a01d886041b5e842931558b7ea66a05ef20a
2022-03-03 12:11:31 -08:00
Yan Soares Couto
8d9dcc1839 On DF derivation, try to minimise the number of "list" calls.
Summary:
Context: D34551121 (6629440ff7)

This diff is a refactor of deleted manifest derivation, which shouldn't change correctness or functionality, but just build things in a different way that opens up space for optimisation in the future.

It changes current derivation by, when deleting a given deleted manifest node, instead of looking at **all** its children, trying to derive them (and possibly just copying the same id), we instead only look at the children that were modified on the current changeset (if doing a merge, we might still need to look at everything).

So, in terms of the recently implemented `DeletedManifestCommon` trait, instead of using a `::new` method to create an object, which takes a list of all its subentries, we instead use a new `::copy_and_add_subentries` method, which "copies" all subentries from the given node (the parent of the current node), and then just adds and removes a few other entries, which size should be bounded by the number of changes in the commit.

This will allow faster derivation in the future, when using sharded maps. Notice that for now, this doesn't really improve efficiency at all, as we **always load everything in memory** in deleted manifest v1.

When considering the steps on D34551121 (6629440ff7), this is part of step 2.

Reviewed By: markbt

Differential Revision: D34556462

fbshipit-source-id: 1c502ac0756eed270ef9b330f1c9284a775cc43f
2022-03-03 09:26:08 -08:00
Yan Soares Couto
fd13eb64d4 Rename variants of DeletedManifestChange and add explanation
Summary:
At least to me, `RemoveOrKeepLive` was not super clear, but after reading the code I realise it means we remove if it has become empty and "keep live" otherwise.

So I renamed it to make it a little clearer, and added some doc comments as well.

Reviewed By: markbt

Differential Revision: D34552369

fbshipit-source-id: 88d8e8638739b501eb64df06379dc2167aced00b
2022-03-03 09:26:08 -08:00
Yan Soares Couto
856d0a7263 Use HashSet in DF derivation to deduplicate parents
Summary:
This is a **refactor**. Currently we use a `parents: Vec<ManifestId>` on DF derivation. However, if two parents have the same id, it's fine to merge them in a single instance, so this diff starts using `HashSet` to do that automatically.

The code already used to do some "manual checking" for this, by checking if all elements were the same:
https://www.internalfb.com/code/fbsource/[df8bda9a02f6535970a490a77d4689854df06ce5]/fbcode/eden/mononoke/derived_data/deleted_files_manifest/derive.rs?lines=321-325

See D34551121 (6629440ff7) for high level context (not necessary for review)

Reviewed By: markbt

Differential Revision: D34551752

fbshipit-source-id: 8c4e4ce80786b85855726677bbd475e0ffae8c3f
2022-03-03 09:26:08 -08:00
Yan Soares Couto
ccc9fb7958 Put DF derive functions inside generic struct
Summary:
This is a **refactor** that creates a struct called `DeletedManifestDeriver` and moves related functions inside it.

Basically, this is a refactor to try to make it so we need to use less turbofish operators.

What was previously this:
```
fn fa<T: MyTrait>() {
   fb::<T>();
}

fn fb<T: MyTrait>() {
  fc::<T>();
}

fn fc<T: MyTrait>() {
  ... something
}
```

Becomes
```
struct MyStruct<T: MyTrait>(PhantomData<T>);

impl MyStruct {
  fn fa() { Self::fb(); }
  fn fb() { Self::fc(); }
  fn fc() { ...something }
}
```

We only declare the generics once and everywhere else just use `Self::`. Something like this is already used [here](https://fburl.com/code/k492k4c4).

----

See D34551121 (6629440ff7) for high level idea (not necessary for review)

Reviewed By: markbt

Differential Revision: D34551400

fbshipit-source-id: 069b2cd4f74cf82effeb2bb5ffd332953f4bd748
2022-03-03 09:26:08 -08:00
Muir Manders
7b1c750a1e runlog: add mechanism to watch for interesting commands
Summary: Add a "watchfile" file that gets touched only when an interesting command is written out to the runlog. "interesting" is defined as not in the runlog.boring-commands config value.

Reviewed By: quark-zju

Differential Revision: D34592501

fbshipit-source-id: f4506ca06649da6adc223990dc83ffda99541a29
2022-03-03 09:09:58 -08:00
Saul Gutierrez
f500eb60ad metalog: clean up metalog-root-override hint
Summary: This hint was used for warning about `HGFORCEMETALOGROOT` being set during metalog initialization in Python. Since we recently moved this codepath to Rust (and currently don't have an equivalent for warnings), this hint is no longer necessary.

Differential Revision: D34588792

fbshipit-source-id: 1bb3aaaa7b403a91b874ca840ff7f483fa04b4db
2022-03-03 07:55:24 -08:00
Saul Gutierrez
19dccbca15 metalog: move metalog initialization into Rust
Summary: This moves most of the logic of metalog initialization into Rust. The migration logic is kept in Python since we only have it for legacy reasons and don't plan to keep it in the future.

Differential Revision: D34528394

fbshipit-source-id: 561a8f06d90a697a9286781a43aeaca52a5fc7a2
2022-03-03 07:55:24 -08:00
Yipu Miao
c3bb954120 getRequestInfo return pointer instead of reference
Summary: As title mentioned, this will return a default nullpoint for context that does not implement getRequestInfo.

Reviewed By: xavierd

Differential Revision: D34253517

fbshipit-source-id: e37e2e3ec81985362e8d8b16b47b616bb3f2694c
2022-03-02 20:04:11 -08:00
Eli Lipsitz
49093c7039 rust: suppress existing Cargo warnings
Summary:
Previously, when building with `make local`, Cargo outputs two warnings:

```
warning: type `repo` should have an upper camel case name
  --> /data/users/elipsitz/fbsource/fbcode/eden/scm/edenscmnative/bindings/modules/pyrepo/src/lib.rs:23:21
   |
23 | py_class!(pub class repo |py| {
   |                     ^^^^ help: convert the identifier to upper camel case: `Repo`
   |

warning: field is never read: `debug`
   --> /data/users/elipsitz/fbsource/fbcode/eden/scm/lib/edenapi/src/builder.rs:403:5
    |
403 |     pub(crate) debug: bool,
    |     ^^^^^^^^^^^^^^^^^^^^^^
    |
```

This diff just explicitly allows them. For the first one, the other Python bindings files I found all do the same thing (allowing non-camel case names).

Perhaps we should disallow all warnings to ensure this doesn't happen again?

Differential Revision: D34584999

fbshipit-source-id: a41efb318fcac656b97bc6f0da36b1cd3f3ca360
2022-03-02 17:40:52 -08:00
Yan Soares Couto
6629440ff7 Create DeletedManifestCommon trait and use it for deleted manifest
Summary:
This is a **refactor** that creates a trait called `DeletedManifestCommon`, implements that for `DeletedManifest`, and then only uses the trait on the derive functions for deleted_manifest.

It is a first step towards deleted_manifest_v2, as we will try to share as much code as possible with v1, and reuse the main logic for derivation.

High level idea of this first part:
1. Stop depending on DeletedManifest in derivation and instead depend on a trait **(this diff)**
2. Modify trait and derivation so it doesn't need to iterate over all subentries when possible.
3. Implement base DFv2 structures.
4. Implement trait for DFv2 structures and reuse derivation code.

Reviewed By: markbt

Differential Revision: D34551121

fbshipit-source-id: 411463dc7c87bef949d9f9e7ce5834eab6de1c42
2022-03-02 15:18:23 -08:00
Xavier Deguillard
fc6450bc35 store: inline HgBackingStore::getTreeBatch
Summary:
Now that SCS no longer need special casing, this function simply forwards to
the HgDatapackStore. To make the code consistent with blobs, let's inline this
to the caller.

Reviewed By: kmancini

Differential Revision: D34425492

fbshipit-source-id: e938bff0a273ce5a0fa563074df2a6a3a334338e
2022-03-02 15:03:35 -08:00
Xavier Deguillard
00fb255f2c store: deprecate KeySpace::TreeMetaDataFamily
Summary:
This was only set by SCS, which is now gone, thus let's deprecate it and remove
the associated code.

Reviewed By: kmancini

Differential Revision: D34425036

fbshipit-source-id: 12fa50062ee714e250b9d15d2d72b20a91ba5904
2022-03-02 15:03:35 -08:00
Xavier Deguillard
37a3d96966 prefetch: remove --prefetch-metadata argument
Summary: The only caller (biggrep) has been removed, let's thus remove the argument.

Reviewed By: kmancini

Differential Revision: D34422423

fbshipit-source-id: 7f93fd2a70606b5bbc5528060692b0a1ec46f8d1
2022-03-02 15:03:35 -08:00
Michael Cuevas
918895d9f5 silence compiler warning for unused variable
Summary: Conditional compilation causes us to not use certain variables when we build on Windows. The compiler then complained about these unused parameters/variables. This was bothering me, so I added the [[maybe_unused]] compiler attribute to these variables to silence these warnings.

Reviewed By: chadaustin

Differential Revision: D34569567

fbshipit-source-id: 512dc2ee29a4cba193d22c75ab74d72d4fdda808
2022-03-02 14:25:55 -08:00
Mark Juggurnauth-Thomas
eb71a7690d commitcloud: always check metalog root for changes
Summary:
Multiple transactions can happen within a command.  If the last transaction
doesn't change the metalog, then the commit cloud check for whether anything
changed won't see a change, and the background backup won't be started.

Instead, ignore whether there was a transaction at all, and just check to see
if the metalog has a new root after the command has completed.  If it has,
start the background backup.

Reviewed By: DurhamG

Differential Revision: D34556502

fbshipit-source-id: d70c86075a4a4a311de67f33b80f5f526b978411
2022-03-02 05:17:07 -08:00
Mark Juggurnauth-Thomas
58315ec74f tests: ensure stable output for test-edenapi-server-scuba-logging.t
Summary:
The output for the endpoint this test is testing can be in either order.
Ensure the output is sorted so the test is stable.

The sorting works on the `repr` of the values.  Since `2222...` becomes
`'""...` and `1111...` becomes `"\x11\x11...`, they sort in that order, but it
is stable.

Reviewed By: farnz

Differential Revision: D34558164

fbshipit-source-id: 16e66d673e7a9a7676f08a4661dd9bf806d78074
2022-03-02 05:13:59 -08:00
Michael Cuevas
8cb3a150e9 refactor ServerState constructor
Summary:
Our aim is to construct as few things as possible in the ServerState constructor. Instead, we should preconstruct these objects, create shared pointers, and pass those into the ServerState constructor. This will allow us to pass in "null" pointers to ServerState for testing purposes in the future.

In this diff, we preconstruct a shared_ptr<ReloadableConfig> inside EdenServer so that we can pass it to the ServerState constructor.

Reviewed By: chadaustin

Differential Revision: D34541321

fbshipit-source-id: 99465fe08099ed95179e56b2e39a97ab68112733
2022-03-01 17:52:58 -08:00
Michael Cuevas
aa4732e433 refactor notifications
Summary:
Refactor the existing notification class so it uses the new Notifier interface. The notifier interface will be used to set up notifications/notification trays on different platforms.

The notifier interface is not fully completed yet. More methods will be added in a future diff.

As of now, we only have 1 Notifier, the command notifier. I hope to remove this notifier once we implement notifiers for all platforms that we support.

Reviewed By: chadaustin

Differential Revision: D34291809

fbshipit-source-id: a2a67af2683f1f88781428e8d88191f49e100e96
2022-03-01 17:52:58 -08:00
Xavier Deguillard
cd5a40ab73 store: remove SCS metadata fetching
Summary:
With aux data having been enabled everywhere, we no longer need to be able to
fetch metadata via SCS. Thus let's remove the code.

Reviewed By: kmancini

Differential Revision: D34422424

fbshipit-source-id: beed4d1a2e0fd534cea3537f767f33bedd1b676e
2022-03-01 16:39:25 -08:00
Mateusz Kwapich
9c81174814 offload the slow filenodes initialization to a blocking thread
Summary:
According to tests on my devserver we can spend up to 9 seconds there blocking
main event loop.

Reviewed By: markbt

Differential Revision: D34557877

fbshipit-source-id: cbebf48ade3f7caa7a8ab19238749db86b6845d1
2022-03-01 13:17:36 -08:00
Aida Getoeva
98bb50917d walker: move command args parsing into separate function
Summary: Separate parsing args from the sub command implementation. This is needed to migrate walker to the new cmdlib.

Reviewed By: markbt

Differential Revision: D33929025

fbshipit-source-id: 84c9c071e9ea8e88be888d49471436bb1a626e0f
2022-03-01 10:15:44 -08:00
Aida Getoeva
84c8d7a7e7 walker: move commands and implementation to separate crate
Summary:
Walker has a lot of args and it is hard to migrate it to the new cmdlib iteratively.
I want to separate command implementation from the main command setup and then move the commands one-by-one.

Reviewed By: yancouto

Differential Revision: D33924389

fbshipit-source-id: 1fb468dd9a4d6c9b377391b8f1c11a7e713e31fb
2022-03-01 10:15:44 -08:00
Mark Juggurnauth-Thomas
10172ba107 mononoke_app: fix warning in oss build
Summary:
Now that we have `#[deny(warnings)]` we must ensure we at least pretend to use
all arguments.

Reviewed By: mitrandir77

Differential Revision: D34549480

fbshipit-source-id: ffdee07c09ca7de102d92e1ea9c9047782581194
2022-03-01 07:16:53 -08:00
Mark Juggurnauth-Thomas
e919c8ce30 derived_data_manager: don't consume derivation context on flush
Summary:
With D34074710 (1b339b37b8), flushing `MemWritesBlobstore` no longer suffers from the
problem of written data vanishing while it is being flushed.  This means we
can now make `DerivationContext::flush` take `&self`, and remove the warning
comment.

Reviewed By: Croohand

Differential Revision: D34520170

fbshipit-source-id: 99652c928783214cef365326ddc949aec7f5aca7
2022-03-01 04:38:39 -08:00
Zeyi (Rice) Fan
3c6f866635 edenapi: log unfetchable blobs and trees with EdenAPI
Summary:
Add EdenAPI fallover scuba logging to `HgBackingStore`.

The reason that this is being added to `HgBackingStore` instead of `HgQueuedBackingStore` is that we don't have good access to the actual point where trees and blobs are imported from HgImporter in there. As a result we have to get StructuredLogger in there and send events directly from there.

Reviewed By: xavierd

Differential Revision: D34217906

fbshipit-source-id: 795b61ef6a2ea52e8b67cd08633ec017e5bdbb06
2022-02-28 18:07:38 -08:00
Zeyi (Rice) Fan
5bc49f102d windows: fix asyncio bug
Summary:
On Windows, the default asyncio event loop would throw an exception on tear down.

This diff fixes that by opting to the older event loop. The older event loop doesn't support subprocess but it doesn't look like we use it anyway.

https://stackoverflow.com/a/62413786/694963

Reviewed By: xavierd

Differential Revision: D34486221

fbshipit-source-id: 765056f1e82c9a53d89482527725154445e59494
2022-02-28 16:20:34 -08:00
Muir Manders
18ee58bc42 sparse: fix debugsparsematch to not always union v2 profiles
Summary: Version 2 sparse profiles get unioned at the top level (e.g. if you do "hg sparse enable A" and "hg sparse enable B" and they are v2 profiles, you get "matches(A) OR matches(B)"). However, debugsparsematch was always applying the union logic to the given profile, so for example "hg debugsparsematch -s A ..." would union profiles included in A, which does not match the actual behavior when you enable A.

Reviewed By: quark-zju

Differential Revision: D34463674

fbshipit-source-id: b5e5dfcdf2bd36e0e00c6a1b814fafbc6a6d59cc
2022-02-28 10:14:34 -08:00
Durham Goode
587cf76621 tests: fix test-casefolding.t
Summary:
My recent change to updating from the null commit changed the output
here on case insensitive filesystems. Let's update the test.

Reviewed By: singhsrb

Differential Revision: D34524860

fbshipit-source-id: cad48971d17da06abfaa5c12922f66b30ce84faf
2022-02-28 09:38:21 -08:00
Simon Farnsworth
ccc7e49048 Document the various bits of caching_ext
Summary: This was undocumented, but you needed to understand it to use `caching_ext`. Document it

Reviewed By: yancouto

Differential Revision: D34519857

fbshipit-source-id: 56bf089ac0997d6310290985eaa470994368d9f9
2022-02-28 05:57:44 -08:00
Durham Goode
91c3b330c3 edenapi: remove files1 usage
Summary:
All clients should be using files2 now, so let's delete the files1 code
path.

Reviewed By: quark-zju

Differential Revision: D34346264

fbshipit-source-id: 86f32237f84ad5521d2f660f10e1000e588187e5
2022-02-25 18:01:42 -08:00
Xavier Deguillard
4fdfbd69c5 cli_rs: fix clap 3.1 warnings
Summary: A large number of things got deprecated, let's follow the recommendations.

Reviewed By: zertosh

Differential Revision: D34467979

fbshipit-source-id: fba2a95c1e4a0de73100cf7f97541ac604b1cdb1
2022-02-25 16:43:44 -08:00
Xavier Deguillard
7120d3f267 minitop: fix is_running on Windows
Summary:
On Windows, /proc doesn't exist, let's use sysinfo to collect all processes and
test if they are running.

Reviewed By: zertosh

Differential Revision: D34467978

fbshipit-source-id: d90e8bca7770d2226891bedb02313cd76092d4f4
2022-02-25 16:43:44 -08:00
Xavier Deguillard
2217f3b6a2 service: replace getNullContextWithCauseDetail by thrift fetch context
Summary:
We can directly use the thrift fetch context instead of building a null
context.

Reviewed By: chadaustin

Differential Revision: D34487575

fbshipit-source-id: 15c2fe9167b392d436638e882f4f8aaabebe4662
2022-02-25 16:19:29 -08:00
Durham Goode
851d5a12fc checkout: do force checkouts for clones
Summary:
Users frequently get into states where a clone fails and leaves a bunch
of pending changes. We have some logic to detect this and resume the checkout,
but they can still hit issues due to these files and end up having to hg purge
and start again. I just hit this when my machine rebooted and many of the files
that had been written ended up as empty, and therefore considered a conflict.

Let's just make clone checkouts be force checkouts. This not only prevents the
user from getting blocked, but also skips a ton of "check unknown" and "check
conflict" logic, which also bypasses the need to run status and wait for
watchman.

Differential Revision: D34323008

fbshipit-source-id: 5d49a8c645282d17694dbb726c70e8a8d7c66a58
2022-02-25 14:09:21 -08:00
Durham Goode
a903b0d2c7 vfs: read symlink link instead of symlink target content
Summary:
The nativecheckout resume feature was failing when a symlink had been
written because the "is it up-to-date" check compared the expected link path
with the contents of the file at the link target.

Let's change vfs::read() to return the symlink link instead of the content, as
that is what Mercurial wants. I can't think of any case where Mercurial ever
wants to read through to the symlink target.

This does add the overhead of a stat call to each read.

Differential Revision: D34314987

fbshipit-source-id: 676647a16f65fa516d6ef97e21d137a1ae137b3f
2022-02-25 14:09:21 -08:00
Durham Goode
95db630f9f nativecheckout: only filter actions once
Summary:
When resuming a checkout we need to go over all the actions and check
if they match the contents on disk. In the old code we did this twice, once when
checking unknown files and once when doing the actual checkout. When the number
of files to check was large, like when resuming a large clone, this was
extremely slow (i.e. many minutes).

Let's only do it once.

Differential Revision: D34314688

fbshipit-source-id: 848dc4e76cb72f173741a9061bd8c71d7120a4bc
2022-02-25 14:09:21 -08:00
Durham Goode
510ed336ce fsmonitor: improve progress bars
Summary:
Previously the "Querying watchman" progress bar covered a bunch of
stuff. I noticed it was hanging a lot when resuming clones. Let's break it into
smaller progress bars.

Differential Revision: D34290594

fbshipit-source-id: 69995f2637c4062062f352e73fdecf30599f9f11
2022-02-25 14:09:21 -08:00
Durham Goode
fef979f959 lfs: expand retries to match edenapi
Summary:
LFS and edenapi have different retry logic. Right now LFS doesn't retry for TLS errors or for a number of Http errors. Let's update LFS to match edenapi's more generous retry philosophy.

This should address TLS RecvError's I was seeing during large clones.

Differential Revision: D34290595

fbshipit-source-id: bcd071eee9cd2496e03380d686fcda4947f02a19
2022-02-25 14:09:21 -08:00
Durham Goode
7b0df5a3e2 status: add progress bar for non-watchman status
Summary:
When resuming a clone, watchman may not be enabled since there is no
.watchmanconfig. Therefore status calls may use the default Python file system
walking code. This currently has no progress bar, so it appears like a hang.

Let's add a progress bar.

Reviewed By: quark-zju

Differential Revision: D34278706

fbshipit-source-id: 425a1c1dadd9ffa68a868766e51c5877b9345562
2022-02-25 14:09:21 -08:00
Durham Goode
7b97187f3e nativecheckout: only check for actually unknown files
Summary:
The old native checkout check_unknown logic would iterate over every
new file action and check if the file exists. This can be expensive because 1)
it stats every path, even though most will not exist, and 2) the stat goes
through the path auditor, which stats each parent directory as well.

For initial clones where there are no files on disk already, this isn't too bad,
since the top level directories aren't present so the path auditor aborts early.
When resuming a partially completed checkout however, this can be quite slow
(multiple minutes) since some directories already exist and therefore the
path auditing becomes much more expensive.

We have to run status anyway for the checkout, so let's go ahead and run it
earlier and use its results to only check the actual unknown files. This makes
the check O(unknown files) instead of O(total files to be written).
Additionally, the list of unknown files should be reduced since a resumed
checkout will remove already-written files from the list of files to be checked.
So really this is O(unknown files that differ from what's expected).

Differential Revision: D34278256

fbshipit-source-id: 39ad20387ad2622695864608c7033aefa1eb0df1
2022-02-25 14:09:21 -08:00
Durham Goode
bab3e49911 scmstore: remove use of other errors in edenapi fetch
Summary:
All errors coming from scmstore fetches should be associated with the
input keys. Let's get rid of the use of other_error in the edenapi fetch path.

Differential Revision: D34257932

fbshipit-source-id: 176ee1fd767df76c8ce6140ddf849a64b3cb3621
2022-02-25 14:09:21 -08:00
Durham Goode
caf592d1fa scmstore: annotate lfs other errors as invalid
Summary:
LFS fetch errors are reported via sha256, and in theory we should have
a Key for every sha256, so we can log keyed rrors all the time. Let's annotate
the non-keyed errors as invalid.

Eventually we'll come back and remove other errors entirely, once we can confirm
this is never hit.

Differential Revision: D34256994

fbshipit-source-id: b00db226d8ef1f222a345f0388c3cb2a5773e008
2022-02-25 14:09:21 -08:00
Durham Goode
82c314b62e scmstore: report top level errors as keyed errors
Summary:
Every error from an scmstore fetch should be associated with an input
key. As part of doing that, let's change top level lfs failures (i.e. '?' calls
inside the lfs fetch logic) to be associated with all keys being fetched.

Differential Revision: D34256261

fbshipit-source-id: b0df6ee4e653e264a4ee1954828a841bccdbb2ee
2022-02-25 14:09:21 -08:00
Durham Goode
84ec3761f8 scmstore: inject an "unknown fetch error" in scmstore
Summary:
We are seeing fetch failures with empty error lists ("[]"). This should
never happen.  Every error should be attributable to an edenapi or a lfs server
fetch failure. There is a clear code path in scmstore that adds an empty error
list if we don't have an error. Let's make this explicitly call out that it's an
unknown error, so we can track these errors down in the future.

Reviewed By: quark-zju

Differential Revision: D34254835

fbshipit-source-id: baa46d641d9b951b1563ac643517dcef15efa4bc
2022-02-25 14:09:21 -08:00
Xavier Deguillard
f3177fd513 cli_rs: upgrade to the latest sysinfo
Reviewed By: zertosh

Differential Revision: D34466126

fbshipit-source-id: a335cf8118f37b9c86856dda24f4349fe62f2d0e
2022-02-25 14:06:20 -08:00
Eli Lipsitz
829aee36fc physicalfilesystem: fix incorrect logic leading to duplicate path lookups
Summary:
This diff fixes some incorrect logic in the physicalfilesystem pendingchanges Rust code that leads to duplicate entries in the "lookup" list (files that need to have their contents checked to know whether they're dirty). We need to fix this, otherwise we'll do 2x the number of (potentially expensive) checks, and we'll need to deduplicate later anyway.

I believe this bug was originally introduced in D25697099 (02606da6c5) -- the change to this region of the code changes the behavior. I believe this was just an oversight when the code was refactored, since the change doesn't have anything to do with the purpose of the diff.

Reviewed By: DurhamG

Differential Revision: D34403900

fbshipit-source-id: 4c38e6a0ba46dfefc8f7ba327b943cb7ccee7fc5
2022-02-25 13:38:22 -08:00
Chad Austin
11cf537c45 allow building some integration test scaffolding on macOS
Summary:
Some of EdenFS's integration test functionality can build on macOS, so
implement the required tweaks.

Reviewed By: kmancini

Differential Revision: D34291419

fbshipit-source-id: 296f077f4a3311d7fc8f04ed705fd06019e34212
2022-02-25 13:32:21 -08:00
Muir Manders
c0c35b59cc hg-http: fix "files" progress bar consolidation
Summary: Also check for new /files2 endpoint.

Reviewed By: quark-zju

Differential Revision: D34423002

fbshipit-source-id: 409435633e8f776729d25ebf05342020f423b828
2022-02-25 08:51:52 -08:00
Simon Farnsworth
b92075d5e8 Use mutable renames in the commit diff method
Summary: If you give us paths of interest, and ask us to follow mutable rename information, let's do it.

Reviewed By: yancouto

Differential Revision: D34302823

fbshipit-source-id: 647fa2d798436f7a0beb1741570cb280aae2814b
2022-02-25 04:19:24 -08:00
Muir Manders
6adffd6ccf deflake test-lfs.t
Summary: Tweak "grep lfs" pattern to not match an "lfs" that shows up in tempdir name.

Reviewed By: quark-zju

Differential Revision: D34399625

fbshipit-source-id: 1122d0be4e11f32ed9cf33c046ccf34a99f5cdc3
2022-02-24 10:01:01 -08:00
Yan Soares Couto
b128c54403 Fix build failure due to clap deprecations
Summary: Build is failing right now because of deprecation warning.

Reviewed By: mitrandir77, mzr

Differential Revision: D34449857

fbshipit-source-id: 70b7d871ef68995dd3d90a49c1f4af27613550b4
2022-02-24 09:30:12 -08:00
Yan Soares Couto
97c7321992 snapshot: do not print commit cloud output on plain mode
Summary:
Right now, when we create a snapshot on top of a commit that's not on commit cloud, we output things like `queue 0 files for upload` even when we are on plain mode, in which we'd like to only output the hash of the snapshot.

So I made it so the ui is quiet when on plain mode, which makes it not print that.

Reviewed By: quark-zju

Differential Revision: D34378357

fbshipit-source-id: 69b17147b8e72c6d72176f6069d729689130fdc9
2022-02-24 09:02:49 -08:00
CodemodService Bot
bdb2c655a7 Daily common/rust/cargo_from_buck/bin/autocargo
Reviewed By: krallin

Differential Revision: D34443233

fbshipit-source-id: e3920248051cd0f9ba1707574fdafe121655aae8
2022-02-24 01:42:53 -08:00
Xavier Deguillard
79881bd2d7 minitop: rename TOP PID column to PID
Summary: The TOP here feels unecessary, let's remove it.

Reviewed By: fanzeyi

Differential Revision: D34434160

fbshipit-source-id: b8fa901d649694742db7f0b61c3923e9bce3274d
2022-02-23 19:22:58 -08:00
Xavier Deguillard
bbb35cb4d0 minitop: allow quitting with 'q'
Summary:
Once minitop gains more and more functionality and becomes more interactive,
we'll want an easy way to quit, use 'q' for that. Since we're also in raw mode,
also add back the ability to quit with ctrl+c

Reviewed By: fanzeyi

Differential Revision: D34322721

fbshipit-source-id: 9f92d283d98a8d9d974f773156a0962936983f15
2022-02-23 19:22:58 -08:00
Xavier Deguillard
77761bf878 minitop: use cursor movement instead of \n
Summary:
With the terminal in raw mode, we need to use curor movement instead of \n for
new lines.

Reviewed By: genevievehelsel

Differential Revision: D34349787

fbshipit-source-id: a6e81100ba5fa8e568ddf89d3f72c524c7c0b103
2022-02-23 19:22:58 -08:00
Xavier Deguillard
bafa556536 minitop: enter raw mode
Summary:
Raw mode allows for capturing input without it being echoed. It however
unfortunately means that \n no longer works correctly and thus printing will
need to be done line by line.

Reviewed By: genevievehelsel

Differential Revision: D34349788

fbshipit-source-id: 0f9362121ee2a40134d711ce56002347c95d0430
2022-02-23 19:22:58 -08:00
Xavier Deguillard
b667e1e479 minitop: make sure to restore terminal state
Summary:
Once minitop returns, we need to make sure that the terminal state is restored
to its old state. Use an RAII object to make sure that we always restore the
state that was set even in the error cases.

Reviewed By: genevievehelsel

Differential Revision: D34326731

fbshipit-source-id: b5d09988c92b7f469a8f311b106dd28f63ba69f1
2022-02-23 19:22:58 -08:00
Xavier Deguillard
c003d930b1 minitop: add a simple interactive mode
Summary:
The interactive mode will redraw on top of the previous update, instead of
scrolling.

Reviewed By: kmancini

Differential Revision: D34326732

fbshipit-source-id: 9c2afd207d51ca4e8bb70c6943e6d620fa8fc1d3
2022-02-23 19:22:58 -08:00
Xavier Deguillard
d57c4943c6 config: make hg:use-aux-metadata the default
Summary:
This has been turned on everywhere, time to set it to the default, so we can
then clean up the code.

Reviewed By: kmancini

Differential Revision: D34422426

fbshipit-source-id: 1d72a9d1bdbb162a4e1c9b69dbbe5aa4855f4f26
2022-02-23 13:34:52 -08:00
Andres Suarez
43b2854556 Update clap to 3.1.2
Reviewed By: Imxset21

Differential Revision: D34417902

fbshipit-source-id: ec5d88a994e683b63f99b7a6a692fdbcc2a18be8
2022-02-23 12:08:59 -08:00
Ilia Medianikov
3b0a4165de mononoke: set rewritedates: false to fix flakiness in save_mapping_pushrebase_hook test
Summary:
The test tries to pushrebase the same commit onto two different bookmarks that are pointing to the same commit. In pushrebase by default we override `author_date` with current timestamp, so the test can [fail](https://fburl.com/sandcastle/5255yczk) if those pushrebases happen in different seconds (result hashes will differ).

Let's fix this by passing `rewritedates: false` pushrebase flag.

Differential Revision: D34416859

fbshipit-source-id: 59a258dc7536833ade8c64c1745e364ee94f6a57
2022-02-23 09:22:44 -08:00
CodemodService Bot
8805ea6627 ThriftSetter_eden
Reviewed By: xavierd

Differential Revision: D34414565

fbshipit-source-id: 8f31d8f3d0617e360ecaa102b99ac5d3269e0104
2022-02-23 09:22:43 -08:00
Jan Mazur
9eb31562d7 remove wireproto logging used in traffic replay
Summary:
Traffic replay is gone. Now we can delete code that dumped wireproto traffic.

The logging that's left could be still somewhat useful: https://fburl.com/scuba/mononoke_test_perf/uismnrv9

Reviewed By: HarveyHunt

Differential Revision: D33898167

fbshipit-source-id: f5f12f3626c578ef90db99a45e5749fe8a94049f
2022-02-23 07:23:02 -08:00
Deepak Kar
3da8287a17 Update SQLBlob GC to use latest version of CLI Framework ( clap )
Summary: Update SQLBlob GC to use latest version of  CLI Framework ( clap )

Reviewed By: yancouto

Differential Revision: D34299715

fbshipit-source-id: 9ae44088b54ff7b73548e5db795f4a3263c93dcb
2022-02-23 06:22:53 -08:00
Rajiv Sharma
db48df4e51 tools/admin: implement skiplist subcommand
Summary:
This diff includes the following changes:
1. Added a new admin command in commands.rs.
2. Added skiplist.rs for the primary skiplist command in newadmin and build.rs and read.rs for providing building and reading functionalities as subcommands.
3. Added integration test for newadmin skiplist.
4. Updated AdminRepo to include ChangesetFetcher and Changesets.
5. Updated test-backfill-derived-data-tail.t integration test to use newadmin skiplist instead of oldadmin skiplist.
6. Updated TARGETS file to pull the necessary dependencies.

Reviewed By: yancouto

Differential Revision: D34381835

fbshipit-source-id: 24a4f4ee27025f398f446114d9f2d92051c24e06
2022-02-23 06:22:53 -08:00
Yan Soares Couto
431c10b02d Fix typo in dependencies macro
Summary: This a typo in the macro, which is trying to reference itself but fails. We haven't seen this before because we never used it with more than one argument, but when I tried it failed.

Reviewed By: Croohand

Differential Revision: D34391157

fbshipit-source-id: eb2f2704deac39b4d5f8d537fae75785b77eee5f
2022-02-22 13:23:03 -08:00
Jun Wu
b2b84f5935 add a stronger test about lazy changelog pull with mismatched heads
Summary:
Test multiple lazy changelog endpoints - pull, commit->location,
location->commit when the client and server have diveraged "main branch" config.

Reviewed By: farnz

Differential Revision: D34276252

fbshipit-source-id: 5ac323387fab509e8832cb5448fa80bb74fd8ca5
2022-02-22 13:23:03 -08:00
CodemodService Bot
e2f7ae0434 Daily common/rust/cargo_from_buck/bin/autocargo
Reviewed By: krallin

Differential Revision: D34384439

fbshipit-source-id: 7723941337326fee007776aa4503fd6837e56b78
2022-02-22 01:23:00 -08:00
Yan Soares Couto
ebaf85e1d8 Support logging commit cloud commits uploaded via edenapi to scribe
Summary:
markbt noticed some commit cloud commits weren't being logged to the scribe category. This is because the EdenApi path to create changesets doesn't do the logging.

This diff makes sure we also do the logging in that case.

Ideally, we'd have an unified place to create changesets, be it from hg changesets, git, or from raw data, but that needs a lot more refactoring and it's riskier.

Reviewed By: markbt

Differential Revision: D34146757

fbshipit-source-id: e82f14e1be6c598f89722b68c20cd6fc572633e0
2022-02-21 10:22:27 -08:00
Yan Soares Couto
5044acfe04 Extract scribe log logic from create_changeset
Summary:
This does some changes to scribe logging logic:

Move it from `bookmarks_movement` to `blobrepo`. Being in `bookmarks_movement` was wrong, as it doesn't only happen in that case. `blobrepo` is not ideal but it's better, as it's close to where we save changesets, which is more or less when this happens.

This is done so the next diff can reuse more of the logging logic without having to duplicate code.

Reviewed By: markbt

Differential Revision: D34145742

fbshipit-source-id: 1dfb94775ea60e4b83412ae80f5c6d3f5e65d952
2022-02-21 10:22:26 -08:00
Yan Soares Couto
f33164d5ab On tests, serialize hash maps in order
Summary:
This makes it so HashMaps are serialized in a consistent way in tests (on this crate), which is good because it prevents flakiness.

It also does so at no cost to non-test execution.

Reviewed By: markbt

Differential Revision: D34339601

fbshipit-source-id: e9ec1cb74308f83fb1a346c68f646dfa12021098
2022-02-21 08:23:03 -08:00
Ilia Medianikov
0fc14b00e5 verify_integrity: remove Mononoke tunable related to Rust client rollout
Summary: Cleaning up after verify_integrity rollout that switched from Python to Rust client. The rollout switch just appended "_rust" to the binary path.

Reviewed By: yancouto

Differential Revision: D34110979

fbshipit-source-id: 2d7c7d2b00b57626fc3c4f8d23859f520afabdf0
2022-02-21 08:23:03 -08:00
Ilia Medianikov
17c1384773 segmented_changelog/tailer: set update period to 45 seconds
Reviewed By: farnz

Differential Revision: D34271660

fbshipit-source-id: 5aaab1b31ec5bdfd67b35702a991e0403eff4953
2022-02-21 06:23:07 -08:00
Alex Hornby
5056cc1288 mononoke: README.md update
Summary:
Removed the line where we say Mononoke doesn't build, as it does!

Added links to the few .md docs that Mononoke has in repo

Reviewed By: mzr

Differential Revision: D34373614

fbshipit-source-id: 1bec3f4cf4ed158e4698b02a871d1b41d236cd1f
2022-02-21 02:23:21 -08:00
Jan Mazur
61cc77b16c patched mysql_async v0.27.1 with features passed to mio (#24)
Summary:
Pull Request resolved: https://github.com/facebook/fb303/pull/24

Pull Request resolved: https://github.com/facebookexperimental/eden/pull/114

Pull Request resolved: https://github.com/facebookexperimental/rust-shed/pull/30

mysql_async 0.27.1 by itself doesn't enable necessary features on mio. Let's add it as a dummy dependency so we can enable these features manually.
This results in edenfs, eden_scm and mononoke builds fail on GH:

https://github.com/facebookexperimental/eden/runs/5221114887?check_suite_focus=true
https://github.com/facebookexperimental/eden/runs/5221114892?check_suite_focus=true
https://github.com/facebookexperimental/eden/runs/5221114891?check_suite_focus=true
https://github.com/facebookexperimental/eden/runs/5221114960?check_suite_focus=true

Reviewed By: ahornby

Differential Revision: D34309906

fbshipit-source-id: 14b4cae6028a2c065400eb7bc6aec657b1b87de2
2022-02-20 15:22:57 -08:00
Xavier Deguillard
431eb80ade doctor: always subclass Problem
Summary:
While user report of Problem works just fine, telemetry report it as just a
Problem, and it's impossible to figure out which problem it refers to. Let's
force every usage of Problem to instantiate their own class.

Reviewed By: chadaustin

Differential Revision: D34352742

fbshipit-source-id: 30713d64ed5f72bc098e5531075a2f1aef504654
2022-02-18 16:22:55 -08:00
Katie Mancini
19e5072be0 show stack traces of edenfs process in eden rage
Summary:
Prints the output of `sample $edenfs_process_id` in `eden rage`.

On linux we can use `ps f` to see the process hierarchy we want to have similar
information on macOS. We would also like to have info on the state of the
threads, since we can not log into their machine and look for our selves this
would be a good thing to have in the rage.  This give us visibility into eden to
see where the problem might be when there is a rage particularly if/where eden
is hanging.

Reviewed By: xavierd

Differential Revision: D16745028

fbshipit-source-id: 8dcbc1d80b45c3ebe4d065f445f56800104dbd25
2022-02-18 16:22:55 -08:00
Xavier Deguillard
7dcc7e7d1c cli_rs: silence a warning
Summary:
AppSettings::DisableHelpFlags has been renamed AppSettings::DisableHelpFlag,
and the compiler warns about it.

Reviewed By: fanzeyi

Differential Revision: D34322930

fbshipit-source-id: e376b3ec71fb05a4001b7abe870e16d5e2e55203
2022-02-18 14:23:28 -08:00
Xavier Deguillard
40264ca51f rage: make several rage available on Windows
Summary: All of these are now available on Windows, thus we do not need to exclude them.

Reviewed By: kmancini

Differential Revision: D34259777

fbshipit-source-id: d7978665cce54e0b8e86424a82cfa13ce51fd947
2022-02-18 11:23:40 -08:00
Xavier Deguillard
f58af745bd cli: add timeout on thrift clients
Summary:
All of these are called during `eden rage`, and since we want `eden rage` to
never hang if EdenFS is hanging, let's add small timeouts for these.

Reviewed By: fanzeyi

Differential Revision: D34317837

fbshipit-source-id: a0537fe6edf912f5e0f946ce233ecef9e146c96c
2022-02-18 11:23:39 -08:00
Xavier Deguillard
f331622169 windows_thrift: make sure to call settimeout
Summary:
The TSocket.setTimeout in EdenFS is always called before calling open. What
this means is that settimeout is never called on the WindowsSocketHandle
object. In TSocket.open, settimeout is called right before trying the
connection, we should be doing that too.

Reviewed By: fanzeyi

Differential Revision: D34317838

fbshipit-source-id: b89dafdf84d418ec5f7be6acec25ea0e94a0ad52
2022-02-18 10:22:55 -08:00
Xavier Deguillard
00a924a2b5 py: raise a TimeoutError instead of using socket.timeout
Summary:
The latter is deprecated, and since this file doesn't import socket, this code
simply doesn't run.

Reviewed By: fanzeyi

Differential Revision: D34317839

fbshipit-source-id: 91baf5750153f7251385ec676edcd82dd5c331be
2022-02-18 10:22:55 -08:00
Xavier Deguillard
48473ab389 minitop: use queue! instead of execute!
Summary:
The crossterm documentation states that queue! is more efficient due to needing
less system calls. Let's use it.

Reviewed By: fanzeyi

Differential Revision: D34322722

fbshipit-source-id: b158f86bfc58fd7efac118c27b297bc37f9fd36c
2022-02-18 10:22:55 -08:00
Katie Mancini
2bf7198b74 fix stale inode unload crash
Summary:
In forgetStaleInodes we are checking for unlinked unloaded inodes and
de-referencing them. The dereferencing is happening inline with where we
are iterating through unloaded inodes.

This is causing us to invalidate an iterator that we are using. Which causes
a use after free.

let's collect the inode number of inodes to de-reference and de-reference them
after we finish iterating.

Reviewed By: xavierd

Differential Revision: D34315130

fbshipit-source-id: b390959bd26edf1545e900f0e5f72fc1885efa3a
2022-02-18 09:23:08 -08:00
Katie Mancini
e11d86e362 include macOS archetecture in rage
Summary:
Since MacOS now has multiple architectures, and those architectures
can have different versions of things deployed, this might be pertinent in
investigating issues.

let's include which architecture we are running on in rage.

Reviewed By: fanzeyi

Differential Revision: D34319322

fbshipit-source-id: d5e3308b74f982b79e124400b85340951d626bce
2022-02-18 09:05:35 -08:00
Mark Juggurnauth-Thomas
adc7a4cdff mononoke_api: use lazyshared for context shared futures
Summary:
The shared futures stored within the mononoke API contexts are not cheap to
instantiate, and since they are not always used, we are paying an unnecessary
overhead.  Migrate them to `LazyShared` so that they are initialized lazily.

Reviewed By: yancouto

Differential Revision: D34198428

fbshipit-source-id: bfb491437edfc76a707d523905cd984933f037ed
2022-02-18 07:06:21 -08:00
Mark Juggurnauth-Thomas
ea7f14f55b scs_server: implement commit_path_last_changed
Summary:
Implement a new method pair for the Source Control Service:
`commit_path_last_changed` and `commit_multiple_path_last_changed`.

These methods return the last commit that changed a path for one or more paths
in a commit.  If something exists at that path, this will be the last commit to
modify a file at that path or a file in a directory at that path.  If nothing
exists at that path now, but something previously existed, then this will be
the commit that deleted the file or directory at that path.

Similar to the other `commit_multiple_path` method,
`commit_multiple_path_last_changed` does not return entries for paths that never
existed.  This is done because efficient manifest traversal prunes these paths
before they are reached.

Reviewed By: yancouto

Differential Revision: D34047425

fbshipit-source-id: 4290e3193aa7834e6d44c90eb4b2626d580b43ae
2022-02-18 07:06:21 -08:00
Yan Soares Couto
9e7f1ac446 Symlinks work outside repo root
Summary: This fixes a bug when snapshots with symlinks don't restore well when doing the operation from outside of the repo root. This happened because we were careful about relative paths on the normal file create codepath, but not on the snapshot codepath.

Differential Revision: D34302718

fbshipit-source-id: a8b06fb8a52e53c99735840fdbf5f3c74512a0c9
2022-02-18 04:08:21 -08:00