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