Summary: Makes it explicitly mention that `sort` method sorts the set in topo descending order, this is different than the `sort` function in revset, which sort the set in ascending order by default.
Reviewed By: quark-zju
Differential Revision: D44728173
fbshipit-source-id: aa95993b237ebacc587147da9caccdf43ff48b80
Summary: Add test utilities for testing copy trace logic, also added a simple test case as an example.
Reviewed By: quark-zju
Differential Revision: D44559585
fbshipit-source-id: b03796fa3869d94edc528d570d511b1d84b15861
Summary:
add vertex_fn parameter to ImportAscii trait, so that we can control
how to generate Vertex from a string: for example HgId expects 20-bytes vertex.
Reviewed By: quark-zju
Differential Revision: D44739947
fbshipit-source-id: c82c95ce4d6c45562c32ad4ccc3e5b40fd517770
Summary:
Tweak revlog commit import to maintain a stable order (this broke after recent change to top sort the commits).
Unfortunately the new stable order is inconsistent w/ fullsegments output in test-eager-exchange.t, so separate the tests.
Reviewed By: quark-zju
Differential Revision: D44768930
fbshipit-source-id: 6757450d7d446373d1b8c943d6cbcc6029b07443
Summary:
This works better with Git. The old filenode-based logic does not seem correct
since it might not trigger adjustlinkrev.
Reviewed By: zzl0
Differential Revision: D44751613
fbshipit-source-id: e5a2367e544f1d55c6a2c149fd33db13af623e46
Summary:
return usage of commit graph for revlog clones
Disabling is no longer needed after D44734552
Reviewed By: quark-zju
Differential Revision: D44760863
fbshipit-source-id: 0ba65f63bf8c980fc0ab9b0dce1ec895f6b5f10d
Summary:
intro high level transaction for cloud sync
this is for syncs that are not running with best effort option
the transaction is needed to eliminate repo changed while backing up errors
this is a follow up after https://www.internalfb.com/diff/D41871718 that hasn't resolved the errors fully
Reviewed By: markbt
Differential Revision: D44664729
fbshipit-source-id: da411cd20fb909c22ff8976dd31bd46034a28226
Summary:
In certain edge cases, during pull we are using EdenAPI to fetch nodes and feeding them into a revlog changelog (via doublewrite). This was erroring out since the RevlogCommits.add_commits expected nodes to be sorted parent-before-child. Work around by sorting the nodes.
[MSDK] Update icsp_domain_config_type_linter component on ICSP:master
```
Reviewed By: quark-zju
Differential Revision: D44734552
fbshipit-source-id: 7f00a93b93921baa827a55c7c1ec9388b74ac0f7
Summary:
There is a new `Target::Pipe` that could be used to redirect logs to a file. So updating to the latest version which doesn't add any breaking changes.
Also, updating the deprecated call sites:
```
xbgs -sl 'env_logger::from_env' \
| arc linttool debugfilterpaths --take RUSTFMT \
| xargs sed -i 's/env_logger::from_env/env_logger::Builder::from_env/'
arc f
```
Reviewed By: dtolnay
Differential Revision: D44671457
fbshipit-source-id: 6734f2839731b189564d3b7ceffcd95410fe02e8
Summary: There is a typo in `_clonetotmp` that makes it crash. It should be `ident.configrepofile` instead of `ident.configerpofile`
Reviewed By: muirdm
Differential Revision: D44709074
fbshipit-source-id: 60160d68eea6b5cfafa10c5a053ade44a54724a5
Summary:
This experimental option allowed you to automatically "jump" past the specified revisions when annotating a file. The idea is you could skip big codemods/renames etc. that touch a lot of lines without meaningful changes.
However, no one uses it. The idea is good, but to use it you need to know a priori what revs you want to skip. A better integration might let you configure known annoying revisions, or maybe let you filter commits by their commit message.
Plus, any decent blame UX allows you to easily jump passed boring commits.
Reviewed By: zzl0
Differential Revision: D44596603
fbshipit-source-id: 3e5707bb2e14aecaf4f56388afb7eb49951b6d31
Summary:
If experimental.edenapi-blame is configured and the repo has an edenapi client, the annotate command will fetch blame data from the new blame endpoint.
Currently this doesn't support any of the whitespace options since the server only provides whitespace sensitive blame data. We can probably emulate the whitespace insensitive behaviors locally with more work.
Reviewed By: mitrandir77
Differential Revision: D44596604
fbshipit-source-id: 73d7462d0ded2d6941b704dfb0294e52f462879a
Summary:
These mirror the Mononoke BlameV2 derived data.
I tweaked the #[auto_wire] macro to support a new #[no_default] attribute. This made it possible to stick a Result<_, ServerError> into my type without having to hand implement anything else (since Result doesn't implement Default, which otherwise was required for #[auto_wire]).
Reviewed By: quark-zju
Differential Revision: D44596607
fbshipit-source-id: 9f2cc22d9ef43deefd32d4cfff67d350045ea845
Summary:
Original commit changeset: e0a130c04c80
Original Phabricator Diff: D44694398
Solving the `arc feature` problem in favor of D44695559
Reviewed By: muirdm
Differential Revision: D44713896
fbshipit-source-id: 4b870d0288e6e81577d8d398b1fb42d4e8b68dc9
Summary: Recently D44515578 removed remotenames from the set of names, but internal internal tooling was depending on that.
Reviewed By: fanzeyi
Differential Revision: D44694398
fbshipit-source-id: e0a130c04c803e51a6e7f8a284b572047ffc0ee9
Summary: As title says. Compiling on Windows has been kind of annoying lately due to the number of warnings I've seen, which this cleans.
Reviewed By: muirdm
Differential Revision: D44690961
fbshipit-source-id: 37ae8e48e4aa181ac909b3ec90c76a1438b24489
Summary:
There is an issue where children sl processes inherit SCM_SAMPLING_FILEPATH and write to the same file as the parent process. This messed up the sampled data since the child's "command_duration", for example, could clobber the parent's.
Fix by only allowing one process to create SCM_SAMPLING_FILEPATH. This way the child (e.g. backgroundfsync hook) will not be able to output metrics.
Reviewed By: zzl0
Differential Revision: D44645799
fbshipit-source-id: 11f41343107802f9fd9ae2dc0fc7a9e1925859d8
Summary: Expose sampling-category-for-key and append-sampling-event methods from Rust to Python to replace relevant logic in ui.py. This consolidates things, and may fix the issue where corrupted keys like "foo{" were getting into the sampled data.
Reviewed By: zzl0
Differential Revision: D44645798
fbshipit-source-id: e158ed7434435e1d29222cda2fc1cf0ee345010a
Summary: This makes it easier to share the sampling config with Python. In particular I want to get down to only having a single place open the SCM_SAMPLING_FILEPATH file to make it easy to fix a couple bugs (see next diff).
Reviewed By: zzl0
Differential Revision: D44645800
fbshipit-source-id: 12a0da6d1356b6c116224a3c3552692bd5aa656a
Summary: I want to expose the sampling file to Python, so first let's move it to a non-tracing related crate.
Reviewed By: zzl0
Differential Revision: D44645801
fbshipit-source-id: 14da917acdc3529e17502d81846229e3ae8854e2
Summary: The hg stable commands fail to work on Windows. This is because the hg code calls a shell script to run the necessary hg commands. This diff adds a port of the shell script into python to let it work on Windows.
Reviewed By: skotchvail
Differential Revision: D44591662
fbshipit-source-id: 5d376702ccc648fe01f541b2d673ae39f954739b
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
Summary:
Context
==
When the code being changed is called from a test or program using Python 3.10, deprecation warnings appear.
`DeprecationWarning: setDaemon() is deprecated, set the daemon attribute instead`
Python 3.10 is rolling out in fbcode, so it will be nice to have one less DeprecationWarning.
Implementation
==
* sed -i -E 's/(\s+)(.*)\.setDaemon\(True\)/\1\2.daemon = True/'
Reviewed By: muirdm
Differential Revision: D44620221
fbshipit-source-id: b243b5e8947c918f865efa3c46ffdc8c0e530243
Summary: These are the tests that passed after adding "$ eagerepo". I attempted to turn on eagerepo for all tests that didn't contain "$ eagerepo" or "configure modern".
Reviewed By: quark-zju
Differential Revision: D44445379
fbshipit-source-id: b283be6d5249f74e11a3205622961e457587e93b
Summary:
based on the doc of writing extensions, post-* hooks should be setup in the `uisetup`
```
10.1. uisetup
* Changes to ui.__class__ . The ui object that will be used to run the command has not yet been created.
...
* Setup of pre-* and post-* hooks
10.2. extsetup
* Changes depending on the status of other extensions. (if extensions.find('mq'))
* Add a global option to all commands
* Extend revset
10.3. reposetup
* All hooks but pre-* and post-*
* Modify configuration variables
* Changes to repo.__class__, repo.dirstate.__class__
```
Reviewed By: sggutier
Differential Revision: D44632035
fbshipit-source-id: f37bb052a2ab225d43cf7f305b0bcccedb4add9c
Summary:
We made 'pr_marker' run inline instead of as hook in D43276199, but this can cause
nested event loop runtime error in `sl pr pull`. This diff makes 'pr_marker' run as a
Python hook to avoid the nested event loop.
The difference between current hook (this diff) and previous hook is that we are running
it as a Python object instead of shelling out to `sl` command.
https://github.com/facebook/sapling/issues/58
Reviewed By: quark-zju
Differential Revision: D44531268
fbshipit-source-id: 5270b7172d7b2c22a9c9e715d7cb5b42181cff53
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
Summary:
Add a way to debug copytrace binding, this can be used in .t test for
testing copytrace binding as well
Reviewed By: quark-zju
Differential Revision: D44449566
fbshipit-source-id: 1b5cc6bbf747edd449fb6e98c1bdba9527515353
Summary:
Allows nesting `#ifs` macros on debugruntest.
This can be useful if we have something like
```
#if no-windows
...
#if fsmonitor
...
#endif
...
#endif
```
Reviewed By: quark-zju, zzl0
Differential Revision: D44447876
fbshipit-source-id: 0f5a136cbed7f235a53b619a5bb3b593ffff7d8c
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
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
Summary:
I accidentally referenced a non-existent "edenscm.httpclient.HTTPSConnection" when switching http libraries in the graphql client. Tweak code to work with the new library.
I also killed the ca_bundle arg since it was never actually passed from graphql.py into anything.
Reviewed By: sggutier
Differential Revision: D44478636
fbshipit-source-id: 50e78ab52f1db98fcb6b14f0fc1cac9ea6662abf
Summary:
🐛(chg): don't crash when user has more than 16 groups on macOS
D43676809 (OSS: 49ee17f2bf) introduced a check for whether the chg server and
sl process have different permissions. We run `getgroups` in two different
places:
1. using `os.getgroups` in sl client in Python
2. using libc's `unistd/getgroups` in chg server in C
Essentially the way this works is we call `os.getgroups` in the client (Python)
and `unistd/getgroups` on the chg server (C). Then, the server compares the
results. If they're the same, then both processes have the same permissions,
otherwise they might be different.
However, `getgroups` on macOS has a key limitation that it will only return a
max of `NGROUPS_MAX` groups (16 groups on my machine, defined in
`sys/param.h`). You can remove this limit by defining
`_DARWIN_UNLIMITED_GETGROUPS` or `_DARWIN_C_SOURCE`[^1].
`os.getgroups` in Python is compiled with `_DARWIN_C_SOURCE`[^2] but chg does
not, meaning that the result of `getgroups` is different in our Python and C
code.
This commit defines `_DARWIN_UNLIMITED_GETGROUPS` for chg so `getgroups` will
have consistent behavior. (the alternative is patching CPython to unset
`_DARWIN_C_SOURCE` which is worse)
Special thanks to strager for helping me debug this 👍🏻
Pull Request resolved: https://github.com/facebook/sapling/pull/573
Test Plan:
1. have user with <=16 groups
2. run `sl --version`
3. confirm it works
4. have user with >16 groups
5. run `sl --version`
6. notice sl failing with error "chg: abort: too many redirections."
7. apply this patch
8. repeat steps 4-5
9. confirm it works
[^1]: https://opensource.apple.com/source/xnu/xnu-3247.1.106/bsd/man/man2/getgroups.2.auto.html
[^2]: 28d369e070/configure.ac (L267)
Reviewed By: sggutier
Differential Revision: D44378466
Pulled By: quark-zju
fbshipit-source-id: 402aa56bcacd2d6d2af9bed66e2c3be13738c435
Co-authored-by: strager <Strager.nds@gmail.com>
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
Summary: Python binding for copytrace, so it can be used in Python world
Reviewed By: quark-zju
Differential Revision: D44152527
fbshipit-source-id: 233986efddb855188ce9ada6cace70a57f834b9c
Summary: make `cl.dag` able to be used as a `dagalgo` -> `DagAlgorithm` converter, this will be used by pycopytrace.
Reviewed By: quark-zju
Differential Revision: D44152513
fbshipit-source-id: 1e211063160509587fe807789716f23787e2705e
Summary: Fill the missing part of DagCopyTrace::new
Reviewed By: quark-zju
Differential Revision: D44110425
fbshipit-source-id: 32f9cfc949a56eb60d5589258ae6da87ea26cb5a