Summary:
This will be used by Ctrl+C handling. By quitting the pager and waiting
for it, we can drop the `Terminal` properly and restore the terminal state.
Reviewed By: muirdm
Differential Revision: D42876258
fbshipit-source-id: 7849418c8f6d214530b32c25846618d42029399f
Summary:
Include the submodule `path` in traceback, and log when the submodule repos are
actually created.
Reviewed By: muirdm
Differential Revision: D42949670
fbshipit-source-id: b09fd4148893d770e38b3f23e8ed3b63a1408f83
Summary:
We have migrated to v2 (D35232804 (3807e9662b)) for a long time.
Let's just write to the v2 state files since it's unlikely
that we need rollback to an older version without the v2
format support.
Reviewed By: markbt
Differential Revision: D42912666
fbshipit-source-id: 77cf6bee866e9a6f58629b9a5ee49c5c604b7ef5
Summary:
Some submodules (ex. gflags) have submodules (ex. gflags/doc) that share the same
URL with the parent repo. Previously those 2 repos would deadlock on the
backing repo wlock on checkout, and the git reference would conflict.
Fix them by:
- Skip the submodule backing repo wlock, since nobody uses the backing repo's
working copy.
- Escape `/` to `_` in the git reference name to avoid conflict.
Reviewed By: muirdm
Differential Revision: D42949672
fbshipit-source-id: fc471f9c6aeec05212911e3ffeb8f53f0427fa38
Summary:
This is used to investigate a deadlock pulling submodules when cloning the
pytorch repo.
Note the deadlock checking only works for Python locks and requires
`--config devel.lockmode=python` to activate.
Reviewed By: muirdm
Differential Revision: D42949671
fbshipit-source-id: bfd01e7564bf10f64875a411e7d74c961e240425
Summary: Enabling `#inprocess-hg-incompatible` makes the test compatible.
Reviewed By: muirdm
Differential Revision: D42940329
fbshipit-source-id: 0779b4ed4790d087958aee97b54f8e085dd09b28
Summary:
The test requires the Rust implementation of `debugrevset`. However by setting
`workingcopy.use-rust` to False (default) the `clidispatch` would request
falling back to a Python implementation of `debugrevset`, which does not exist.
Fix it by setting `workingcopy.use-rust` to True. We should make sure
`run-tests.py` and `debugruntest` has a same view of default hgrc. But that
is a potentially breaking change and would be done separately.
Reviewed By: zzl0
Differential Revision: D42825820
fbshipit-source-id: db537c0226d205f9fc5d1a464a6ef4b4d8793185
Summary:
The "regen-command" spwans a real subprocess in Rust that does not go through
the Python shinterp so it was not compatible with debugruntest.
Let's check the tracing message instead to ensure the spawn behavior happened.
Reviewed By: zzl0
Differential Revision: D42825821
fbshipit-source-id: d51c13e5b6d5ea776cfddd8f49db4913e826304d
Summary:
If LocalSerivce is a singleton, it will capture an `ui` object that might be
stale in in-process hg tests. `LocalSerivce` is cheap to construct so let's
just avoid the singleton pattern for test compatibility.
This fixes `test-commitcloud-rename-workspace` debugruntest compatibility as
the following text is now printed properly using the up-to-date `ui.debugflag`:
commitcloud local service: get_references for current version 2
Reviewed By: zzl0
Differential Revision: D42825822
fbshipit-source-id: 683dec345c4a36a6d79080e54a09050991c11dad
Summary:
`&>` is parsed by conch-parser as `&` (run in background) and `>` (redirect) so
it does not work properly in debugruntest.
In this case the test just want to silence the traceback of an uncaught error.
Let's make it explicit that we just disable that traceback without affecting
other logic.
Reviewed By: zzl0
Differential Revision: D42825819
fbshipit-source-id: 963f83ed25d22ace13982632e23cc86195a62a2f
Summary:
Inline the checkmessagehook extension so it works without using hooks.
Hooks have extra overhead (ex. flushing pending commits, files, metalog, etc so
changes are visible to subprocesses) that is unnecessary for just checking
a commit message.
Reviewed By: zzl0
Differential Revision: D42823936
fbshipit-source-id: 4ca951f4f555ea3b3227656539b4748b83692230
Summary:
This allows faster iteration on streampager features.
I made the file loading feature optional by adding the `loaded_file` feature.
This way the code is compatible with upstream and for internal build we can
avoid unnecessary dependency like `notify`.
Reviewed By: markbt
Differential Revision: D42873673
fbshipit-source-id: 7d3d0f07f4f5a30cfcc87ed6d02ea0886f88276b
Summary: Conflicts weren't being handled properly with --collapse combined with rebase.experimental.inmemory=true. Work around by disabling in-memory rebase when collapsing.
Reviewed By: sggutier
Differential Revision: D42924842
fbshipit-source-id: 6d86ea1ad8c7b6852f0bd874d26041e42f0c2b10
Summary: This wasn't passing after my recent change to enable native status in more tests. Not sure why I committed or how it landed.
Reviewed By: sggutier
Differential Revision: D42926501
fbshipit-source-id: 2fb8179ba578e8ce61aca6ab2ea3c077dbfc158e
Summary: Switch from "status" to an arbitrary Python command "addremove" so the extension under test gets loaded.
Reviewed By: sggutier
Differential Revision: D42925551
fbshipit-source-id: 88a8a687a86016872eddca99041138df151bce3e
Summary: Fix some failing tests that were linux specific related to using native status.
Reviewed By: sggutier
Differential Revision: D42925560
fbshipit-source-id: 387c7cf141a0b6274f7127bca25d3c8c15be375c
Summary:
Ingore %include directives that end in "/". It isn't valid to include a directory, and this was causing an error for the Rust status command when it went looking in the manifest for the path ending in "/".
We seem to sanitize the paths given to "hg sparse enable ...", so I'm not sure how the bad path got into a sparse config beyond hand editting.
Differential Revision: D42870518
fbshipit-source-id: d2162ca1180e06080c9bdf846f1715e389ea0fdd
Summary:
Upgrade uuid crate from v0.8 to v1.2.
Fixed build errors due to API breakage:
1) `to_hyphenated()` -> `hyphenated()`.
2) `to_hyphenated_ref()` -> `as_hyphenated()`.
3) `to_simple()` -> `simple()`.
4) Update `Cargo.toml` (For some reason `arc autocargo` didn't work for some `Cargo.toml` files, likely due to autocargo config section in `TARGETS`).
5) `to_simple_ref()` -> `as_simple()`.
6) `use uuid::adapter::HyphenatedRef` -> `&` `uuid::fmt::Hyphenated`.
For 1), 2), 3) and 4) I ran below scripts to update the API call sites, respectively:
```
5139 2023-01-27 13:20:58 for rs in `fbgs -f '.*\.rs' '.to_hyphenated()' | awk -F: '{print $1;}' | uniq`; do sed -i 's/\.to_hyphenated()/.hyphenated()/g' $rs && echo -e "processing $rs"; done
5140 2023-01-27 13:22:12 for rs in `fbgs -f '.*\.rs' '.to_hyphenated_ref()' | awk -F: '{print $1;}' | uniq`; do sed -i 's/\.to_hyphenated_ref()/.as_hyphenated()/g' $rs && echo -e "processing $rs"; done
5154 2023-01-27 13:37:19 for rs in `fbgs -f '.*\.rs' '.to_simple()' | awk -F: '{print $1;}' | uniq`; do sed -i 's/\.to_simple()/.simple()/g' $rs && echo -e "processing $rs"; done
5216 2023-01-27 14:56:26 for toml in `fbgr -f 'Cargo\.toml' 'uuid = { version = "0[^"]*"' | awk -F: '{print $1;}' | uniq`; do sed -i 's/uuid = { version = "0[^"]*"/uuid = { version = "1.2"/g' $toml && echo -e "processing $toml"; done
```
For 5) and 6), There're only a few places need fixing (hermit-cli and linttool), so I fixed them manually.
== Exceptions
gpt crate v0.3 still uses uuid-0.8 as a dependency, hence [metalos/**/expand_paritiion.rs](https://www.internalfb.com/code/fbsource/[72f22c0ad63b64adbe88fa9213d60ce8f0320421]/fbcode/metalos/lib/expand_partition/src/expand_partition.rs?lines=138) should not apply above 'codemod' (or must be reverted).
NOTE: Because uuid crate v1 has breaking API changes, there's no easy way to split the diffs to multiple smaller *atomic* (where each diff wouldn't cause CI failures) diffs, unfortunately.
Reviewed By: edward-shen
Differential Revision: D42811369
fbshipit-source-id: 377fd1036c8a75bcb1982b03c720a3cea02421e5
Summary:
These tests just needed to switch to a modern, non-revlog repo format.
Remaining tests using the old status have the same problem, but are trickier to migrate due more complicated client/server interactions.
Reviewed By: quark-zju
Differential Revision: D42748903
fbshipit-source-id: 979720cff4e72de586c90d922694d4d88c130b2f
Summary: We don't care about flat manifest anymore, and it would be work to update this test to use modern repo format.
Reviewed By: quark-zju
Differential Revision: D42748901
fbshipit-source-id: fd67adf9992b45264a100b5838866ea35d6ad7ff
Summary:
This test had a real failure where the new status wasn't respecting HGPLAIN to force root-relative paths in the output. It is safer to keep that behavior since we presume some automation would break if we changed to show cwd-relative paths unconditionally.
To use the native status I had to change this test to use modern repo format. That broke some use of revision numbers, so I tweaked tweakdefaults to respect the devel.default-date option to get stable commit hashes (so I could use those instead of revision numbers).
Reviewed By: quark-zju
Differential Revision: D42748900
fbshipit-source-id: 3358c659d5c67e781723720fcb2f760518d7d46f
Summary: This allows RUST_BACKTRACE=1 to work for "make local" builds. I believe buck uses nightly which should get backtrace enabled by default.
Reviewed By: quark-zju
Differential Revision: D42748902
fbshipit-source-id: fdd9473f1c0250a117c83b9637a6e23e0df26da4
Summary: This way the user can see the original byte values.
Differential Revision: D42889478
fbshipit-source-id: 7876787180136cdd86839913eba77cad44115ce3
Summary: Make sure we only pass valid utf-8 strings to Rust's text styling.
Reviewed By: quark-zju
Differential Revision: D42886530
fbshipit-source-id: 2dc7f1ade57d3324997aa9c9a111016cfef51e07
Summary: Switch to modern repo config to resolve "hg status" errors. Somehow missed this one (I probably assumed it was a test using git instead of an hg test importing git diff format).
Reviewed By: sggutier
Differential Revision: D42863480
fbshipit-source-id: 9d595954fb7f7c9693b6d91ef9485acdc37ddc2d
Summary:
`checkserverbookmark` was added by D15450801 (865b8b3a46) for early Mononoke migration.
It is no longer relevant.
Reviewed By: zzl0
Differential Revision: D42823312
fbshipit-source-id: f120255c4c33b919718e46052967d28e7ab772a4
Summary:
Previously, `conch_parser` was built as a separate Python module (`.so`)
so it is not distributed with the main executable, for portability and
binary size considerations.
However, it's annoying to maintain a separate Python module, for example,
buck macOS build would have issues importing it. The binary size concern also
seems minor: stripped Linux binary increases from 43174872 to 43537624 bytes,
+363KB, less than 1%.
Therefore, let's just embed `conch_parser` directly for better macOS support.
`conch_parser` is kept in case someone wants to build a standalone Python extension.
Reviewed By: zzl0
Differential Revision: D42822105
fbshipit-source-id: 287f25aa1860836a3c7df913233b9cb92d6fd0e3
Summary:
Teach `debugchangelog --migrate lazytext` to fetch commit hashes and migrate
the repo to not using lazy commit hashes, which supports
`devel.segmented-changelog-rev-compat` for compatibility with legacy tests.
Reviewed By: muirdm
Differential Revision: D42788588
fbshipit-source-id: b95045bba48f4fbc5c10d94780656163f1335587
Summary:
The test was intended to check that the nonnormalset is a subset of files
tracked by dirstate. Previously the nonnormalset is tracked separately so
it can be buggy and include files not in the main dirstate map. But the
TreeState format enforces the nonnormalset to be a subset of files tracked
by TreeState (dirstate). Therefore the test is no longer relevant.
Reviewed By: sggutier
Differential Revision: D42818816
fbshipit-source-id: 24277f4cd16efc82ac803e1ff2b5b53941289abd
Summary: This way we stop hardcoding platform-specific deps for individual unix-like operating systems. A step toward unblocking building on FreeBSD.
Reviewed By: muirdm, quark-zju
Differential Revision: D42685396
fbshipit-source-id: e8c2e08042ae3ca2ba7121947ff7604ee77212c0
Summary:
Thin Wrapper around GitCopyTrace, it can be used in pathcopies
function for detecting Git file moves.
Reviewed By: quark-zju
Differential Revision: D42787243
fbshipit-source-id: ebbb5e092c0f162d42e66420e644b9488c6b6bec
Summary: This is a temporary solution to unblock hg-over-git use case, specifically detect renames
Reviewed By: quark-zju
Differential Revision: D42787244
fbshipit-source-id: 37edfc8efbb8a6229a3c2a5bdc3309cf2a89ae3c
Summary:
add test for git rename, confirm it does not detect renames. After we
complete the feature, this test should fail and need to update.
Reviewed By: quark-zju
Differential Revision: D42787246
fbshipit-source-id: b65c454b3abf1cf7b25e5a501e3b4c652940a834
Summary:
oss: make 'make tests' run Python tests
'make check' tries to run 'make tests', but despite being documented, the
'tests' target does not exist in the Makefile.
Create a 'tests' target which runs the Python test suite.
Pull Request resolved: https://github.com/facebook/sapling/pull/458
Test Plan:
$ make oss
$ make check
[bunch of failures]
$ (cd tests && python run-tests.py test-debugcheckcasecollisions.t)
----------------------------------------------------------------------
# Ran 1 tests, 0 skipped, 0 failed.
---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/sapling/pull/458).
* https://github.com/facebook/sapling/issues/459
* __->__ https://github.com/facebook/sapling/issues/458
Reviewed By: muirdm
Differential Revision: D42742607
Pulled By: zzl0
fbshipit-source-id: 790624f28da629fe25846d1dde1fad2aa3382911
Summary:
If you ran autocargo right now on master it would fail because of this. I need
to run it later in this stack, so let's fix it.
Reviewed By: lmvasquezg
Differential Revision: D42776200
fbshipit-source-id: c95a8f0e5d34a99b11a069752fbfbde568fbecac
Summary: In case we want a different value, we can use this config option.
Reviewed By: muirdm
Differential Revision: D42783555
fbshipit-source-id: d3d7e1036db4635be45ecc61b0f521552dca6f75
Summary:
While D42626678 provides a way to set the max chain length per index, it's
annoying to update all users of indexedlog. Add a global option so we can
just update once for all.
Reviewed By: muirdm
Differential Revision: D42783554
fbshipit-source-id: 8bffe6de4225560c59da207f321fdaa2b65e25a1
Summary: Move global configuration to a module to make it clear that those are configs.
Reviewed By: muirdm
Differential Revision: D42783055
fbshipit-source-id: d725946f1198199c9a40c612c435a60d62838e0d
Summary:
See the previous diff for context. This diff relaxes the metadata check to only
check the log length without checking indexes. This should resolve the race
condition.
The index uses persistent data structure with explicit pointers (offsets) so
data appended by another process would simply be ignored without causing
issues.
Reviewed By: muirdm
Differential Revision: D42627387
fbshipit-source-id: 5e776a8c6b34eeb6eefbb78f249fd99c7bd05b02
Summary:
The checksum entry could form a long linked list that takes time to read from
disk. Add a way to "flatten" the chain so the linked list length could be reset
to 1 from time to time for optimized load time.
Reviewed By: muirdm
Differential Revision: D42626678
fbshipit-source-id: 57f13c235939ac416c6871eae7ec4e72b2c72f8e
Summary:
On Windows, `os.times()` does not provide a meaningful `elapsed`:
In [1]: os.times()
Out[1]: nt.times_result(user=1.921875, system=1.3125, children_user=0.0, children_system=0.0, elapsed=0.0)
Replace it with `time.monotonic()` so the wall clock time works on Windows.
Reviewed By: muirdm
Differential Revision: D42718496
fbshipit-source-id: dd1bfc313201cc6d321ee23397168d3981d03ffb
Summary:
Teach Repo::file_store() and tree_store() to use the gitstore for git repos.
I also had to avoid a git store tree query for empty repos since git doesn't like our null ID.
Reviewed By: quark-zju
Differential Revision: D42711084
fbshipit-source-id: 399431d1478e9bcb1ffadb08e6bca0ed54f863a3
Summary:
The built-in git config file has an %include for /etc/mercurial/git_overrides.rc. Test were sensitive to this file, which is undesirable.
Fix in the easiest way possible by truncating the static config in tests starting from the first "%include".
I first tried to fix in a general way by refsuing to load any config files in tests unless they are under $TESTTMP. That didn't pan out due to various places that do exactly that.
Reviewed By: quark-zju
Differential Revision: D42711085
fbshipit-source-id: cd36fa439dd08d20ffb362c23a6296ff662b48dc
Summary:
Sapling when trying to push a commit with null manifest tries to pack it first and fails miserably to obtain it. This diffs makes it skip null manifests as those don't need to be transferred.
NOTE: I've also included comment about more general problem that I've noticed. In `shallowbundle.py` we skip over all manifests that don't exist by catching exception but this exception had changed due to rust migration. **I didn't fix that problem.**
Reviewed By: muirdm
Differential Revision: D42753348
fbshipit-source-id: 9a1ae168d09d89bd0316991af88c6801e4c2f41b
Summary:
Breaking this task down into a few steps:
1. remove reference of config.py in `workspace.py`, `dirsync.py`, and `templater.py`.
2. remove `config.py`.
Reviewed By: muirdm
Differential Revision: D42731038
fbshipit-source-id: 6feb4db0808f5182696e1366042a9a94a59f743b
Summary:
Breaking this task down into a few steps:
1. remove reference of config.py in `workspace.py`, `dirsync.py`, and `templater.py`.
2. remove `config.py`.
Reviewed By: muirdm
Differential Revision: D42731393
fbshipit-source-id: c0de17d4a592fbb9aba511ae5012696f57691e53
Summary: I don't see any test for `cfg.names()`. Adding test in this diff.
Reviewed By: muirdm
Differential Revision: D42731690
fbshipit-source-id: 6d92759921d0fd1c735250a438b98f3c6db4a355
Summary:
Historically, we avoided running the Black autoformatter on our
fork of ghstack so that the code would be easier to diff with
upstream. Now that Black is run on upstream ghstack:
e5eca89cb3
we have no reason to exclude it from our linter.
Going forward, we should update the GitHub CI to run `black --check`
and report back so that contributors get this signal as well.
Reviewed By: zsol
Differential Revision: D42494629
fbshipit-source-id: 7f09ec46f687e56662f4f6ac477fd2fd077709d6
Summary:
Upstream ghstack uses this for `github_fake.py`:
004d330948/ghstack/github_fake.py (L261)
Because our fork of ghstack talks to GitHub in a different
way and has its own test harness such that we deleted
`github_fake.py`, we can remove `github_schema.graphql`, as well.
This simplifies things because our internal linter wants to run
Prettier over it.
Reviewed By: evangrayk
Differential Revision: D42698061
fbshipit-source-id: 602346e4e5ee48331513c5e28eafbb39f1fac71a
Summary:
The implementation details are not obvious (for example, the xxhash chunk start
does not match start). Add more docs about them.
Reviewed By: muirdm
Differential Revision: D42626680
fbshipit-source-id: 2294d1cb6af859fb75a68b3618796d26b2dadd1c
Summary:
`if cfg!(debug_assertions) { ... } else { ... }` is a better form since it
always checks that the code compiles and is sometimes shorter.
Reviewed By: muirdm
Differential Revision: D42626679
fbshipit-source-id: 1165b92b7b81d33704a5b4ee6ed36c61f4250c87
Summary: Adds an integration test for the features added in D42221073
Reviewed By: bolinfest
Differential Revision: D42625035
fbshipit-source-id: 40a00f36ce25bd2250637bca3b42f16076be1304
Summary:
D42614252 (79886f53d4) introduced a way of setting `default.default-push` through the `SL_TEST_GH_URL` environment variable in tests. This diff makes use of the same environment variable for `github.submit.get_origin`.
This can be useful when testing commands that need to connect to the mock GitHub server but still need to get data from the git repo being tested.
Reviewed By: bolinfest
Differential Revision: D42625037
fbshipit-source-id: bf19d772fef32bf4ce8326391a9df360a3412040
Summary:
This allows revsets of the form `PR[0-9]+` to be translated to commit hashes as well as autopulling them in case a local copy doesn't exist. This revset can be used in commands that support revsets, such as:
- `goto`
- `log`
- `show`
- `rebase`
- `pull`
Marking the translated revsets as remote bookmarks is still pending
Reviewed By: bolinfest
Differential Revision: D42221073
fbshipit-source-id: 695fe82d0f0c23ea32e18c86be537ed3ea0807f7
Summary:
https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/for_loops_over_fallibles/static.FOR_LOOPS_OVER_FALLIBLES.html
Both Option and Result implement IntoIterator trait, which allows using them in a for loop. for loop over Option or Result will iterate either 0 (if the value is None/Err(_)) or 1 time (if the value is Some(_)/Ok(_)). This is not very useful and is more clearly expressed via `if let`.
Reviewed By: muirdm
Differential Revision: D42656184
fbshipit-source-id: b14b53b49ef90eea26a2329dbe37168e5d454dea
Summary: removed unnecessary 'hg' command in the test and fixed some typos.
Reviewed By: muirdm
Differential Revision: D42656185
fbshipit-source-id: 4300b32703230193df425193715bfd0974872695
Summary:
Detect cargo features and run with features turned off. This can help capture
issues turning default features off.
Reviewed By: muirdm
Differential Revision: D42642444
fbshipit-source-id: 4a65d71a1e4e9766f385456c6738e2a01f644aca
Summary:
This avoids invalid feature selections such as `--no-default-features` when
testing `cpython-ext`.
Reviewed By: muirdm
Differential Revision: D42643921
fbshipit-source-id: 517a47c81aed49ca8ebf0c7b8f4bdcb9eba8bba0
Summary: It is only used by the website SVG renderer. Let's make it optional.
Reviewed By: muirdm
Differential Revision: D42590209
fbshipit-source-id: 17231e8468792dfb87cc2010d4b74257fb5257b6
Summary:
First, don't use "--keep" since that results in a duplicate set of commits visible in smartlog. It also makes it hard to map between the rebased commits since it doesn't record mutation markers. Further, note that "--keep" does not output the "nodechanges" data, so we were always assuming the rebase did no work, and would proceed to push the un-rebased commits. This would lead to a "non-fast forward" error whenever the default branch was newer than the stack's base.
Second, use "rebase -r" instead of "rebase -s". "-s" was rebasing the entire stack in the first loop iteration which causes two problems: 1) It rebases too much (i.e. it can rebase later commits in your stack you aren't trying to land right now). This is bad because you could see conflicts in commits you aren't trying to land, which doesn't make sense. And 2) it messes up the loop's mapping of commits since the loop assumes it is rebasing one commit a time. This issue was probably moot due to the "--keep" issue.
I also added some logic to "goto" back to the un-rebased commit after the rebase. In general, landing commits should not change the working copy. We also "hide" the commits created by rebase so the user won't see duplicate commits in their smartlog if there is a failure.
Finally, I tweaked the rebase logic to be more conservative wrt commits being "rebased out". If one of the commits being landed is already on the target branch, we abort and ask the user to rebase manually.
Fixes#333.
Reviewed By: bolinfest
Differential Revision: D42203379
fbshipit-source-id: 39a8dcd4d65e0535fc2379e4ad16fea902bb88d0
Summary:
Add a test that demonstrates an issue w/ "ghstack land" logic. The main issue is the pull/rebase never affects what we end up pushing, so non-fast-forward errors will occur whenever the remote main branch has commits newer than the stack's branching point.
I added/tweaked the mock utils based on what queries ghstack submit/land uses. I added a more generic "expect_request" which callers can use to mock out a response without needing to create a specific type.
Reviewed By: bolinfest
Differential Revision: D42614252
fbshipit-source-id: b9928361128f22c2f456836075aa7cf7ead5be11
Summary: Some users of make_request import the function, so subsequent wrapping of make_request has no effect. Now the wrapping applies to the unexported _make_request and always take effect.
Reviewed By: bolinfest
Differential Revision: D42614253
fbshipit-source-id: bc7c7b74333984c54adfc3d49a6207c46ee2f9b6
Summary:
I mainly want this so the HGUSER env var is respected in tests.
I prefer ui.username()'s abort message to what get_identity_or_raise() had since it cuts to the chase instead of "forcing" the user to open the link to discover the recommended command for setting username.
Reviewed By: bolinfest
Differential Revision: D42614255
fbshipit-source-id: de4a6719bfdefb2298e316bd18bad2c564aded84
Summary: query HEAD name, instead of assuming main/master
Test Plan:
---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/sapling/pull/386).
* __->__ https://github.com/facebook/sapling/issues/386
Pull Request resolved: https://github.com/facebook/sapling/pull/386
Fixes https://github.com/facebook/sapling/issues/375
Ran a number of affected integration tests:
```
./run-tests.py test-git.t test-git-submodule.t test-git-submodule-rebase.t test-rust-clone.t test-doctest.py
```
Using the example from https://github.com/facebook/sapling/issues/375,
cloned the repo and verified that it cloned the `trunk` branch:
```
$ lhg clone --git https://github.com/cli/cli
$ cd cli
$ lhg
@ 179e9c256 Yesterday at 14:13 2159081+qoega remote/trunk
│ Add projectsV2 support to issue create, issue edit, pr create, and pr edit (#6735)
│
o 06ae07f97 Yesterday at 07:25 mislav
├─╮ Merge pull request #6880 from cli/setdefault-bare-repo
│ │
o │ 351226d34 Yesterday at 07:17 mislav
├───╮ Merge pull request #6881 from cli/reviewers-json-fix
│ │ │
o │ │ 241f9197e Wednesday at 21:15 rmw
├─────╮ Merge pull request #6815 from cli/intake-doc
...
```
Reviewed By: quark-zju
Differential Revision: D42597162
Pulled By: bolinfest
fbshipit-source-id: 2f4b3869f452b57290f2a7a69721ecdd4e444b2e
Summary: Currently, 'hg sl' template is calling 'shelved()' revset function to add '(shelved)' label, and it crashes if there are '._*' binary files created by MacOS. This diff ignores the '._*' files.
Reviewed By: quark-zju
Differential Revision: D42647182
fbshipit-source-id: 9ff8b67e85c55bf2ea24af774f1b638798e71f4c
Summary:
Currently, `hg sl` template is calling `shelved()` revset function to add '(shelved)' label, and it crashes if there are `._*` binary files created by MacOS.
This diff is to add a test to repro the bug
Reviewed By: muirdm
Differential Revision: D42647185
fbshipit-source-id: 72b1677cc2cdc9c084b9e2a5a778d27d4a6c0abc
Summary:
The feature delegates to dag-types/for-tests. Crates using this feature can
enable it on dag-types instead.
Reviewed By: muirdm
Differential Revision: D42591209
fbshipit-source-id: aa0d5c788377cc7500fd0fc10dedf90d2d8d0583
Summary:
Partially reverts D34191759 (0cc5984cde). `quickcheck_arbitrary_derive` is not published on
`crates.io` and is blocking `dag-types` from being able to be published.
Reviewed By: muirdm
Differential Revision: D42591210
fbshipit-source-id: f8d92af0d142bde15900757c9bb58fd19813ad1d
Summary:
This partially reverts D22970570 (c448e0f575). There is no circular dependency because a crate and its
test are treated differently as 2 crates. So `dag`, `dag (test)`, `renderdag`,
`renderdag (test)` are 4 crates. A dependency graph like:
dag(test)
+--renderdag
+--dag
renderdag(test)
+--dag
+--renderdag
is not circular and can be handled by cargo just fine.
Reviewed By: muirdm
Differential Revision: D42590207
fbshipit-source-id: 25e917f78f088be13711d652adbec3e5d6e47e4b
Summary:
It's only used by Mononoke caching and not used by other users.
See https://github.com/martinvonz/jj/issues/1056 for context.
Reviewed By: muirdm
Differential Revision: D42590206
fbshipit-source-id: 6fa25844775a91b9e4aabb23c2c499d4e4570e70
Summary: This makes the test a bit stronger.
Reviewed By: zzl0
Differential Revision: D42493269
fbshipit-source-id: d51ef1f6c0e9c5d7d72dd2e27c1800f0e62c16e9
Summary:
Use locking internally to avoid racy concurrent writes that could cause
unrecoverable data corruption.
Previously:
Timeline: -------------------------->
Process 1: open(), append, append, ...
Process 2: open(), append, append, ...
Now:
Process 1: open(), lock { append, append }, ...
Process 2: open(), lock { append, append } ...
`append()` to the same file is exclusive to one instance.
Note we need to update `position` after obtaining the lock to pick changes from
other instances.
Reviewed By: zzl0
Differential Revision: D42492667
fbshipit-source-id: 6a6184c945d23e16eb1619458abdb18afc64868c
Summary: It'll be used by the next change.
Reviewed By: zzl0
Differential Revision: D42492670
fbshipit-source-id: 676320fc4fd14411a6feca450b53a0b67e82f6ec
Summary:
It'll be used by the next change. Note `Rc<RefCell>` or `Arc<RefCell>` won't
compile for the rest of the project.
Reviewed By: zzl0
Differential Revision: D42492672
fbshipit-source-id: 28b167b1d1e61a715f86911ea1d314fc2420eafd
Summary:
trait FileReadWrite is used for both on-disk and in-memory files. Add locking
so the next change can use it to avoid races on the physical filesystem.
Reviewed By: zzl0
Differential Revision: D42492668
fbshipit-source-id: 06c02ea4fb52213c3a64fc17a336a5edba385dc4
Summary: Currently, 'hg rebase' is rebasing hidden commits and making them visible to users, this is a regression caused by D42087621 (96b767efde).
Reviewed By: quark-zju
Differential Revision: D42608733
fbshipit-source-id: de4b7b231d42a45844174e4a417d3c07a6869b97
Summary: Add arguments to isl.py so that each ISL server is spawned with --slversion as expected
Reviewed By: bolinfest
Differential Revision: D42563631
fbshipit-source-id: 9a493c4ddf3f7529f032bc130cbd164fb9d4a668
Summary: The patched abomonation is required to build because of the transitive dependency on the new smallvec feature. We are separately working on removing this dependency, but for now we need to include the patch.
Reviewed By: bolinfest
Differential Revision: D42612033
fbshipit-source-id: 7991db74946cce8640795104623841f23abf82c6
Summary: When reading copytrace related code, I found we deprecated puredirs in favor of Rust 'dirs' in D19634699 (8e673a1de0).
Reviewed By: markbt
Differential Revision: D42539556
fbshipit-source-id: 59ae23e5d92626cac11cc9ea4c41d196940796b0
Summary:
We met an issue that `oldml["remotenames"]` can be None.
```
with progress.bar(ui, _("reading repo history"), "", len(roots)) as prog:
for rootid in reversed(roots):
prog.value += 1
oldml = ml.checkout(rootid)
node = bookmod.decoderemotenames(oldml["remotenames"]).get(mainfullname)
if node and node in repo:
found = node
break
```
And it will cause below TypeError.
```
│ `hg doctor` stderr:
│ segments/v1: repaired
│ remote/master points to an unknown commit - trying to move it to a known commit
│ exception TypeError('Expected type that converts to PyBytes but received NoneType') ignored during checkmissingmaster
```
Reviewed By: quark-zju
Differential Revision: D42588709
fbshipit-source-id: 79013cc311cfdb4ab033c20cdd7c508d3341c88d
Summary:
use phases information returned from the server to speed up
retrieval of mutations
if we keep phases calculation client side, it often makes few single "commit_hash_to_location" requests and then a huge batched request with few hundred of hashes
Reviewed By: quark-zju
Differential Revision: D42453084
fbshipit-source-id: bec211c41da61332ba324b6b934540d5a48bc65d
Summary:
Change `test-ext-github-pr-submit.t` so it tests the
new `sl pr submit` behavior introduced in D42550052
while introducing `test-ext-github-pr-submit-placeholder-issue.t`
to verify the old behavior.
Reviewed By: sggutier
Differential Revision: D42554648
fbshipit-source-id: 79f4a876993ad3d85bb2a11be1460de55d5530c0
Summary:
The entry in the bulleted list in the pull request body
should match the pull request number argument
rather than hardcoding it to `1`.
Reviewed By: sggutier
Differential Revision: D42554647
fbshipit-source-id: d5ec178ad8981d92214300f8663e5bc13981357d
Summary:
D42050143 (e77e67bba7) / e77e67bba7
changed the default behavior for `sl pr submit` in hopes of
being more performant [by rearchitecting things so that more
work could be done in parallel], but ended up causing the following
issues:
- could not be used with repos that disabled GitHub issues: https://github.com/facebook/sapling/issues/371
- unexpected failures when trying to convert a placeholder issue
to a pull request (such as https://github.com/facebook/sapling/issues/384)
meant that users often found themselves with stale placeholder issues
- third-party tools, such as Slack apps, that have triggers based on the creation
of new GitHub issues, find this noisy: https://github.com/facebook/sapling/issues/383
This diff changes `sl pr submit` such that it defaults to the previous
behavior (in which pull requests are created in series, rather than in
parallel, and is subject to a race condition where pull request numbers
may not match branch numbers), though for now, it still makes the
old behavior available behind a boolean config, `github.placeholder-strategy`.
Because quite a few changes were made to
`eden/scm/edenscm/ext/github/submit.py` since D42050143 (e77e67bba7)
was committed, this diff is not a straight revert of the
original diff.
Reviewed By: muirdm
Differential Revision: D42550052
fbshipit-source-id: 68d6d1e00b5af2d166b7e3aab2dda959fae5de82
Summary:
Running 'hg cloud sl' shows remote bookmarks printed twice in the commit tree.
The issue is caused by remote bookmarks added at to the general bookmarks field at: `eden/scm/edenscm/ext/commitcloud/baseservice.py (lines=395)`
and again in the template used to render the hg cloud sl command (sl_cloud).
I have updated the sl_cloud template to no longer add the remote bookmarks a second time, by creating a new config option 'sl_cloud_books' to be used by the template. I have included this change in all files containing configuration for sl_cloud.
Reviewed By: liubov-dmitrieva
Differential Revision: D42531237
fbshipit-source-id: 1ed70c3072531c138757e760e60f0d6ae8d810b6
Summary: Will use fs2's locking feature in the next diff.
Reviewed By: zzl0
Differential Revision: D42492666
fbshipit-source-id: 05f66ce7a833865bd3ced08ff574f3c23f3a1e82
Summary:
Treestate can be corrupted by concurrent writes.
This is used to verify the fix in a later diff.
Reviewed By: zzl0
Differential Revision: D42492671
fbshipit-source-id: b5ede9f66e85cef4b5bfd7ae1732ab04f258b13b
Summary:
Moves the `gh_run` function to `github_repo_util`, since it can be used by some other functions that need to call the `gh` binary.
This also changes `os.execv` for `subprocess.run`, since `subprocess.run` can have more flexibility in regards to obtaining the exit code and the output of `gh`. Also, using `subprocess.run` makes using `gh` on `.t` tests easier when using the `requires` keyword in this kind of tests.
Reviewed By: bolinfest
Differential Revision: D42221074
fbshipit-source-id: 5e7e002fdec01e1bad7b32e4ef1f8478c57d4d23
Summary:
Use the scheme extension directly to expand the scheme. This allows paths like "fb:fbsource" to turn into the right Mononoke URL.
Perhaps the schemes translation should be integrated directly into the path machinery.
Reviewed By: markbt
Differential Revision: D42396672
fbshipit-source-id: 1f0ca64ee175c7041e6483539c74c60d663fe1d7
Summary:
return phases from server if they are known
As we discussed, with edenapi strait after the "commitgraph" request we need to
ask the sever for the mutations for draft commits. Computing drafts on client
side is ok but extra overhead since the phases have been calculated already
server side for derivation purposes (derive filenodes for public roots to
support linknodes). It would be nice to return them, so the client can use if
they want.
Reviewed By: RajivTS
Differential Revision: D42451892
fbshipit-source-id: db94a6b14b9a8e1966d2355806b569d6abee546d
Summary:
disable min speed check for commit graph requests.
for commit graph request, server returns result once it is fully ready, due to phases calculation and derivation filenodes for public roots, so the check must be disabled.
we still have a general timeout for an edenapi request, that is configured as 30 min, so enough for hg pull commands to complete for all edge cases, including aosp repo pulls of other main lines.
Reviewed By: muirdm
Differential Revision: D42478560
fbshipit-source-id: ff73cafee78175e07bc6379658f081c393aa91d3
Summary:
currently, hg crashes with below error when 'hg split' and resize terminal window (both VS Code terminal and normal terminal)
```
File "/opt/fb/mercurial/edenscm/crecord.py", line 1788, in main
return self._main(stdscr)
File "/opt/fb/mercurial/edenscm/crecord.py", line 1839, in _main
keypressed = curses.keyname(self.statuswin.getch()).decode("utf-8")
ValueError: invalid key number
```
Reviewed By: muirdm
Differential Revision: D42399034
fbshipit-source-id: 40d05c11ed1e901375c7356789e2b209fc67e788
Summary: lazytext backend requires edenapi so avoid the migration if the repo has no edenapi client (similar to "lazy" migration).
Reviewed By: quark-zju
Differential Revision: D42316095
fbshipit-source-id: 291e54612ef49ab458612f659a71e3fb2f8cf437
Summary:
Pyre automation added `dbm._Databse` in D42385084 (c95dcdc664). But `dbm._Databse` does not
exist and cause
$ hg bookmark book1
Traceback (most recent call last):
File "eden/scm/edenscm/__init__.py", line 86, in run
dispatch.runchgserver(args[2:])
File "eden/scm/edenscm/dispatch.py", line 368, in runchgserver
_preimportmodules()
File "eden/scm/edenscm/dispatch.py", line 348, in _preimportmodules
extensions.preimport(extname)
File "eden/scm/edenscm/extensions.py", line 208, in preimport
mod = getattr(__import__("edenscm.ext.%s" % name).ext, name)
File "eden/scm/edenscm/ext/copytrace.py", line 169, in <module>
) -> Tuple[Optional[dbm._Database], Optional[Tuple[Type[dbm._error], Type[OSError]]]]:
AttributeError: module 'dbm' has no attribute '_Database'
Reviewed By: zzl0
Differential Revision: D42456269
fbshipit-source-id: f6494f66b0676b5f2525110bc04060db9d85c027
Summary: fix typo in the help message of commit
Reviewed By: muirdm
Differential Revision: D42415448
fbshipit-source-id: 2cd64303af845f9f47d4fae9b45e18920484ce13
Summary:
add a way to try commitgraph and commitgraph2 edenapi endpoints
so, we would have some end to end integration with hg client to try pulls with new commit graph
Reviewed By: mitrandir77
Differential Revision: D42416426
fbshipit-source-id: 98ad2aba5beedec4c6973be8d281b2f2f270e916
Summary:
The config "Options" object includes filter functions that can arbitrarily mutate or filter out any config value as the config is being loaded. One important place filters are used is to drop command alias configuration when running under HGPLAIN mode. (Note that I feel it would be better to not mutate the config and instead skip the aliases during command dispatch, but I didn't attempt to make that change.)
The recent static config improvements accidentally skirt the config filters. This meant aliases were respected with HGPLAIN=1. For example, this caused "jf submit -s" to pop open an editor because jf runs "HGPLAIN=1 hg metaedit ..." and there is a built in alias for metaedit => "metaedit --batch", and "--batch" forces an editor to pop up when there is more than one revision to edit.
Fix by computing static config "overrides" based on anything that is filtered out. Any overrides are layered in on top of the static configs.
Reviewed By: zzl0
Differential Revision: D42395024
fbshipit-source-id: 2f5b4420f3583bab9cc642aae8e3c1f1d0ff952e
Summary: Some times you just want to see all the config values, including builtins.
Reviewed By: zzl0
Differential Revision: D42395025
fbshipit-source-id: d15a38583f7e87c56f45989c5be25782f33b768d
Summary: Move this code in preparation to use it in a second spot.
Reviewed By: zzl0
Differential Revision: D42395026
fbshipit-source-id: 835359c63e20576ef8f28efaca70ed2855b75455
Summary:
Use `ui.system()` instead of `os.execv()` to run `gh list`.
As described in https://github.com/facebook/sapling/issues/363,
the existing logic did not work correctly in the presence of `chg`.
Pull Request resolved: https://github.com/facebook/sapling/pull/377
Test Plan:
Build Sapling from source and verify that `sl pr list` works with
various arguments.
Verified it works on Windows, where `chg` does not exist, but it
was important to verify that `util.shellquote()` did the right thing
[where `shlex.quote()` did not].
On macOS, I had an instance of `chg` running that exhibited the bug
described in https://github.com/facebook/sapling/issues/363.
After running `sl --kill-chg-daemon` once, I then ran `sl pr list`
with my dev build of `sl` that contained this change and verified
that it fixed https://github.com/facebook/sapling/issues/363.
That is, running `sl pr list` now returns control to the terminal
*after* running `gh pr list` and showing its output.
---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/sapling/pull/377).
* __->__ https://github.com/facebook/sapling/issues/377
Reviewed By: akushner
Differential Revision: D42299741
Pulled By: bolinfest
fbshipit-source-id: 0970f1b7c729e5694cacfc2a07889cbb2e0e1e8a
Summary:
Previously it triggered a checkout error by setting bad permissions on a directory checkout needed to write to. However, nothing guaranteed that other files were successfully written to before the permission error, so sometimes zero files were skipped when continuing the checkout (which failed the test). Now we use a pre-existing failpoint to fail the checkout. Hopefully this works now on Windos as well.
I also reduced the size of test data from 5002 files to 2.
Reviewed By: zzl0
Differential Revision: D42256394
fbshipit-source-id: d3016779b5bbd734a0f00afd2885b63218dedaae
Summary: Don't use f-string since that precludes use of the i18n framework. Instead, use _() to (potentially) translate the format string, then substitute the format verbs.
Reviewed By: bolinfest
Differential Revision: D42251176
fbshipit-source-id: af7e20d2fc8c81fd04e8c366373c46e333e09635
Summary:
The default casecollisionauditor reads all of dirstate._map by iterating through it. This is expensive for a large repo and eden now raises RuntimeError for the iterator method. Please check D3964461 (73f0e3dd41) for more info.
As Jun pointed out:
* For non-edenfs we would always use treestate, therefore the original `if not dirstate._istreestate and not dirstate._istreedirstate:` check always evaluate to `False`.
* For EdenFS, due to above reason, we should not go into the `then`-part of the if statement.
So we can just delete the `then`-part of the if statement:
```
if not dirstate._istreestate and not dirstate._istreedirstate:
allfiles = "\0".join(dirstate._map)
self._loweredfiles = set(encoding.lower(allfiles).split("\0"))
```
Reviewed By: quark-zju
Differential Revision: D42210487
fbshipit-source-id: 6c5d5daca9dd85deae6505344a4abad2cafb2831
Summary:
Metalog committing should go through the transaction layer. The transaction
layer ensures all metadata are consistently updated atomically, and ensures the
description of metalog is in a certain format.
Let's migrate snapshot to use transaction for metalog write instead.
Reviewed By: yancouto
Differential Revision: D42203509
fbshipit-source-id: b5ecd90c52389add7bdc40ebd383b05bb586470f
Summary:
The command flags of `push` is not obvious. A common mistake is
`push --to remote/main` (which will create a `remote/remote/main` remote
bookmark).
This diff changes the logic to accept `push remote/main`,
`push --to remote/main` or `push default/main` to do the obvious thing for a
better UX.
Reviewed By: muirdm
Differential Revision: D42203177
fbshipit-source-id: d73647823c147dbdbce58c71a04dd4965e8ac2fb
Summary: The forcecompat config is not used. Therefore remove it.
Reviewed By: muirdm
Differential Revision: D42203299
fbshipit-source-id: 36f7b86661e8ecc716f223daf7cefadd7ced76b0
Summary:
This matches the Git behavior. Update committer and date by default.
`test-git.t` is changed since some commits have committer written by Git with
`test <test@example.org>` and this diff rewrites the committer to `test <>`.
Reviewed By: sggutier
Differential Revision: D42200687
fbshipit-source-id: 0d40ad0868e89cbe0cf932782bfe4f74d42c9e65
Summary:
Scp-like git urls like "user@host:path" are common, but Sapling wants proper ssh urls like "ssh://user@host/path". clone already converts to the desired format. Now, "paths" also converts scp-like urls to ssh urls when adding a new remote.
Fixes#196.
Reviewed By: quark-zju
Differential Revision: D42196319
fbshipit-source-id: 3a27027a17fa770ab1291ace654ecff95a63afef
Summary: The existing config editting code didn't look correct in all cases, so let's standardize on rcutil.
Reviewed By: quark-zju
Differential Revision: D42196320
fbshipit-source-id: 2dd325fc527a9b0ecf10827651a3655591e232e5
Summary: Going to use this in next diff.
Reviewed By: quark-zju
Differential Revision: D42196323
fbshipit-source-id: 38e79307213cf850c45dc96c8e87712e0f295518
Summary: When adding a secion.name=value config item, we now check if "[section]" already exists, and if so append the config item. Previously, we always created a new "[section]" entry at the bottom.
Reviewed By: quark-zju
Differential Revision: D42196321
fbshipit-source-id: 94630cee893683f54b5cb4ea954bd19e5ce324c3
Summary: A recently added tripwire check was misfiring for this test. Fix by stripping quotes off the path before testing for absoluteness.
Reviewed By: zzl0
Differential Revision: D42196915
fbshipit-source-id: 7db29dad02f89f7bd27b25cd239c300226e63375
Summary:
Revive the "bookmark --remote" flag to allow querying Git refs. There are some pattern aliases "branches", "tags", and "prs" which can be used for convenience to trim off the leading "refs/*". Or, you can specify "git ls-remote" patterns directly, such as "refs/heads/*", in which case no trimming is done.
Examples:
```
list remote branches:
sl bookmark --remote
list remote tags:
sl bookmark --remote tags
list all refs:
sl bookmark --remote 'refs/*'
list branches from specified path:
sl bookmark --remote --remote-path my-fork
```
I moved the "--remote-path" flag from the infinitepush extension to the remotenames extension so it can be used for choosing the Git remote. remotenames is a required extension, so this should be safe.
Reviewed By: quark-zju
Differential Revision: D42183496
fbshipit-source-id: 58892fe9203ae7471663faef078e37f90199454c
Summary: Now if you give --updaterev/-u a branch name, we will include it in "names" when doing the initial pull. If you specify a 40 byte commit hash, we include it in "nodes". This makes it possible to (easily) clone and goto an arbitrary branch or commit.
Reviewed By: quark-zju
Differential Revision: D42183498
fbshipit-source-id: 4fd821de809501f7a4bc8936b35a886511bd8106
Summary:
In-memory rebase and on-disk rebase are quite different in terms of code paths
used for submodule handling. Let's run the test cases through both
configurations.
Reviewed By: sggutier
Differential Revision: D42193838
fbshipit-source-id: 9cddb84fad667bb8f2b6334da185e931e3127990
Summary: This will be used by the next change.
Reviewed By: sggutier
Differential Revision: D42193839
fbshipit-source-id: 9c287cd76574cb899031d3fee1e5e832f2c1fd76
Summary:
Move the "showing commit description with submodule commit description" logic
to a function so it can be used in all test cases.
Reviewed By: bolinfest
Differential Revision: D42186691
fbshipit-source-id: a142eb8443b3ace1936556817af68a1287c7b336
Summary:
Rebasing a stack that contains submodule change to the destination with
conflicted submodules should not crash.
The current implementation might be not the final UX. But at least it no longer
crashes.
Reviewed By: bolinfest
Differential Revision: D42184286
fbshipit-source-id: da5bc4a8b4caf60673e159955a0f1153510a9ca3
Summary:
Rebasing a stack that contains submodule change should preserve the change in
the destination, if the destination does not change the submodules.
Reviewed By: bolinfest
Differential Revision: D42184288
fbshipit-source-id: 678a931ece444a008b7d8cb34741e271579469f3
Summary: Implement a naive submodule merge logic that can be used by rebase.
Reviewed By: bolinfest
Differential Revision: D42184287
fbshipit-source-id: fdb8e83733aa8a295405085ac1e5ace526c3421b
Summary: This function will be used in other places.
Reviewed By: bolinfest
Differential Revision: D42185597
fbshipit-source-id: e464ab83893bfe3f3476003295c4cf4bb50ed9bc
Summary: This function will be used in other places.
Reviewed By: bolinfest
Differential Revision: D42185598
fbshipit-source-id: 7805f1fe1b86862c49af9c81805b01285a9df782
Summary: as mentioned in D42078459 (ef9830b244), we in favor of `edenscm.Result` since it's more generic and feature complete.
Reviewed By: bolinfest
Differential Revision: D42122290
fbshipit-source-id: 6750818aa8bbd3c81fd9a8e40c43f999848db949
Summary:
Currently we enabled `prmarker` extension in sapling.rs config, and also added a post pull hook for calling the command of `prmarker` extension, but in some corner cases, the hook triggers other `sl` binary, and will cause "no debugprmarker" warning message.
```
post-pull.prmarker=sl debugprmarker
```
This diff is to enable `prmarker` for all git repos. BTW: it's safe to enable this extension for non-GitHub repo, it will just exit if the repo is not a GitHub repo.
Reviewed By: quark-zju
Differential Revision: D42181509
fbshipit-source-id: 976009a570bb476194f69b99feabf7256467f320
Summary:
When there is no response for a request, the test should
print out the other requests that were known to `MockGitHubServer`.
The test debugging experience still needs to be improved,
but at least this is a start.
Reviewed By: muirdm
Differential Revision: D42143989
fbshipit-source-id: 919ce741c6ebddc0025b67aad6e25f569cddbf18
Summary:
Previously, in our Sapling port of ghstack, we were interpreting `HEAD`
from Git as the result of:
```
sl log -r 'max(descendants(.))' -T '{node}'
```
which was forcing ghstack to always operate from the tip of your feature
branch rather than where you are. This updates the code so that `HEAD`
is interpreted as `sl whereami` so you can submit only your current commit
and the commits *below* it in the stack as pull requests.
Fixes https://github.com/facebook/sapling/issues/283.
Reviewed By: muirdm
Differential Revision: D42121060
fbshipit-source-id: 9ea54c200b9d7938225a858ef2421bc5cf4b78e5
Summary:
GitHub's `gh` CLI has a number of useful subcommands under `gh pr`.
When run in a Git repo, `gh` can automatically figure out the appropriate
value to use with the `--repo` flag, though that is not the case in Sapling.
In this case, we do a small amount of plumbing to implement
`sl pr list [flags]` so that it execs the analogous `gh pr list [flags]` call.
This pattern should work well for supporting more `gh pr` commands.
Reviewed By: muirdm
Differential Revision: D42120917
fbshipit-source-id: 51bd51f46cd15fc9e4bbde631adfe24646b0efb7
Summary:
This adds a key subcommand, `sl pr pull`, that facilitates
importing a stack created by `sl pr submit` in another working copy.
This is the `sl pr` analogue to `sl ghstack checkout`.
Reviewed By: muirdm
Differential Revision: D42116136
fbshipit-source-id: 94423f6bd15ab07771bdb671994912a1c0354137
Summary: This makes it possible to amend submodule changes to fix mistakes.
Reviewed By: bolinfest
Differential Revision: D42182504
fbshipit-source-id: 2fc416a1741d427c7b8fbed2c0514c10102e4e11
Summary: As the title. This verifies the next diff actually fixes the bug.
Reviewed By: bolinfest
Differential Revision: D42182508
fbshipit-source-id: 412c7d1559a8e8c9b50479171d84ec8511e58c91
Summary: Revert related tests will be expanded.
Reviewed By: bolinfest
Differential Revision: D42182506
fbshipit-source-id: 519be2b7f5c9c99b347520a794a2656e992b6ad7
Summary:
Make drawdag flexible so it can be used to create commits with submodule
changes.
Reviewed By: bolinfest
Differential Revision: D42182507
fbshipit-source-id: 1f68daaf4c5f17ae11b231a0b6afe9748bc4a82d
Summary:
In hgmain, set the environment variable NoDefaultCurrentDirectoryInExePath to disable the default Windows behavior of including the current working directory in PATH.
This avoids security issues where sl could execute a binary from the CWD (i.e. untrusted repo's working copy) instead of the proper system binary. For example, if the repo contains a binary named "watchman", code such as `util.popen4("watchman debug-status")` would prefer the repo's "watchman" to the system watchman.
Setting NoDefaultCurrentDirectoryInExePath assumes there is no legitimate use of this behavior when running other programs from within sl. I wouldn't be surprised if _something_ is depending on this behavior, but it doesn't seem like anything _should_ depend on it.
I like this approach since it should prevent all occurrences of this issue (i.e. including Python, Rust, ISL, etc). Another approach that isn't totally mutually exclusive with this approach is to add runtime checks to make sure we aren't accidentally running programs from the working copy (but still allow the CurrentDirectoryInExePath behavior). That seems harder to implement and verify/maintain.
Reviewed By: quark-zju
Differential Revision: D42154134
fbshipit-source-id: f625bb51e470c320ac96f803b55cb2c4ab4e44ec
Summary: Since Python 3, this was a no-op on all platforms.
Reviewed By: quark-zju
Differential Revision: D42158008
fbshipit-source-id: a25065037079cb136a6e54579a5373a9791cb3f0
Summary:
In D42154134 we want to disable the default Windows CWD-is-in-$PATH behavior. However, that also disables all relative path invocation (e.g. `system("foo/bar", cwd=repo.root)` would still work on Posix systems, but fail on Windows because Windows would no longer search ".").
I looked through our subprocess usage and this was the only example I could find.
I tried to also add a tripwire warning message to help discover more/future uses that might not work with D42154134.
Reviewed By: quark-zju
Differential Revision: D42158007
fbshipit-source-id: df94502244937c01ea2f1e025833d9699574523d
Summary: I don't think we use this, and it includes a "shell:" gateway to invoke arbitrary commands.
Reviewed By: quark-zju
Differential Revision: D42158009
fbshipit-source-id: 514da6fdf9b1644db98d48fe4a9aaca4c6096515
Summary:
Before this change, the rebase command would error out on public commits when using the `-b` option and rebase backwards. For instance, if one had the following graph:
```
Y
|
X B
\ /
A
```
and both `A` and `B` were public commits, while `X` and `Y` weren't, `rebase -b Y -d X` would try to move `B` on top of `X` and complain about `B` being a public commit.
This diff makes rebasing with `-b` slightly smarter, by trying to find the appropriate bottom-most non-public commits to be rebased.
Reviewed By: quark-zju
Differential Revision: D42087621
fbshipit-source-id: bd5b5e7b6b1716f72929b405beb53906d92614f1
Summary:
Implicitly panicking methods like `TimeZone::timestamp` are deprecated as of chrono 0.4.23.
```
warning: use of deprecated associated function `chrono::TimeZone::timestamp`: use `timestamp_opt()` instead
--> buck2_common/src/cas_digest.rs:330:13
|
330 | Utc.timestamp(self.inner.expires.load(Ordering::Relaxed), 0)
| ^^^^^^^^^
warning: use of deprecated associated function `chrono::TimeZone::timestamp`: use `timestamp_opt()` instead
--> buck2_build_api/src/actions/impls/cas_artifact.rs:234:60
|
234 | let dir = re_tree_to_directory(&tree, &Utc.timestamp(0, 0))
| ^^^^^^^^^
warning: use of deprecated associated function `chrono::TimeZone::timestamp`: use `timestamp_opt()` instead
--> buck2_build_api/src/interpreter/rule_defs/context.rs:925:43
|
925 | let expires_after_timestamp = Utc.timestamp(expires_after_timestamp, 0);
| ^^^^^^^^^
```
Reviewed By: zertosh
Differential Revision: D42177451
fbshipit-source-id: fd0ba0a37b02316e3fcd67737049a53dffb94ed2
Summary:
For native "status" (and "config") commands, we now respect various flags and configs to determine if we should enable pager. Previously the only thing we checked was stdout.is_tty().
We don't support _everything_ Python does (e.g. don't support pager.ignore list of commands), but this is probably good enough for now.
Reviewed By: quark-zju
Differential Revision: D42088976
fbshipit-source-id: 171588f11f1b5c5f7f86ce55298ee9a1377610f7
Summary:
This at least indicates to the user what they are waiting for.
We should port the recrawl progress bar to Rust as well, but that is a bit more work.
Reviewed By: quark-zju
Differential Revision: D42088974
fbshipit-source-id: 2fc5e1ac2b69d8416ca6382e7131db131e7bdead
Summary:
Log the number of files returned and whether it was a fresh instance. Also, instrument the watchman query so it shows up in perftrace, and populates the watchmanquery_time field.
Note that I didn't go through the hgmetrics stuff and instead logged straight to tracing. hgmetrics currently only makes it to scuba for Python commands.
Reviewed By: quark-zju
Differential Revision: D42088975
fbshipit-source-id: 38a2a647f9e3ce9b612d8f203fc3777c259698b9
Summary:
Send sync_timeout in Rust to match what we do in Python. Not sure if this matters, but I'm trying investigate/fix p90+ Rust status being slower than Python in some situations.
I observed that Rust is faster most of the time except for some (big) spikes where it isn't, so I looked at timeouts. Note that the Rust watchman client doesn't seem to have a configurable client side timeout (which Python does have).
Reviewed By: quark-zju
Differential Revision: D42088977
fbshipit-source-id: da12dc4d2bb5df96ce9855b835aa5fa8a8509012
Summary: raw-api allows access to the underlying DashMap shards, which I need.
Reviewed By: davidbarsky
Differential Revision: D42132672
fbshipit-source-id: 22b753f3ec95c85526f96a9e26d28379b2b4179b
Summary:
Point the user to "sl configfile" instead of trying to list the config file locations statically.
Also, get rid of blurbs about per-installation config file and built in config files because they don't really apply anymore.
Reviewed By: quark-zju
Differential Revision: D42156409
fbshipit-source-id: 9fed8723d87c95f818a4fcfd323a310c4dd65060
Summary:
We call it "eden rage" everywhere else, so searching hg rages for
"edenfs rage" is always unintuitive to me. Let's rename the header to
"eden rage".
Reviewed By: quark-zju
Differential Revision: D42152264
fbshipit-source-id: 32ecb8f935aaf386c5148586fb9cb8f9e4a4089f
Summary: There are some OSS users that have the `gdbm` module installed, but for some reason it doesn't contain the `open` function. This diff adds an additional check for it.
Reviewed By: quark-zju
Differential Revision: D42116597
fbshipit-source-id: 0700650120f5442a0dd738221e7d4dee57552012
Summary:
Currently, we append both `tuple` and `list` types to `outbookmarks`, which causes TypeError like below:
```
- Traceback (most recent call last):
File "/opt/fb/mercurial/edenscm/commands/__init__.py", line 4984, in push
pushop = exchange.push(
File "/opt/fb/mercurial/edenscm/exchange.py", line 506, in push
_pushdiscovery(pushop)
File "/opt/fb/mercurial/edenscm/exchange.py", line 620, in _pushdiscovery
step(pushop)
File "/opt/fb/mercurial/edenscm/ext/remotenames.py", line 624, in expushdiscoverybookmarks
return exchange._pushdiscoverybookmarks(pushop)
File "/opt/fb/mercurial/edenscm/exchange.py", line 757, in _pushdiscoverybookmarks
pushop.outbookmarks.sort()
TypeError: '<' not supported between instances of 'tuple' and 'list'
```
Reviewed By: quark-zju
Differential Revision: D42151253
fbshipit-source-id: e9eacc6530d8302ce102f0bed069066ec6932e88
Summary:
Introduces a helper function to parse the stack information
originally written to a pull request body by
`create_pull_request_title_and_body()`.
Reviewed By: zzl0
Differential Revision: D42117514
fbshipit-source-id: 43c6580a3774ae2e44108298a88b3b597a3b2c01
Summary:
In a subsequent diff, we need to add logic for parsing
the pull request body, so we should encapsulate this in
its own file.
This also makes `submit.py` 50 lines shorter!
Reviewed By: zzl0
Differential Revision: D42117031
fbshipit-source-id: da5837f619c9cc02ba01dd04f227f63c73cd39fb
Summary:
As suggested on https://github.com/facebook/sapling/issues/191,
this moves the Sapling stack information below a horizontal rule
so the author's commit message appears first.
As noted in the PR, this will require a complementary change to
ReviewStack to recognize this new pattern.
Reviewed By: zzl0
Differential Revision: D42116914
fbshipit-source-id: c2e3afbf2233849046c5986133f43fcb0e527ed7
Summary:
We need this for two things:
- In `sl pr submit`, we can often avoid updating every pull request
when the user runs `sl pr submit --stack`, but we need to make
sure the message does not have to change.
- In `sl pr get` (upcoming change), we need to be able to parse the
stack information for the pull request we are importing.
Reviewed By: zzl0
Differential Revision: D42114153
fbshipit-source-id: 31a3407c509ec4809c5dfcfeb85b6b147be7c70a
Summary:
Renames `add_pr_head_to_archives()` to `add_commit_to_archives()`
to more accurately describe what the function does.
Includes additional documentation cleanup to reflect this change.
Reviewed By: zzl0
Differential Revision: D42112392
fbshipit-source-id: 42f3e0b816117da0ab002aa1490e9cab3b4db453
Summary:
This moves `add_pr_head_to_archives()` out of `submit.py`
and into its own file, `archive_commit.py`. Of note:
- This makes `submit.py` 300 lines shorter.
- This makes it possible to reuse `add_pr_head_to_archives()` in `sl ghstack`
Note that the `run_git_command()` and `none_throws()` functions
are shared across `submit.py` and `archive_commit.py`, so they
were moved into their own files.
Reviewed By: zzl0
Differential Revision: D42108697
fbshipit-source-id: 27827658ea56a6644b4a024a0e839c5d74e71b47
Summary:
This appears to have been an oversight when this function
was written as the example for the doctest was written
but never evaluated.
Reviewed By: zzl0
Differential Revision: D42110434
fbshipit-source-id: f1af32514324ef7bf2683612deb4f1dbd60a4bb7
Summary:
This introduces an experimental new pull request workflow
named "single" because it creates a single PR per commit.
To enable it, run:
```
sl config --local github.pr_workflow single
```
It is similar to ghstack with the following notable differences:
- Instead of creating three branches for each commit
(`orig`, `base`, `head`), it creates only one. This makes it
straightforward to work with the branches directly, if desired.
- It updates a stack via force-pushing. This can be problematic
in GitHub where comments on earlier versions may get lost
in the course of force-pushing. Our hope is that we can
use ReviewStack to workaround this issue.
See https://github.com/facebook/sapling/issues/302
Reviewed By: zzl0
Differential Revision: D42062506
fbshipit-source-id: 2d29784cfbf40ab09421cc364d10230a4463fba6
Summary: added tests for `sl pr submit`, the test uses `extensions.wrapfunction` to wrap the original `make_request` and `run_git_command` functions (registered in `mock_create_one_pr.py`), so we can replace the network requests with mock data.
Reviewed By: bolinfest
Differential Revision: D42037042
fbshipit-source-id: 011bfcb2400200baecf547ec0b18b0154ff580a9
Summary: By default drawdag creates files. Make it possible to disable it using flags.
Reviewed By: muirdm
Differential Revision: D42102946
fbshipit-source-id: 0fa91ffb34d569238a477378bb87be37ef3b75c4
Summary:
The command creates a revlog repo for compatibility with Mononoke blobimport
and open-source Mercurial. Threrefore it should always use `.hg`.
Reviewed By: muirdm
Differential Revision: D42102948
fbshipit-source-id: 341ccbc35cbdae86311bcf7c8c8b076168332f5a
Summary:
Most modern terminals "auto-bright" when text is also bold. However, the
website ANSI -> HTML converter does not do that. In practice we pretty
much rely on the "auto-bright" behavior. So let's update the smartlog
colors with bright versions to make it more explicit.
Reviewed By: muirdm
Differential Revision: D42102947
fbshipit-source-id: 867d6947a5db0fe59a627ff2bd9a82621d28bfe5
Summary:
It turns out `unsetting TESTTMP` is not a great idea for loading production
configs, since there might be other references to it, for example:
[remotefilelog]
cachepath=$TESTTMP/foo/bar
in test hgrc relies on runtime expansion of `$TESTTMP`.
For documentation purpose, we do want to load the "prod" config including the
templates and colors. Make it possible using `TEST_PROD_CONFIGS`.
Reviewed By: muirdm
Differential Revision: D42102951
fbshipit-source-id: baa82b85873f0793b3b873b9a63bb7865e28787b
Summary:
When I tried to create a real repo with TESTTMP unset for documentation, I got
mysterious errors like:
File "/opt/fb/mercurial/edenscm/dirstate.py", line 186, in make_treestate
ui, opener, root, self._repo._rsrepo.workingcopy().treestate()
# root = '$TESTTMP/repo1'
error.WorkingCopyError: working copy is missing information or corrupt: No such file or directory (os error 2) at path "$TESTTMP/repo1/$TESTTMP/.tmp2f2UD9 (ef5a29b32a)"
This diff adds tracing logs in various layers to help narrow it down.
The error message is changed since the underlying errors can be unrelated to
the working copy directly.
For now I just trace the mysterious error down. Note the logs are for component
initialization, which usually just run once. They are not in hot paths to
affect performance.
A more systematic solution might be using the `fn_error_context` crate and
enforce functions returning errors to attach context.
Reviewed By: muirdm
Differential Revision: D42102949
fbshipit-source-id: 6060bebe280a72ab6cd32e4d0eb55e5332612287
Summary: On *nix, optionally read <user>:<group> from SL_DEBUG_DROP_ROOT and try to switch user/group. This is useful when tying to run sl under DTrace since DTrace requires root, but sl in general does not work when running "unexpectedly" as root.
Reviewed By: quark-zju
Differential Revision: D42088978
fbshipit-source-id: b625af9859994b368b127837610bf36b0f250bc5
Summary: getScmStatusv2 has been around for years, so lets kill the fallback.
Reviewed By: quark-zju
Differential Revision: D42074065
fbshipit-source-id: 1a655d571253326ad0c4ff1ddf06525bae0f164f
Summary:
Python status has some logic to ignore changes to symlinks on platforms that don't support symlinks. This diff ports that logic to Rust as well.
The issue appeared on Windows with symlinks inside node_modules/.bin directories. On Windows when you run "yarn", the symlinks are overwritten with wrapper scripts (since symlinks are not supported). The Rust status was showing those as modified files, buy Python had special logic to ignore "suspect" changes to symlinks.
Reviewed By: quark-zju
Differential Revision: D42016078
fbshipit-source-id: 18d0f41253611fab28e36aa4f720534144008d3f
Summary: In Rust, we now properly expand environment variables in ui.ignore.* paths. In particular, the default config "ui.ignore.system=%PROGRAMDATA%\Facebook\Mercurial\gitignore" on Windows now applies properly since we expand "%PROGRAMDATA%" when loading the ignore files.
Reviewed By: quark-zju
Differential Revision: D42016077
fbshipit-source-id: d7ad2d7c0e60334dab3e03eb26922e8127274c9b
Summary:
Replaces D41855449.
This diff updates:
- rust-analyzer to 2022-12-12's release.
- bumps `dashmap` to 5.4.0 from 5.2.0
- bumps `windows-sys` to 0.42, which unfortunately necessary because `dashmap` bumped their minimum version of `parking_lot` internally.
- bumps `notify` from the pre-release builds to 5.0
allow-large-files
Reviewed By: zertosh
Differential Revision: D41971461
fbshipit-source-id: 51c1d969d0cdcabcc37f2381e8c942fd0d0af765
Summary:
refactor 'make_request' usage to 'module.function' style, so we
replace it with a wrapper function by using 'extensions.wrapfunction'
Reviewed By: bolinfest
Differential Revision: D42100407
fbshipit-source-id: 822b5f292ca633e07d25b9f8dee638513df83869
Summary:
The hgrc format is quite simple. Writing a parser directly actually has similar
complexity to the pest parser, but with improved performance. Therefore let's
migrate off pest.
Before:
% buck2 run @//mode/opt :bench --
parse 645KB file 89.872 ms
load system and user 1.877 ms
load repo 4.107 ms
After:
% buck2 run @//mode/opt :bench --
parse 645KB file 31.501 ms
load system and user 0.757 ms
load repo 2.360 ms
Reviewed By: zzl0
Differential Revision: D42054371
fbshipit-source-id: 7dc84154cabec52ed7910e12fbac894845770076
Summary: Add a way to find duplicated or overridden configs for cleanup purpose.
Reviewed By: muirdm
Differential Revision: D42035995
fbshipit-source-id: 138964ffcfb9896ea69a850d1a9369405cedfa99
Summary:
It's a super long (>4K) config. Code search shows it's not used anywehere.
Therefore let's drop it.
I checked that `configs.legacylist` is also unused.
Reviewed By: muirdm
Differential Revision: D42036006
fbshipit-source-id: 82b886b9eb6abb50cacef7ee0f868280d45ab0a8
Summary:
Part of the internal dynamicconfig logic is actually just static. Move the most
obvious function common() to static config to avoid parsing overhead.
I dropped "DO NOT ADD NEW ENTRIES IN THIS FUNCTION !!!" since it no longer
applies - there is no function, and the static config macro is the right place
to update static configs.
Reviewed By: muirdm
Differential Revision: D42036002
fbshipit-source-id: a815715c83b751340e0181e4630371fe3b6f7932
Summary:
Move the opensource dynamicconfig to statically compiled config used by the
Sapling identity. This should reduce parsing time and make the internal `sl`
behave more closely with the external `sl`.
Reviewed By: muirdm
Differential Revision: D42036011
fbshipit-source-id: d45d6de0bac49d2d9397ff0556a4130cf7c93a84
Summary:
Use the `ConfigSet::secondary` added by D42023337 to include statically
compiled builtin merge-tools and core python configs. This avoids parsing cost.
Reviewed By: muirdm
Differential Revision: D42036010
fbshipit-source-id: 20bd724c31c4b5924c7124a35c859c9c66784c5d
Summary:
The "dropping" tracing messages would be useful to figure out exactly what
parts of config files are ignored.
Reviewed By: muirdm
Differential Revision: D42035997
fbshipit-source-id: 7f9f92510d445b23d357ff3fd6f891f14dbc4f80
Summary:
The underlying Rust method `ensure_location_supersets` only needs to be called once.
It's already called for `load` and `reload` paths. Therefore it's unnecessary
to call `ensure_location_supersets` again.
Reviewed By: muirdm
Differential Revision: D42036012
fbshipit-source-id: e181775a88880ea95da6399996367d1e30a8b31e
Summary: See the previous diff for context. Remove it since it's no longer used.
Reviewed By: muirdm
Differential Revision: D42025934
fbshipit-source-id: 31598893c78b103fa09d262f107c660aeb3a566a
Summary:
`ensure_location_supersets` has 2 features:
1. Verify hgrc.dynamic matches /etc configs. Report mismatches. This was the
initial purpose as you can see from the function docstring. At that time
the idea was that dynamicconfig matches /etc configs exactly (we no longer
do that).
2. Enforce `configs.allowedlocations` and `configs.allowedconfigs`. This was
added later - wasn't mentioned in docstring.
Feature 1 does not actually work, since the filenames of the /etc configs are
supposed set by `configs.validationsubset`, but is empty in production setup.
Worse, the existing logic would treat all config items as "mismatch" and
`uiconfig.reportissues` will report near 1000 config items.
Since feature 1 is already not working as intended, this diff drops it.
Logging via Rust tracing is added for changes by feature 2. Note we cannot
rely on Python `uiconfig.reportissues` logging because
`ensure_location_supersets` is called multiple times and it can only report
mismatches the first time, while the Python code does not call it the first
time.
Reviewed By: muirdm
Differential Revision: D42024668
fbshipit-source-id: fbe5cf42e45fb1e68e2d32ec27fbdfe00cb62170
Summary:
Add a way to get some ideas about the overhead of config loading.
An example benchmark run shows:
$ cargo bench --bench bench -- system
load system and user 1.873 ms
load repo 2.052 ms
Reviewed By: muirdm
Differential Revision: D42036000
fbshipit-source-id: 3f566fb0c3f8369d3e257f845b4d803a6742dd26
Summary:
This makes ConfigSet more flexible. It can include other kind of configs
(ex. staticconfig, unionconfig, etc) to form layers of configs.
Reviewed By: muirdm
Differential Revision: D42023337
fbshipit-source-id: 436b688bb4aa661a5dbaf5086e11f6edf7affb7b
Summary:
Historically, I was under the impression that it was impossible
to create a pull request with a specific number. As you can see
in this diff, we had a `guess_next_pull_request_number()` helper
function that had a "pretty good" heuristic for guessing the next
pull request number, which made it likely that we could make
the number encoded in the branch name match that of the PR.
Unfortunately:
- This heuristic was not guaranteed to work 100% of the time,
due to either races or deleted issues that could throw off the count.
- Using this heuristic required that we create the pull requests
serially [from bottom to top of the stack] rather than in parallel.
However, today while reading the REST API docs for creating a
pull request (https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#create-a-pull-request),
I noticed it was possible to specify an `issue`:
> An issue in the repository to convert to a pull request. The issue title, body, and comments will become the title, body, and comments on the new pull request. Required unless `title` is specified.
Ah ha! This meant we could first create a number of GitHub
issues (in parallel!) with placeholder data and then use the numbers
from these issues when creating pull requests (also in parallel)!
This also means we know the PR number when choosing the branch
name (recall the branch cannot be changed after creating the PR).
This diff updates the existing `sl pr` command to take advantage
of this information.
Reviewed By: muirdm
Differential Revision: D42050143
fbshipit-source-id: a52694f6599c4ba99f568c538d557e6d10db72a6
Summary:
With this change, running `sl pr submit --draft` will create any *new*
pull requests in draft mode. Commits already associated with a pull
request will not have their draft status changed.
Reviewed By: muirdm
Differential Revision: D42048510
fbshipit-source-id: fd1d1f1f1268b4deb9135f0f75115bbcc48d9ebe