Commit Graph

3640 Commits

Author SHA1 Message Date
Thomas Orozco
22e700ccf3 (reland) rust/third-party: update to futures 0.3.28
Summary:
Note: this is a re-land of D44623815, which was was reverted because of a land race with D44626072

In particular this fixes `FlattenUnordered` having a nasty deadlock, but also
some other  bugs:

```
# 0.3.28 - 2023-03-30

* Update to syn 2. This raises MSRV of utility crates to 1.56. (#2730, #2733)
* Fix bug in `FlattenUnordered` (#2726, #2728)

# 0.3.27 - 2023-03-11

* Add `TryFlattenUnordered` (#2577, #2590, #2606, #2607)
* Add `AbortHandle::is_aborted` (#2710)
* Add `AbortRegistration::handle` (#2712)
* Make `BiLock` strict-provenance compatible (#2716)

# 0.3.26 - 2023-01-30

* Add `Either::as_pin_mut` and `Either::as_pin_ref` (#2691)
* Add `Shared::ptr_eq` and `Shared::ptr_hash` (#2691)
* Implement `FusedStream` for `Buffered` (#2676)
* Implement `FusedStream` for all streams in `ReadyChunks` (#2693)
* Fix bug in `FuturesOrdered::push_front` (#2664)
* Remove `Fut::Output: Clone` bounds from some `Shared` methods (#2662)
* Remove `T: Debug` bounds from `Debug` implementations of `mpsc` and `oneshot` types (#2666, #2667)

# 0.3.25 - 2022-10-20

* Fix soundness issue in `join!` and `try_join!` macros (#2649)
* Implement `Clone` for `sink::Drain` (#2650)

# 0.3.24 - 2022-08-29

* Fix incorrect termination of `select_with_strategy` streams (#2635)

# 0.3.23 - 2022-08-14

* Work around MSRV increase due to a cargo bug.
```

Reviewed By: zertosh

Differential Revision: D44632588

fbshipit-source-id: bdd87cb02b3aef63a65b1f9b852579225adfedbd
2023-04-04 10:14:43 -07:00
Mark Isaacson
3463e3d61b Revert D44623815: rust/third-party: update to futures 0.3.28
Differential Revision:
D44623815

Original commit changeset: 343ddb9277e1

Original Phabricator Diff: D44623815

fbshipit-source-id: 2d99e8d24fd9b13343dfeb082788b0a6258fbe8c
2023-04-03 09:25:13 -07:00
Thomas Orozco
159cf5c5e6 rust/third-party: update to futures 0.3.28
Summary:
In particular this fixes `FlattenUnordered` having a nasty deadlock, but also
some other  bugs:

```
# 0.3.28 - 2023-03-30

* Update to syn 2. This raises MSRV of utility crates to 1.56. (#2730, #2733)
* Fix bug in `FlattenUnordered` (#2726, #2728)

# 0.3.27 - 2023-03-11

* Add `TryFlattenUnordered` (#2577, #2590, #2606, #2607)
* Add `AbortHandle::is_aborted` (#2710)
* Add `AbortRegistration::handle` (#2712)
* Make `BiLock` strict-provenance compatible (#2716)

# 0.3.26 - 2023-01-30

* Add `Either::as_pin_mut` and `Either::as_pin_ref` (#2691)
* Add `Shared::ptr_eq` and `Shared::ptr_hash` (#2691)
* Implement `FusedStream` for `Buffered` (#2676)
* Implement `FusedStream` for all streams in `ReadyChunks` (#2693)
* Fix bug in `FuturesOrdered::push_front` (#2664)
* Remove `Fut::Output: Clone` bounds from some `Shared` methods (#2662)
* Remove `T: Debug` bounds from `Debug` implementations of `mpsc` and `oneshot` types (#2666, #2667)

# 0.3.25 - 2022-10-20

* Fix soundness issue in `join!` and `try_join!` macros (#2649)
* Implement `Clone` for `sink::Drain` (#2650)

# 0.3.24 - 2022-08-29

* Fix incorrect termination of `select_with_strategy` streams (#2635)

# 0.3.23 - 2022-08-14

* Work around MSRV increase due to a cargo bug.
```

Reviewed By: zertosh

Differential Revision: D44623815

fbshipit-source-id: 343ddb9277e1703104e516d07fe0610b5020930a
2023-04-03 08:30:49 -07:00
David Tolnay
b16ffe2361 Unfork and update reqwest
Reviewed By: zertosh

Differential Revision: D44556211

fbshipit-source-id: 4a4b924163db5270f956aff58e0e2087d115715c
2023-03-30 18:48:13 -07:00
Andres Suarez
c50f383869 Update tempfile from 3.4 to 3.5
Reviewed By: quark-zju

Differential Revision: D44524245

fbshipit-source-id: 167471d01b0afbbc34ced88574dbfb09799aadf6
2023-03-30 17:11:37 -07:00
Zeyi (Rice) Fan
f212c09b54 show commit message in zsh completion
Summary: Commit messages in ZSH completion!

Reviewed By: quark-zju

Differential Revision: D44515578

fbshipit-source-id: dc651d5a391ffa8503ec9514c8ff92227d08a26e
2023-03-30 13:28:39 -07:00
Muir Manders
3215b15fd5 status: treat symlinks as regular files when unsupported
Summary: Tweak Rust status code to explicitly treat symlinks as regular files if the VFS doesn't support symlinks. This fixes weirdness where they were previously considered "untrackable" and wouldn't show up at all in "hg status".

Reviewed By: sggutier, zzl0

Differential Revision: D44521987

fbshipit-source-id: 8944ab115635268c997e5cb443d870b71c353f83
2023-03-29 17:02:41 -07:00
generatedunixname89002005325677
d73aed440b Daily arc lint --take RUSTFMT
Differential Revision: D44494810

fbshipit-source-id: 3a4c5c76d0e8c498315337415896f48a9f229ceb
2023-03-29 09:19:36 -07:00
Saul Gutierrez
e92be900f8 symlinks: make eagerepo aware of Windows symlink option
Summary: Recently we added the `experimental.windows-symlinks` config to make repos initialized with that config add `windowssymlinks` to the working copy requirements. That, however, didn't apply to the `eagerrepo`. This meant that tests initializing repos using eagerrepo would not have this behavior, which made writing `.t` tests expecting that in the requirements somewhat awkward.

Reviewed By: quark-zju

Differential Revision: D44444534

fbshipit-source-id: def5c30267aa91bf6d2a72514644538285f80b8b
2023-03-28 19:02:07 -07:00
Saul Gutierrez
1a6ec2a008 eagerepo: make eagerrepo aware of configs when creating a repo
Summary: It could be useful to make `eagerrepo` to take in a config option so that it could set in certain values on the working repo or in the backing store requirements. For instance, we might want to make `eagerrepo` able to set Windows symlinks.

Reviewed By: quark-zju

Differential Revision: D44465174

fbshipit-source-id: 122f2428dcaa2e866fa7d7774e12dee2b3fe5eee
2023-03-28 19:02:07 -07:00
Zhaolong Zhu
dd514e6692 copytrace: make read_renamed_metadata API async
Summary:
Our current practice is only using `block_on` in Python bindings, so this diff is to change the `read_rename_metadata` to an Async function and also remove the `block_on`s in its implementations, so it is consistent with other APIs.

In the longterm, we'd like to remove those Async APIs, but we will to use a lib to help us migrate them in an automatic way, consistent APIs will make the migration process eaiser.

Reviewed By: quark-zju

Differential Revision: D44199939

fbshipit-source-id: a75d1356e373f3d883da4ab972520a665587eb23
2023-03-28 13:28:54 -07:00
Zhaolong Zhu
a6daf1870c pycopytrace: add python binding for copytrace
Summary: Python binding for copytrace, so it can be used in Python world

Reviewed By: quark-zju

Differential Revision: D44152527

fbshipit-source-id: 233986efddb855188ce9ada6cace70a57f834b9c
2023-03-28 13:28:54 -07:00
Zhaolong Zhu
d9a17dd507 copytrace: update DagCopyTrace::new
Summary: Fill the missing part of DagCopyTrace::new

Reviewed By: quark-zju

Differential Revision: D44110425

fbshipit-source-id: 32f9cfc949a56eb60d5589258ae6da87ea26cb5a
2023-03-28 13:28:54 -07:00
Zhaolong Zhu
f151ced705 copytrace: implement trace_rename API
Summary: trace_rename API will do forward search, backward search, or both based on the relationship of src and dst commits

Reviewed By: quark-zju

Differential Revision: D44106975

fbshipit-source-id: 69dc8c16cea32f060b94dd6306a346a2a953e0a4
2023-03-28 13:28:54 -07:00
Zhaolong Zhu
161fe3b48a copytrace: implement trace_rename_forward API
Summary:
This will be used for searching renames from `base` to `dst` commits

```
dst
 |
 | src
 | /
base
```

Reviewed By: quark-zju

Differential Revision: D44094783

fbshipit-source-id: 5943b5aa6bc9b1a22b75738749d934887475dd5e
2023-03-28 13:28:54 -07:00
Zhaolong Zhu
dc27514f4e copytrace: abstract reusable functions from trace_rename_backward
Summary:
refacotr the trace_rename_backward API, so that we can reuse the
common parts in trace_rename_forward API in the following diff

Reviewed By: quark-zju

Differential Revision: D44448494

fbshipit-source-id: 997a338c5f2e9e52d1d7bb3d54641980d9119797
2023-03-28 13:28:54 -07:00
Zhaolong Zhu
95e0240416 copytrace: implement trace_rename_backward API
Summary: This diff implements `trace_rename_backward` API

Reviewed By: quark-zju

Differential Revision: D44082134

fbshipit-source-id: e4df6256eba6993571284e5876efbf2ad6d7a26b
2023-03-28 13:28:54 -07:00
Jun Wu
dd2fc39ce7 nodeipc: initialize IPC before spawning threads
Summary:
The NodeIpc initialization logic might remove environment variables, which
might be unsafe for multi-thread process. Therefore let's explicitly initialize
it before spawning threads.

Reviewed By: muirdm

Differential Revision: D44439675

fbshipit-source-id: c0363e272f56632047d2eab035492f503a0315ef
2023-03-28 09:22:28 -07:00
Jun Wu
6afe2e6732 nodeipc: utility to communicate with nodejs via a side channel
Summary:
We want a way to report information (like what commits are changed to what
other commits) to ISL. This diff adds a way to communicate JSON values with
nodejs parent process using the `'ipc'` feature defined in nodejs stdlib.

This way, we can communicate using structured data instead of plain text, and
preserve the existing stdout/stderr (comparing to other solutions like
`rebase|metaedit -q -T '{nodechanges|json}'`).

Reviewed By: muirdm

Differential Revision: D44435528

fbshipit-source-id: e804a25a25dfff31c25b13b16f9bc86ab4e8306f
2023-03-28 09:22:28 -07:00
Muir Manders
26dafdfc70 status: fix dir-becomes-symlink detection (watchman)
Summary:
Use the "exists" field from watchman to detect when a file has been moved behind a symlink. Watchman reports it properly as not-exists, but if we naively vfs.metadata(path), it may appear to be unchanged.

I added another layer of Option<> to the file metadata so watchman fs can explicitly say "this file doesn't exist", as opposed to only "I don't have metadata".

The alternative approach is to "audit" paths before we lstat them, but that is slow and we want to avoid if possible.

Reviewed By: quark-zju

Differential Revision: D44187187

fbshipit-source-id: e24a43cbdb36d9aabf2b0b7ae0c4d2eab66394c4
2023-03-27 19:03:49 -07:00
Muir Manders
ee6e258244 status: use watchman metadata to avoid lstat() calls
Summary: Now the Rust status requests file mode, size and mtime from watchman and uses them for file comparison in lieu of lstatting the files. This way, if nothing has changed (think fresh instance), or if file size has changed, we don't need to hit the disk at all!

Reviewed By: quark-zju

Differential Revision: D44033614

fbshipit-source-id: 54cd8bd6dddd7fb88e9538d72174ae88b2118550
2023-03-27 19:03:49 -07:00
Muir Manders
d81ff485ca status: add failing test for watchman optimization
Summary: Add a test showing we fetch file metadata after watchmant tells us a file changed. I'm going to optimize this away buy querying and using watchman's file metadata.

Reviewed By: quark-zju

Differential Revision: D44033616

fbshipit-source-id: 8b098a5868e20283d2fc98b198c70c4b086b9657
2023-03-27 19:03:49 -07:00
Muir Manders
cd760409ef workingcopy: add a file metadata abstraction
Summary: Add a Metadata type to abstract across the various places we get file metadata from. This doesn't buy us much right now, but will allow us to easily inject file metadata from Watchman into our file comparison logic.

Reviewed By: quark-zju

Differential Revision: D44033617

fbshipit-source-id: ed08e44df9ff44bb23e8fff031d431c4a519eaa4
2023-03-27 19:03:49 -07:00
Muir Manders
0604dc8936 workingcopy: move HgModifiedTime to a new module
Summary: Going to be adding more "metadata" related stuff that depends on HgModifiedTime, so move this type first.

Reviewed By: quark-zju

Differential Revision: D44033613

fbshipit-source-id: 30c6173fc069fbb7553d6d9fffaea0fc774cb72f
2023-03-27 11:54:35 -07:00
Muir Manders
6ff1694cd5 status: add progress bar when updating treestate
Summary: This can take a few seconds if there are a ton of files (e.g. watchman fresh instance).

Reviewed By: quark-zju

Differential Revision: D44033611

fbshipit-source-id: 8e033eef68e2f4560b859d35f78da139f86abc97
2023-03-27 11:54:35 -07:00
Muir Manders
02dbee5d8d status: fix "comparing files" progress bar
Summary:
When using watchman, we show a progress bar as we compare the contents of files. Due to how the file detector works, this progress bar was staying at zero and suddenly jumping to the end. Fix by moving the progress bar into the ParallelDetector. I had to add a stupid method to the detector trait to set the total number of files.

I don't think the FileDetectorTrait is quite right. Ideally the user of the detector would own the progress bar. It would set "total" based on the work it has, and increment "position" as it receives results. However, currently you can't receive results until you have finished publishing work. We should tweak things to make this possible.

Reviewed By: quark-zju

Differential Revision: D44033612

fbshipit-source-id: a22b237eaf98f3bd55f5f79eccc3fe42e733a297
2023-03-27 11:54:35 -07:00
Muir Manders
9f970c188b status: show watchman crawl progress bar in rust
Summary:
While we are waiting for watchman to crawl the repo, call "debug-root-status" and pipe the file count into a progress bar.

The similar Python logic renders the "crawling" progress bar until the crawl is done and then proceeds with the query. In Rust I made it render the progress bar concurrently with the query. This should show the progress bar even if the repo has never been watched before (i.e. when there is no crawl until the query happens).

Reviewed By: quark-zju

Differential Revision: D44033615

fbshipit-source-id: 3c97fa7a63cd090b5ace82d7385f887e564eb9cf
2023-03-27 11:54:35 -07:00
Muir Manders
3f2ac5a8e1 workingcopy: skip root dir of nested repos in MultiWalker
Summary: The parallelized MutliWalker was skipping nested repo dot dirs (e.g. ".sl"), but wansn't skipping sibling files to the dot dir.

Reviewed By: quark-zju

Differential Revision: D43970586

fbshipit-source-id: 0cfd703a067f7db2087a6e692316eab192330b54
2023-03-27 11:54:35 -07:00
Muir Manders
83bb7745ef status: fix dir-becomes-symlink detection (non-watchman)
Summary:
Fix detection of a directory being replaced by a symlink. When the walker iterates tracked files not seen during the walk it now directly emits "deleted" events instead of going through the file detector. If tracked files had the same size and mtime "through" the symlink, the file detector's lstat() call would make it seem like there were no changes.

The alternative approach is to "audit" paths before we lstat them, but that is slow and we want to avoid if possible.

Reviewed By: quark-zju

Differential Revision: D44187186

fbshipit-source-id: 5678d6027b74283608bd0430e7acd3ae16cfb046
2023-03-27 11:54:35 -07:00
Muir Manders
f6c20c146d status: surface "invalid file type" errors
Summary: Show a warning about fifo etc. files instead of aborting the command.

Reviewed By: quark-zju

Differential Revision: D44187185

fbshipit-source-id: c4c01436ad21e4e15fcae9c5d04f1aaacc7e5c80
2023-03-27 11:54:35 -07:00
Muir Manders
744090a4f7 status: fix symlink dirty check
Summary:
The manifest stores a file as executable or symlink (mutually exclusive). A symlink on disk also has the executable bit(s) set, so the fs metadata (and by extension the mode in the dirstate) appears to be both symlink and executable. This is a recipe for confusion.

In Python it seems to work because the dirstate mode and fs mode both store the execute bit for symlinks, so they match when compared for executableness. (Although I wouldn't be surprised if they could get out of sync somehow.) The symlinkness check is achieved through the "flags" which does not include "x" if the file is "l".

Fix in Rust be applying the flags logic to the dirstate and fs metadata as well. In other words, if a file is a symlink, don't report it as executable. This makes the manifest file mode compare naturally with the dirstate and filesystem.

Reviewed By: quark-zju

Differential Revision: D43970590

fbshipit-source-id: b459e466dace5ee1c9cc7505d3c780be6ecd4685
2023-03-27 11:54:35 -07:00
Zhaolong Zhu
23277a24c2 edenapi: add debug info for edenapi configs
Summary: Add debug info for edenapi configs to verify if it load the static_system configs correctly

Reviewed By: quark-zju

Differential Revision: D44298145

fbshipit-source-id: 96efb86c4e96a945b7329ae1e9cba3fdf57a5128
2023-03-27 10:20:51 -07:00
Genevieve (Genna) Helsel
98208bd49c scmstore: add --local flag to debugscmstore
Summary: useful for checking if an object is in the hgcache or not

Reviewed By: quark-zju

Differential Revision: D44316641

fbshipit-source-id: f16093ec1659a8f139b88e702dbd1d8646319c8a
2023-03-25 16:19:06 -07:00
Muir Manders
c0dcb56428 dynamicconfig: bust cached config when vpnless config changes
Summary: Compare file mtimes so we synchronously regenerate dynamic config if the user has modified /etc/mercurial/vpnless. This way things will work off-VPN immediately after writing "1" to /etc/mercurial/vpnless.

Reviewed By: evangrayk

Differential Revision: D44263217

fbshipit-source-id: 1f09591336b7dc1294e1f21fafebce7962859d70
2023-03-23 22:17:29 -07:00
Muir Manders
2a8cae6908 dynamicconfig: support fetching remote config off VPN
Summary:
To support VPNless access, we need to fetch the remote config through x2pagentd, setting a CAT related header.

I tweaked the order of config loading so the remote config fetch has the system "auth_proxy.unix_socket_path" config setting available.

Reviewed By: quark-zju

Differential Revision: D44263216

fbshipit-source-id: 5b8e6c4c9c7a5ab22ecfcfa62a537623931a63bf
2023-03-23 22:17:29 -07:00
Jun Wu
ee0fb9448c pathhistory: do not use parents outside the requested set to skip segments
Summary:
Parents outside the requested set mislead PathHistory to skip a segment
incorrectly. Detect that and do not skip segment in this case.

Reviewed By: zzl0

Differential Revision: D44305349

fbshipit-source-id: 9c75c4f830e97ff0f54c992bef3ac3aa331edbe1
2023-03-22 11:49:24 -07:00
Jun Wu
eb8a75498f pathhistory: add ways to test PathHistory on a subset of commit graph
Summary:
Previously the pathhistory tests always use the entire commit graph to
initialize PathHistory. This diff adds a way to test it on a subset of
the commit graph.

Reviewed By: zzl0

Differential Revision: D44305350

fbshipit-source-id: 955af0243a89f4f6e8f13da970170021c51dafbf
2023-03-22 11:49:24 -07:00
Jeremy Fitzhardinge
0dc6076e71 third-party/rust: update tempfile to 3.4
Summary:
Removes need for patch.

It had already been updated to 3.4 but this just formalizes it.

Reviewed By: jasonwhite

Differential Revision: D44274378

fbshipit-source-id: d17ecbbee06c7df30f689eb859fb31fdf07d8d44
2023-03-21 15:25:59 -07:00
Saul Gutierrez
c07f393ced requirements: add requirements validation for all commands
Summary: Previously we had some requirements validation logic, but that was only available for Python commands. This makes requirements validation for both Python and Rust commands work.

Reviewed By: zzl0

Differential Revision: D44106560

fbshipit-source-id: 9b435017d336a314f06dc8fff96ec50a6aef8fcf
2023-03-20 11:00:22 -07:00
Muir Manders
df98ce2a84 progress: allow longer topics in wider temrinals
Summary:
Show topics up to 20 chars if terminal width is >= 100.

This is a stop gap until I land my new renderer that uses space more efficiently.

Reviewed By: quark-zju

Differential Revision: D44136359

fbshipit-source-id: 5d59c8b07d930d689b73c3e0fe1c3ee8ce020118
2023-03-20 08:42:20 -07:00
Jun Wu
82883adb82 pathauditor: update error message in Windows tests
Summary:
This makes `test-invalid-windows-filepath.t` pass with recent pathauditor error
type changes.

Reviewed By: sggutier

Differential Revision: D44153212

fbshipit-source-id: 81e71c48a42ef29eecf3a3a3e117141f43232efb
2023-03-16 16:50:14 -07:00
Muir Manders
3674a0540b status: fix rust flags comparison
Summary:
Fix rust status when dirstate does not contain executable/symlink flags for a tracked file, and the file's flags have diverged from the manifest.

To achieve this we pipe the filesystem metadata long to the content check since the content check already looks up all the files in the manifest. Before actually doing the content check, it compares the on-disk flags to the manifest flags.

Reviewed By: quark-zju

Differential Revision: D43970583

fbshipit-source-id: 544acfa355cf9d0d2acf59ad9143de6dac349235
2023-03-16 10:58:55 -07:00
Muir Manders
c31321235e status: fix symlink handling
Summary:
Handle case where a directory with tracked files is replaced with a symlink.

In paticular, during status if we get a access-file-through-symlink audit error trying to read the contents of a file for comparison, we now treat the file as deleted.

Reviewed By: quark-zju

Differential Revision: D43970589

fbshipit-source-id: e145d36275e4af18ec77f4fb3b018f85df8f39f6
2023-03-16 10:58:55 -07:00
Muir Manders
2a4c2ad74a pathauditor: use concrete error types
Summary: I need to differentiate the symlink error in the status code path.

Reviewed By: quark-zju

Differential Revision: D43970579

fbshipit-source-id: 7931f83f828352a8f5ca8f90ff037702b0c64369
2023-03-16 10:58:55 -07:00
Muir Manders
a7946d0f17 status: handle crazy mtimes in rust
Summary:
Don't error out for files with negative or huge mtimes. We use the same masking approach as Python for now.

Note that Rust status does not write the mtime back to dirstate in general right now, so success is merely that "hg status" doesn't crash in this case.

Reviewed By: zzl0

Differential Revision: D43970588

fbshipit-source-id: f1ea50eaeeee2fc9b564934ec587c9f02abaf651
2023-03-16 10:58:55 -07:00
Muir Manders
df42ae4d04 workingcopy: add traces to filedetector
Summary: These will help me figure out "status" discrepancies.

Reviewed By: zzl0

Differential Revision: D43970581

fbshipit-source-id: 63ef7578b6aec100b172da9516292aa549b8d318
2023-03-16 10:58:55 -07:00
Saul Gutierrez
e091385d09 symlinks: add gating for Windows symlinks through store requirements
Summary: This should allow in later diffs to enable symlinks on Windows if users have `windowssymlinks` on their repo store requirements. Additionally, it adds the aforementioned requirement to new repos cloned with the `symlinks.force-enable` config.

Reviewed By: muirdm

Differential Revision: D43456961

fbshipit-source-id: bd2f5a1cb6c3b647ebccb0de556959758a4d7fe2
2023-03-16 07:33:58 -07:00
Jun Wu
1a697a202e ctrlc: move ctrlc setup to after os.fork
Summary:
`os.fork()` (used by pfcserver) only duplicates one thread. That is problematic
for `ctrlc` because the background thread that handles the Ctrl+C won't exist
for the forked processes. Fix it by moving the ctrlc setup to after os.fork.

Reviewed By: muirdm

Differential Revision: D44048693

fbshipit-source-id: 5d4391dabb7b4fc6e3cc1e015c7d0acdb017041e
2023-03-14 12:35:19 -07:00
Muir Manders
6429adfeb4 status: support track-ignore transition in Rust
Summary:
Now when fsmonitor.track-ignore-files in the config differs from the value stored in the treestate metadata, we reset the watchman clock to trigger a fresh instance. This makes Watchman walk the repo and return all files. In turn we use this complete list to migrate the treestate to contain or not contain ignored files, depending on fsmonitor.track-ignore-files.

Note that I changed the Python logic to default to track-ignore-files=False, and to assume the absence of the flag in the treestate metadata means the treestate doesn't contain ignored files. I made this change because I didn't want Rust to default to assuming "enabled" because that would trigger a fresh instance the first time "status" is called. I don't think this will materially affect the Python behavior.

Reviewed By: quark-zju, zzl0

Differential Revision: D43789376

fbshipit-source-id: c97fcc83bb7ba2744c6be954246fa8bb499f0c32
2023-03-14 07:44:00 -07:00
Muir Manders
0d67de8a1d treestate: clean up metadata API a bit
Summary:
The main thing is to add methods to TreeState to get and set the entire deserialized metadata. The existing get_metadata_by_key would deserialize the metadata each time it was called.

I removed the Metadata type from most places. It is a wrapper type only used for serialization, so it probably shouldn't be public at all.

I also renamed set_metadata_by_keys to update_metadata, which goes better with the new set_metadata.

Reviewed By: zzl0

Differential Revision: D43970591

fbshipit-source-id: 203cc68acd6476e5e11608fb4858c9abb77ec03c
2023-03-14 07:44:00 -07:00