Commit Graph

999 Commits

Author SHA1 Message Date
Jun Wu
3d9f195721 changelog: use Rust RevlogIndex for 'ancestor' revset function
Summary: This avoids depending on the C index if the Rust DAG is available.

Reviewed By: DurhamG

Differential Revision: D22519587

fbshipit-source-id: a89d91184feaeef6641d2b04353601297bf5d4d5
2020-07-30 20:00:41 -07:00
Jun Wu
49a25c9525 smartset: replace spanset with idset
Summary:
Replace the Python spanset with the Rust-backed idset.
The idset can represent multiple ranges and works better with Rust code.

The `idset` fast paths do not preserve order for the `or` operation, as
demonstrated in the test changes.

Reviewed By: DurhamG, kulshrax

Differential Revision: D22519584

fbshipit-source-id: 5d976a937e372a87e7f087d862e4b56d673f81d6
2020-07-30 20:00:41 -07:00
Liubov Dmitrieva
01c4613ba0 highlight the current workspace in the output of hg cloud list
Summary: It looks nicer if we highlight the current workspace in the list.

Reviewed By: mitrandir77

Differential Revision: D22826619

fbshipit-source-id: 416b77fb57d8dfe19057e248e12d411dfc5f9412
2020-07-30 06:10:18 -07:00
Liubov Dmitrieva
d266d99edf improve hg cloud rejoin behaviour to adapt to host workspaces.
Summary:
Some users on macs and dev servers are connected to their default workspace, other
 users after D22802064 will be connected to their machine workspace. Assume a
 user decides to reclone the repo. Currently, as a result of rejoin, the second batch of the users will
 automatically see all their commits from the default workspace and will be a bit
 surprised. It makes sense to adapt rejoin logic of choosing the default
 workspace if workspace name is not given.

Reviewed By: markbt

Differential Revision: D22817941

fbshipit-source-id: 764034c9f2d774051c5523cb2db093af525f27d7
2020-07-30 04:55:09 -07:00
Liubov Dmitrieva
ee53d3a7b4 improve ux of hg cloud list
Summary: Make the output more informative

Reviewed By: markbt

Differential Revision: D22803543

fbshipit-source-id: 35dd4ff0a1f1003690b250d5284e48e6abb4f4b1
2020-07-29 09:48:50 -07:00
Xavier Deguillard
21cd242dcf revisionstore: add a fallback remote lfs store
Summary:
If the LFS server is down, we are going to retry fetching filenode from the
Mercurial server directly, who is expected to not return a pointer.

Previously, this was achieved by adding a hack into `get_missing`, but since
the function is no longer called during prefetch calls, we cannot rely on it
anymore. Instead, we can wrap the regular remote store and translate all the
StoreKey::Content onto their corresponding hgid keys.

Reviewed By: DurhamG

Differential Revision: D22565604

fbshipit-source-id: 2532a1fc3dfd9ba5600957ed5cf905255cb5b3fd
2020-07-28 10:51:38 -07:00
Liubov Dmitrieva
543c7b3a88 fix sync of remote bookmarks
Summary:
The simplest fix so far is to erase accessed bookmarks state before switching

New cloud join will

Reviewed By: markbt

Differential Revision: D22791409

fbshipit-source-id: 9675ec03c275e42e640d3a95dd5eda2ae084b92b
2020-07-28 07:51:34 -07:00
Liubov Dmitrieva
727e6bfded implement switching workspaces.
Summary:
Switching workspaces is good to have before depracating old style backups.
Otherwise it will be too confusing for users who would like to keep their work
on different hosts separate.

Reviewed By: markbt

Differential Revision: D22692393

fbshipit-source-id: abae7667ce24465e69613f3cdd4cd01471fc7704
2020-07-27 05:54:12 -07:00
Xavier Deguillard
3a97764d70 revisionstore: add a new StoreResult type
Summary:
When using LFS, it's possible that a pointer may be present in the local
LfsStore, but the blob would only be in the shared one. Such scenario can
happen after an upload, when the blob is moved to the shared store for
instance. In this case, during a `get` call, the local LFS store won't be able
to find the blob and thus would return Ok(None), the shared LFS store woud not
be able to find the pointer itself and would thus return Ok(None) too. If the
server is not aware of the file node itself, the `ContentStore::get` would also
return Ok(None), even though all the information is present locally.

The main reason why this is happening is due to the `get` call operating
primarily on file node based keys, and for content-based stores (like LFS),
this means that the translation layer needs to be present in the same store,
which in some case may not be the case. By allowing stores to return a
`StoreKey` when progress was made in finding the key we can effectively solve
the problem described above, the local store would translate the file node key
onto a content key, and the shared store would read the blob properly.

Reviewed By: DurhamG

Differential Revision: D22565607

fbshipit-source-id: 94dd74a462526778f7a7e232a97b21211f95239f
2020-07-24 10:45:40 -07:00
Xavier Deguillard
41cc264acd revisionstore: fix bug on bundle
Summary:
In some rare situation, it is possible to have an LFS pointer in both the
packfile and the LFS store. In this case, the flags for this filenode may or
may not be empty, making the assert too strong.

Reviewed By: DurhamG

Differential Revision: D22565605

fbshipit-source-id: b82282b3f47af2a9e607f09a7a7d271ecc4e521a
2020-07-24 10:45:40 -07:00
Durham Goode
2a9bec9bd6 py3: fix test-simplemerge.py and test-simplekeyvaluefile.py
Summary:
I'm not sure how these landed, but they need fixes to work correctly in
python.

Reviewed By: sfilipco

Differential Revision: D22699596

fbshipit-source-id: fb6d237f4de92c5efa3b422ddb86117fc256460f
2020-07-23 15:27:41 -07:00
Durham Goode
fd61d337ea py3: fix test-revset-t.py
Summary:
It now passes

This also caught an issue with our wireprotocol serialization for non-ascii
bookmark names.

Reviewed By: quark-zju

Differential Revision: D22655896

fbshipit-source-id: 3312ff2fd13ebaea7988b18ace9a83137f40daa3
2020-07-22 19:00:42 -07:00
Durham Goode
b5e61e5486 py3: fix test-simplemerge.py
Summary: It now passes

Reviewed By: quark-zju

Differential Revision: D22654491

fbshipit-source-id: bdb6de0ac0ca181ce70915e3dd9bd72421375328
2020-07-22 19:00:42 -07:00
Durham Goode
823759ecc4 py3: fix test-simplekeyvaluefile.py
Summary: It now passes

Reviewed By: quark-zju

Differential Revision: D22654321

fbshipit-source-id: c1e327be69c4b0d41461422a4c0ff2e0d1bc28fd
2020-07-22 19:00:42 -07:00
Durham Goode
e336dd55d7 py3: fix test-fb-hgext-diff-since-last-submit-t.py
Summary: It now passes

Reviewed By: quark-zju

Differential Revision: D22654015

fbshipit-source-id: 8a0d97fa35b593ed012a2653e8ccf629854afc71
2020-07-22 19:00:42 -07:00
Durham Goode
e1b037aa35 py3: fix test-fb-hgext-remotefilelog-datapack.py
Summary: It now passes

Reviewed By: quark-zju

Differential Revision: D22653975

fbshipit-source-id: 8b6b39d9ff3dd8fa6d4bdc4fe28fc13a22efd9ff
2020-07-22 19:00:42 -07:00
Durham Goode
7011986ac2 py3: fix test-sparse-fetch-t.py
Summary: The test now passes

Reviewed By: quark-zju

Differential Revision: D22653782

fbshipit-source-id: 69dc2a364013848e8640c9f89e0552b6ce0fcd2b
2020-07-22 19:00:42 -07:00
Durham Goode
4cc3731d03 py3: fix test-sparse-profiles.t
Summary: It now passes

Reviewed By: quark-zju

Differential Revision: D22653171

fbshipit-source-id: 1c59bb0ab0140f569bdd24f0c19f651041be2f9c
2020-07-22 19:00:42 -07:00
Durham Goode
9eeb1d6412 py3: fix test-push.t
Summary: It now passes

Reviewed By: quark-zju

Differential Revision: D22652658

fbshipit-source-id: f7eb9e34067898e0220f3572fa142199eb5f7803
2020-07-22 19:00:41 -07:00
Durham Goode
065db9681c py3: fix test-merge-tools.t
Summary: It now passes

Reviewed By: quark-zju

Differential Revision: D22652124

fbshipit-source-id: 145ef33507ce1cf774a22841c1809a068720a80b
2020-07-22 19:00:41 -07:00
Durham Goode
6b12fdb38b py3: fix test-worker.t
Summary: It now passes

Reviewed By: singhsrb

Differential Revision: D22651796

fbshipit-source-id: 3383b42396127c5121b326d426f83d293bc49ed1
2020-07-22 19:00:41 -07:00
Durham Goode
b9d2e97a12 py3: fix test-journal.t
Summary: It now passes

Reviewed By: singhsrb

Differential Revision: D22651738

fbshipit-source-id: 24635ee344018574fd99e37781221fab82a2b4d7
2020-07-22 19:00:41 -07:00
Durham Goode
f36c5dda8d py3: fix tweakdefaults
Summary: The test now passes

Reviewed By: singhsrb

Differential Revision: D22651701

fbshipit-source-id: c698bee1453de6457398bfc56bd5d921da2d80ae
2020-07-22 19:00:41 -07:00
Durham Goode
72e59cb7ec py3: fix simplecache
Summary: The test now passes

Reviewed By: singhsrb

Differential Revision: D22651610

fbshipit-source-id: c745300ef8b92b1973f5f41b34738dfd470fcbce
2020-07-22 19:00:41 -07:00
Durham Goode
f0ea8f584d py3: fix hg doctor
Summary: The test now passes.

Reviewed By: singhsrb

Differential Revision: D22651357

fbshipit-source-id: 9c690f1ed12cd4bd2b337ed931e217b4cca667bb
2020-07-22 19:00:41 -07:00
Meyer Jacobs
586ada8de6 taggederror: introduce bail macro replacement which allows tagging
Summary: This change introduces a bail macro that allows tagging errors using the syntax `bail!(fault=Fault::Request, "my normal {}", bail_args)` or `bail!(Fault::Request, "my normal {}", bail_args)`.

Reviewed By: DurhamG

Differential Revision: D22646428

fbshipit-source-id: a6ec2940001b26db8ddc3a6d3620a1e17406c867
2020-07-22 15:37:14 -07:00
Saurabh Singh
3f07bece6b tests: fix test-fileset.t
Summary: This was unfortunately broken by D22468669 (0562c1220f).

Reviewed By: DurhamG

Differential Revision: D22656138

fbshipit-source-id: 96f276466b09ec0017967289c380a7dbf3d1ecea
2020-07-21 19:10:34 -07:00
Durham Goode
fec3f6ee4c py3: fix dirsync
Summary: The tests now pass

Reviewed By: singhsrb

Differential Revision: D22651024

fbshipit-source-id: 86d262d8526abe8cab5f55be0822cf9e4bc3e1b8
2020-07-21 18:22:59 -07:00
Kostia Balytskyi
fc61c74f23 live_commit_sync_config: make scs xrepo-lookup watch live changes
Summary:
When we change `CommitSyncConfig`, we want to not have to restart `scs` servers, and instead have them pick up the new config by using `LiveCommitSyncConfig`.

This diff turned out larger than I expected, mainly due to the need to introduce various things around `TestLiveCommitSyncConfig`:
- `TestLiveCommitSyncConfig`: the trait implementer to use in `mononoke_api::Repo`
- `TestLiveCommitSyncConfigSource`: the helper struct to keep around for new values injection (very similar to how our `ConfigStore` has an inner `ConfigSource`, which can also be `TestSource`, but here injected values can be `CommitSyncConfig` instead of JSON).
- all the places in integration tests, where `setup_configerator_configs` is now needed (I plan to start setting up configerator configs always in a separate diff, as it is cheap)

Here are the explanations for a few things I think may be not immediately obvious:
- I removed the `Clone` bound from `LiveCommitSyncConfig` trait, as `Clone` traits [cannot be made into trait objects](https://doc.rust-lang.org/book/ch17-02-trait-objects.html#object-safety-is-required-for-trait-objects)
- `TestLiveCommitSyncConfigSource` vs `TestLiveCommitSyncConfigSourceInner` discrepancy is to ensure nobody should instantiate `TestLiveCommitSyncConfigSourceInner` outside of `live_commit_sync_config/src`
- I am aware of the ugly discrepancy between the main `--mononoke-config-path`, which is used to load initial configuration and can be both a file-based and a configerator-based config; and `--local-configerator-path`, used to override config sources for `Tunables` and `LiveCommitSyncConfig`. Ideally these two should just be unified somehow, but that is a little out of scope of this diff (I've already added it to the dirt doc though).
- in `mononoke_api::Repo` there are methods `new_test_xrepo` and `new_test_common`, which changed from maybe accepting just a `CommitSyncConfig` to now maybe accepting both `CommitSyncConfig` and `LiveCommitSyncConfig`. It can be made a bit cleaner: I can just query `CommitSyncConfig` from `LiveCommitSyncConfig` in `new_test_common` and avoid having two args. I was too lazy to do this, lmk if you feel strongly about it.

Reviewed By: StanislavGlebik

Differential Revision: D22443623

fbshipit-source-id: 0d6bbda2223e77b89cc59863b703db5081bcd601
2020-07-21 09:09:23 -07:00
Jun Wu
0562c1220f tests: enable template-new-builtin
Summary: This makes tests depend less on revision numbers.

Reviewed By: DurhamG

Differential Revision: D22468669

fbshipit-source-id: 74a06930faa3e6ee9d246ecc718c2a3740f57a54
2020-07-20 17:27:53 -07:00
Jun Wu
24e46bb082 strip: use Rust strip for testing
Summary:
The Rust strip logic works for both revlog and segmented changelog. Use it in
tests for easier segmented changelog migration.

The old revlog strip has a lot of complexities on linkrev. Since this is only
used for testing, I avoided the complexities by just saying all linkrevs are
invalidated so we can skip the complexities of dealing with filelog or
manifest, or generating a temporary bundle and unbundling them later.

Most test changes are because we no longer strip filelogs. So unbundling
them will not add new file revisions.

`test-repair-strip.t` is removed because it is only about "Permission Denied"
cases. With the new code path file logs are not stripped and the test is not
relevant.

This does not affect hgsql as it has the Rust logic totally disabled.

Reviewed By: DurhamG

Differential Revision: D22402198

fbshipit-source-id: 1c207393f59a8a3a601cfbdf7f07534b8acf46bf
2020-07-20 17:27:52 -07:00
Meyer Jacobs
f8b83f7880 debug: log exception metadata to scuba along with other exception information
Summary:
Extend `_log_exception` to inspect exceptions for metadata, and log any that is found to Scuba. Eventually I'd like to merge at least some of this information from the `perfpipe_hg_errors` table into the `perfpipe_dev_command_timers`.

Introduce `Tagged` mixin and `Fault` enum Python types for tagging Python exceptions.

Introduce `debugthrowexception` for testing Python error handling flow.

Reviewed By: DurhamG

Differential Revision: D22585764

fbshipit-source-id: f6300ae25db25d5e75fab9c2a03fb4f9beb06c1f
2020-07-20 11:46:13 -07:00
Jun Wu
c6cac3456a test-debugstrip: avoid revision numbers
Summary: This makes it more compatible if the strip algorithm gets changed.

Reviewed By: DurhamG

Differential Revision: D22402194

fbshipit-source-id: 0d296117c6959c0559bb33dcbe1b2de1624dc3b7
2020-07-17 22:23:05 -07:00
Jun Wu
01a6a189c6 changelog: use Rust RevlogIndex for ancestors
Reviewed By: DurhamG

Differential Revision: D22402199

fbshipit-source-id: cf8354fe41224e3e5dea90508ed7fe473f3a6b08
2020-07-17 22:23:04 -07:00
Jun Wu
eb4c007145 changelog: use Rust RevlogIndex for partialmatch
Summary:
I dropped the special case of wdir handling. With the hope that we will handle
the virtual commits differently eventually (ex. drop special cases, insert real
commits to Rust DAG but do not flush them to disk, support multiple wdir
virtual commits, null is no longer an ancestor of every commit).

`test-listkeyspatterns.t` is changed because `0` no longer resolves to `null`.

Reviewed By: DurhamG

Differential Revision: D22368836

fbshipit-source-id: 14b9914506ef59bb69363b602d646ec89ce0d89a
2020-07-17 22:23:04 -07:00
Jun Wu
15c824afe3 changelog: use Rust RevlogIndex for ancestor
Summary:
This can pick a different common ancestor in criss-cross case.
The test is updated to reflect that.

Reviewed By: DurhamG

Differential Revision: D22368837

fbshipit-source-id: 9f897142b3a4bacd0fc90a4a054b7806f1bde826
2020-07-17 17:25:54 -07:00
Stanislau Hlebik
9d18c46b1f remediation of S205607
fbshipit-source-id: 798decc90db4f13770e97cdce3c0df7d5421b2a3
2020-07-17 17:16:13 -07:00
Stanislau Hlebik
3665548bb0 remediation of S205607
fbshipit-source-id: 5113fe0c527595e4227ff827253b7414abbdf7ac
2020-07-17 17:16:13 -07:00
Jun Wu
b769de39d3 tests: 'buck run :run-tests-py3' should use Python 3 hg
Summary:
`unittestify.py` has logic to discover executables. It is hardcode as Python 2
hg for now. Change it to be aware of the Python 3 versions.

Reviewed By: DurhamG

Differential Revision: D22562875

fbshipit-source-id: 2a19ac6ee805e22fbcc2651ada5f4eaa1bc85f51
2020-07-17 12:31:04 -07:00
Meyer Jacobs
e3b86cf77d debug: introduce binding layer for propagating error metadata to Python
Summary:
Implements based Rust-Python binding layer for error metadata propagation.

We introduce a new type, `TaggedExceptionData`, which carries CommonMetadata and the original (without metadata) error message for a Rust Anyhow error. This class is passed to RustError and can be accessed in Python (somewhat awkwardly) via indexing:
```
except error.RustError as e:
    fault = e.args[0].fault()
    typename = e.args[0].typename()
    message = e.args[0].message()
```
As far as I can tell, due to limitations in cpython-rs, this can't be made more ergonomic without introducing a Python shim around the Rust binding layer, which could adapt the cpython-rs classes to use whatever API we'd like.

Currently, anyhow errors that are not otherwise special-cased will be converted into RustError, with both the original error message and any attached metadata printed as shown below
```
  abort: intentional error for debugging with message 'intentional_error'
  error has type name taggederror::IntentionalError and fault None
```
We can of course re-raise the error if desired to maintain the previous behavior for handling a RustError.

If we'd like other, specialized Rust Python Exception types to carry metadata (such as `IndexedLogError`), we'll need to modify them to accept a `TaggedExceptionData` like `RustError`.

Renamed the "cause an error in pure rust command" function to `debugcauserusterror`, and instead used the name `debugthrowrustexception` for a command which causes an error in rust which is converted to a Python exception across the binding layer.

Introduced a simple integration test which exercises `debugthrowrustexception`.

Added a basic handler for RustError to scmutil.py

Reviewed By: DurhamG

Differential Revision: D22517796

fbshipit-source-id: 0409489243fe739a26958aad48f608890eb93aa0
2020-07-16 19:30:00 -07:00
Durham Goode
9d2a577ac4 merge: backout checkunknownfiles fix
Summary:
This fix was originally meant to prevent doing checkunknown files when
it was clear there was no conflict. Unfortunatley, the data doesn't appear to
show it helped, and in some cases it definitely hurt it. Let's back it out for
now until we can do more investigation.

Reviewed By: StanislavGlebik

Differential Revision: D22574000

fbshipit-source-id: aeb644ecd6da046df17e6d10418a72363c1ee532
2020-07-16 10:45:14 -07:00
Durham Goode
2eae6130fb py3: fix eden lfs fetching
Summary: The tests now pass

Reviewed By: xavierd

Differential Revision: D22561933

fbshipit-source-id: 7f130391de845207589b0abe52481d03915ce18f
2020-07-15 22:16:19 -07:00
Jun Wu
2dd3bb83d4 test-fb-hgext-fbconduit: update the test
Summary:
D22526230 (7ab2c54f08) adds extra output.
The test seems to be skipped in buck test due to the hgsql requirement.

Reviewed By: kulshrax

Differential Revision: D22555707

fbshipit-source-id: 8659de3cda517a49296c747e65bfbd0d372c031a
2020-07-15 19:00:50 -07:00
Jun Wu
d3df634f14 changelog: use Rust RevlogIndex for descendants
Reviewed By: DurhamG

Differential Revision: D22368830

fbshipit-source-id: ccfc1128012014223c86c52fab6cf3845827e3f1
2020-07-15 13:16:47 -07:00
Jun Wu
a3cc71f184 changelog: use Rust RevlogIndex for revision
Reviewed By: DurhamG

Differential Revision: D22368824

fbshipit-source-id: 16c43e377443850200212f813dcbf544b622206e
2020-07-15 13:16:47 -07:00
Meyer Jacobs
4ccbd119d7 debug: introduce error classification and metadata propagation
Summary:
Introduce new rust library, taggederror, which contains utilities for attaching metadata to errors. The library provides two main methods for attaching metadata to an error, the TaggedError wrapper type, and the AnyhowExt trait methods. Provides a struct, CommonMetadata, which contains all the metadata types introduced by taggederror (fault, transience, category, and typename), which can also be attached individually (and the same pattern can be used to attach other metadata).

Introduce a new native rust command, debugthrowrustexception, which causes the command to return an error, with some attached metadata.

Modify hg rust native command dispatch error handling to use debug formatter to print anyhow::Error errors. This will print out the source chain, contexts, and backtrace if available, which will cause the metadata we attach as a wrapper error or context to be printed.

Reviewed By: DurhamG

Differential Revision: D22420941

fbshipit-source-id: d38c5a10b686d86b69a2c0a19f5bcbf4ca24dff6
2020-07-15 10:03:10 -07:00
Durham Goode
28ddd1d1cc configs: add hg debugdynamicconfig --canary devvmXXX.prnY support
Summary:
Previously you could only canary locally on a devserver by setting an
environment variable. Let's add a --canary flag to debugdynamicconfig that
accepts a host.  Hg will ssh to that host and run the configerator cli to grab
the canaried config from that host.

Reviewed By: quark-zju

Differential Revision: D22535509

fbshipit-source-id: af1c21d8402c4e729769e50388d913bf52b66b89
2020-07-15 01:14:30 -07:00
Jun Wu
0943453a20 tests: remove unbundlereplay
Summary: D22513868 (ee36a7446b) removed the `unbundlereplay` extension. Update tests.

Reviewed By: singhsrb

Differential Revision: D22537159

fbshipit-source-id: 1c02906b55c2e2a50b8df8cd0e8aa1bdd4862ecc
2020-07-14 15:37:38 -07:00
Jun Wu
f6d838bc0e extensions: enable lz4revlog by default
Summary: Some native code (ex. RevlogIndex) only knows the lz4 format.

Reviewed By: DurhamG

Differential Revision: D22368825

fbshipit-source-id: d33cee235e3aa4fbf2cfb441319e3c12728d8b5b
2020-07-14 14:33:43 -07:00
Jun Wu
b71ac97dd5 tests: do not use hg files to list every file in a repo
Summary:
The `helpers-testrepo.sh` runs something like

  hg files --cwd /path/to/fbsource/fbcode/eden/scm/tests/

to check if `hg` works or not. Previously it fails fast because of the
lz4revlog requirement. The next diff will enable lz4revlog that makes
`hg files` work.

That `hg files` command (if does not fail) is quite expensive because it has no
patterns and lists every file.

It can also be undesirable if the in-repo hg does some kind of auto migration
that makes the repo unusable by the system hg. Therefore just unconditionally
use the system hg.

Reviewed By: DurhamG

Differential Revision: D22419967

fbshipit-source-id: 2d5c75696efecce1ec38a2e4fa23aff101219545
2020-07-14 14:33:43 -07:00
Jun Wu
da42f2c17e changelog: use Rust RevlogIndex for reachableroots
Summary: The new Rust structure can calculate reachableroots.

Reviewed By: DurhamG

Differential Revision: D22368827

fbshipit-source-id: 47ea1ce07946ddf8c2a6c31bb85dead3950084ba
2020-07-14 14:33:43 -07:00
Durham Goode
b1e740edad py3: fix revert -i
Summary: `hg revert -i` now works and test-revert-interactive.t now passes

Reviewed By: quark-zju

Differential Revision: D22517586

fbshipit-source-id: 76e3c76ea1687fecbd7d66fff42312dac1300c17
2020-07-13 20:54:37 -07:00
Durham Goode
11972bf57e configs: switch to auditing the specific list of known problematic configs
Summary:
Previously we would audit all configs and report them if the
dynamicconfig did not match the rc-file config. Now that dynamicconfigs are
widely deployed, let's switch this around to auditing only configs we know have
had issues. This will let us start adding new configs via dynamicconfigs instead
of via the legacy staticfiles and chef, before we've finished migrating all the
legacy configs over.

Reviewed By: quark-zju

Differential Revision: D22401865

fbshipit-source-id: 5c41c674d39c8113b2a40da61e020e8a33c39312
2020-07-13 08:53:18 -07:00
Durham Goode
6774dfe154 packs: flush history packs every 10 million adds
Summary:
We're seeing cases were cloning can take 10's of GB of memory because
we pend all the history information in memory. Let's flush the history info
every 10 million adds to bound the memory usage.

10 million was chosen somewhat arbitrarily, but it results in pack files that
are 800MB, which corresponds roughly with 8GB of memory usage.

This requires updating repack to be aware that a single flush could produce
multiple packs. Note, since repack writes via this same path, it may result in
repack producing multiple pack files. In the degenerate case repack could
produce the same number (or more) of pack files than was inputted. If we set the
threshold high enough I think we'll be fine though. 800MB is probably
sufficient.

Reviewed By: xavierd

Differential Revision: D22438569

fbshipit-source-id: 425d5d3b7999b81e44d1dbe1f2a4ea453ab6ca4f
2020-07-13 08:10:14 -07:00
Arun Kulshreshtha
41e68f46d3 edenapi: add blocking API
Summary: Add a new `EdenApiBlocking` trait that exposes blocking versions of the `EdenApi` trait's methods, for use in non-async code.

Reviewed By: quark-zju

Differential Revision: D22305396

fbshipit-source-id: d0f3a73cad1a23a4f0892a17f18267374e63108e
2020-07-09 13:08:27 -07:00
Jun Wu
b80966f93c revlog: turn on head-based-commit-transaction for tests
Summary:
Bypass truncation-based transaction if narrow-heads is on.

The transaction abort still works logically because commit references stay
unchanged on abort.

Related EdenFS and Mononoke tests are updated. Mononoke tests probably
shouldn't rely on revlog / fncache implementation details in hg.

Reviewed By: DurhamG

Differential Revision: D22240186

fbshipit-source-id: f97efd60855467b52c9fb83e7c794ded269e9617
2020-07-08 14:33:58 -07:00
Jun Wu
4b09e88ceb amend: do not auto restack if there are no visible children
Summary:
With modern configs, repo is unfiltered and `ctx.children()` returns unfiltered
commits. Use the revset function `children` instead so invisible children won't
trigger auto restack.

Reviewed By: DurhamG

Differential Revision: D22421689

fbshipit-source-id: 3ec8f616c17254ee9ccfcad96673d209b9163da6
2020-07-08 14:10:37 -07:00
Jun Wu
3d82fd408a amend: add a new auto restack test case
Summary: The test demostrates an issue with the current auto restack logic.

Reviewed By: DurhamG

Differential Revision: D22421690

fbshipit-source-id: e035cd3212357f24322f8eb9ec5941767ad780d9
2020-07-08 14:10:37 -07:00
Jun Wu
8e199e9a44 debugcomplete: show aliases with -v
Summary:
Make zsh_completion complete standard aliases like `checkout`.
This restores the behavior before D18463299 (54451585ce) stack.

Reviewed By: farnz

Differential Revision: D22396737

fbshipit-source-id: 745761041d6d1dec6adba2efb102e2021a01b36b
2020-07-07 16:47:45 -07:00
Durham Goode
f09839fdf9 merge: don't do checkunknown for files that we know are not untracked
Summary:
checkunknown is quite expensive since it has to read the contents of
every untracked file, which can be 10's of thousands of non-parallel stats and
reads. For files that don't exist in the working copy, it's just wasted work to
stat for the files at all. Status can efficiently tell us what files are
unknown, so let's use that to triage most "unknown" files to normal writes
before we even get to checkunknown.

The downside of this approach is that it makes an additional call to status,
which is not cached (only non-unknown+non-ignore+non-clean status calls are
cached). We could add more caching if this is a problem.

This doesn't help the case where a user might have 10k+ untracked files due to a
ctrl+c'd checkout, but we'll improve that in a future diff.

Reviewed By: quark-zju

Differential Revision: D22366758

fbshipit-source-id: b54fec113dc162f97a35e705ed083ddd14babe55
2020-07-06 22:10:56 -07:00
Jun Wu
253584bf2e test-generaldelta: disable modern features
Summary:
The test relies on Python revlog implementation details which
do not exist in the Rust revlog implementation.

Reviewed By: DurhamG

Differential Revision: D22240183

fbshipit-source-id: b245b35e561c3364618a0e199244df030cc47942
2020-07-06 14:04:28 -07:00
Jun Wu
1a5de54ab0 test-bookmarks-strip: do not use debugstrip
Reviewed By: DurhamG

Differential Revision: D22240182

fbshipit-source-id: b0bf34e84f46a0593b6390c6c97a47110f8d94d2
2020-07-06 14:04:28 -07:00
Jun Wu
ddfb3c5dba test-backout: rewrite the test in a basic form
Summary:
The original test is unmaintainable. Rewrite it to test key features.

I dropped detailed tests about merge conflict / content handling.
In the future we probalby will have a clean Rust implementation of "applying
diff between X and Y to Z" which can replace various unmaintainable patch
application logic in Python. We can test that Rust library extensively and
commands will just use the clean library (ex. revert, backout)

Reviewed By: sfilipco

Differential Revision: D22240184

fbshipit-source-id: 4d6c65fe02ccc92e64c62a48f702187678973086
2020-07-06 14:04:28 -07:00
Jun Wu
24ab8f5b4b test-amend-split: do not use hg debugstrip
Summary:
`debugstrip` is an operation that depends on multiple legacy components (revlog
strip, truncate-based transaction).  They are incompatible with modern configs
(no truncation, heads-based visibility, metalog-based transaction).
Avoid using it in the test.

Reviewed By: DurhamG

Differential Revision: D22240187

fbshipit-source-id: ec215d75fb766957a3d6f58e491ef815f5bedbdc
2020-07-06 14:04:28 -07:00
Jun Wu
4da3addbee tests: migrate off rev numbers for more tests
Summary:
Change by `fix-revnum.py`. Part of the tests using `hg debugstrip`,
which I'm trying to avoid.

Reviewed By: DurhamG

Differential Revision: D22240181

fbshipit-source-id: a569b712fe4b985378e5c61c000deecccefbc488
2020-07-06 14:04:28 -07:00
Jun Wu
ac60550de6 commands: disable rollback unconditionally
Summary:
Since tests do not use it, and we have long disabled it in production.
Let's just disable the command unconditionally.

Reviewed By: DurhamG

Differential Revision: D22368834

fbshipit-source-id: 7ebc5b07c4044b6809defc06437cda7256cb2ebf
2020-07-06 14:04:27 -07:00
Jun Wu
24363ad52f tests: remove usage of hg rollback
Summary:
`hg rollback` was long disabled in production setup. It has weird behavior and
is likely incompatible with modern transaction frameworks. Remove its usage in
tests.

Reviewed By: DurhamG

Differential Revision: D22240180

fbshipit-source-id: 453684ebbc77132e09b1b717b6ad1e106dcad214
2020-07-06 14:04:27 -07:00
Jun Wu
021fa7eba5 repoview: remove repoview layer
Summary:
End-users have been using visibleheads + narrowheads for a while, and hgsql
does not require any filtering, and most tests are migrated to modern configs
(visibility + narrow heads). Now it's time to consider removing the repoview
layer.

This removes complexities around `changelog.filteredrevs` and various different
`repoview` objects with caching problems (ex. I have seen that `repo` and `unfi`
have inconsistent phasecache causing they calculate phases differently and it's
quite hard to reason about confidently).

This will also make it easier to migrate to segmented changelog.

Reviewed By: DurhamG

Differential Revision: D22201084

fbshipit-source-id: 3661c26dd72a64b5005d86e164af4da5a6895649
2020-07-06 14:04:27 -07:00
Stefan Filip
232caa0cd6 tests: update test-*ruststores-repack for Mononoke
Summary:
The test case assumed that clone would return data in order from the server.
That is not a valid assumption and Mononoke doesn't return data in order.

Reviewed By: xavierd

Differential Revision: D22364636

fbshipit-source-id: abfcbe0074a08c9a76c42d351ce5c792eb65e24f
2020-07-02 14:37:41 -07:00
Jun Wu
358e35f067 test-globalrevs: use modern configs
Summary:
Enable mutation, remotenames and narrow-heads (for clients).

Some `x` commits are shown because the server repo cannot hide them.

Reviewed By: DurhamG

Differential Revision: D22200501

fbshipit-source-id: 35abe5198025598f4f5ef8807c2eaa6f3b2f2318
2020-07-02 13:22:34 -07:00
Jun Wu
ed8fd9202c hgsql: disable modern features more aggressively
Summary:
D21894320 (64585a5895) tries to disable features from hgsql. However tests can
run hg commands with hgsql extension turned on or off, and that
messes up things.

Let's test the hgsql requirement and disable related features unconditionally
so we have more confident that the related features won't be turned on
accidentally.

Previously, the `initclient` helper function will create repos with the `hgsql`
requirement. Since we're using the repo requirement to disable features, disable
`hgsql` temporarily during `initclient` so that the client repos can still have
modern features like visibility and narrow-heads.

The globalrevs test is affected and temporarily disabled. It will be fixed in
follow-ups.

Reviewed By: DurhamG

Differential Revision: D22200507

fbshipit-source-id: 3715464430a9115bb00122a8dfa03b1abf9d03ab
2020-07-02 13:22:34 -07:00
Jun Wu
eceb3179c4 hgsql: make CorruptionError more verbose
Summary: This helps debugging some hgsql issues especially in test-globalrevs.

Reviewed By: DurhamG

Differential Revision: D22200509

fbshipit-source-id: cddf79a00951d135dee20a5e9fb3a486abad2ff7
2020-07-02 13:22:34 -07:00
Jun Wu
31b655c656 testutil: make traceback in dott test more useful
Summary:
Without the change the traceback looks like:

```
Traceback (most recent call last):
  File "eden/scm/tests/testutil/dott/shobj.py", line 103, in __del__
    out = self.output
  File "eden/scm/tests/testutil/dott/shobj.py", line 67, in output
    self._output = func(*args[1:], **kwargs) or ""
  File "eden/scm/tests/test-globalrevs-t.py", line 499, in checkglobalrevs
    isgreaterglobalrev("desc('h2')", "desc('g1')") == ""
  File "eden/scm/tests/test-globalrevs-t.py", line 480, in isgreaterglobalrev
    if getglobalrev(left) > getglobalrev(right):
  File "eden/scm/tests/test-globalrevs-t.py", line 469, in getglobalrev
    return int(s)
ValueError: invalid literal for int() with base 10: ''
```

There is no clue about who calls `checkglobalrevs`.

With this change the extra context is provided and it's easy to find out the code is around line 517:

```
Before executing:
  File "eden/scm/tests/test-globalrevs-t.py", line 517, in <module>
    sh % "cd ../master2"
  File "eden/scm/tests/testutil/dott/shobj.py", line 161, in __mod__
    return LazyCommand(command)
  File "eden/scm/tests/testutil/dott/shobj.py", line 38, in __init__
    _checkdelayedexception()
  File "eden/scm/tests/testutil/dott/shobj.py", line 204, in _checkdelayedexception
    traceback.print_stack()
```

Note: before D19649475 (a634526801) the traceback looks like more useful but it's hard to
create that traceback on Python 3:

```
Traceback (most recent call last):
  File "eden/scm/tests/test-globalrevs-t.py", line 517, in <module>
    sh % "cd ../master2"
  File "eden/scm/tests/testutil/dott/shobj.py", line 161, in __mod__
    return LazyCommand(command)
  File "eden/scm/tests/testutil/dott/shobj.py", line 38, in __init__
    _checkdelayedexception()
  File "eden/scm/tests/testutil/dott/shobj.py", line 202, in _checkdelayedexception
    exec("raise exctype, excvalue, tb")
  File "eden/scm/tests/testutil/dott/shobj.py", line 103, in __del__
    out = self.output
  File "eden/scm/tests/testutil/dott/shobj.py", line 67, in output
    self._output = func(*args[1:], **kwargs) or ""
  File "eden/scm/tests/test-globalrevs-t.py", line 499, in checkglobalrevs
    isgreaterglobalrev("desc('h2')", "desc('g1')") == ""
  File "eden/scm/tests/test-globalrevs-t.py", line 480, in isgreaterglobalrev
    if getglobalrev(left) > getglobalrev(right):
  File "eden/scm/tests/test-globalrevs-t.py", line 469, in getglobalrev
    return int(s)
ValueError: invalid literal for int() with base 10: ''
```

Reviewed By: DurhamG

Differential Revision: D22200508

fbshipit-source-id: 07088eac72763f890cc847b9991d79fed18ee0ef
2020-07-02 13:22:34 -07:00
Jun Wu
c08c19572e mutation: drop copypreds handling in the Python land
Summary: The Rust land handles this.

Reviewed By: markbt

Differential Revision: D22174953

fbshipit-source-id: 8023e698fde2463c20028e979d37b677a536c327
2020-07-02 13:22:34 -07:00
Jun Wu
868c2b0108 mutationstore: copy entries automatically on flush
Summary:
Similar to D7121487 (af8ecd5f80) but works for mutation store. This makes sure at the Rust
layer, mutation entries won't get lost after rebasing or metaeditting a set of
commits where a subset of the commits being edited has mutation relations.

Unlike the Python layer, the Rust layer works for mutation chains. Therefore
some of the tests changes.

Reviewed By: markbt

Differential Revision: D22174991

fbshipit-source-id: d62f7c1071fc71f939ec8771ac5968b992aa253c
2020-07-02 13:22:34 -07:00
Jun Wu
fb27a098a0 test-amend-metaedit: enhance metaedit-copy test cases
Summary: Showing that it does not work for a chain of amends (or metaedits).

Reviewed By: DurhamG

Differential Revision: D22174968

fbshipit-source-id: ff942042b69f96e1cc7092a7003cf4608730a66f
2020-07-02 13:22:33 -07:00
Jun Wu
39b5e99ad8 directaccess: remove extension
Summary:
With narrow-heads (enabled in production and most tests) directaccess is a
no-op. Remove the extension.

Reviewed By: DurhamG

Differential Revision: D22174990

fbshipit-source-id: 662f800cebc3cc7614fa921e4367c4d1f8806eb4
2020-07-02 13:22:33 -07:00
Jun Wu
e8e68cb945 test-rebase-copy-relations: use modern configs
Summary:
Switch to modern configs. It does not quite work right yet, which will be fixed
in follow-ups.

Reviewed By: DurhamG

Differential Revision: D22174966

fbshipit-source-id: d52234ec588a3a92512635291f64fa1819a4424b
2020-07-02 13:22:33 -07:00
Jun Wu
b7e7daec2d test-infinitepush-bundlestore: use modern setups
Summary: It passes with some changes.

Reviewed By: DurhamG

Differential Revision: D22174988

fbshipit-source-id: 1fcefa81d979e01291cb9f646adcfdae46bb47f1
2020-07-02 13:22:33 -07:00
Jun Wu
53b6ab3861 test-debugstrip: use modern setups
Summary: It passes with minor change.

Reviewed By: DurhamG

Differential Revision: D22175006

fbshipit-source-id: 6c5416fc64b065ea1d39eb2ed0cf3e4f873c4cb9
2020-07-02 13:22:33 -07:00
Jun Wu
177d97adb6 test-rename-after-merge: enable visibility
Summary:
This is one of the very few tests that didn't have visibility on.
The blocker was `hg rollback` behavior difference.

Reviewed By: DurhamG

Differential Revision: D22175000

fbshipit-source-id: 4067818c3cde8dade1a47671e8df6558ae348f6e
2020-07-02 13:22:33 -07:00
Jun Wu
0b77c3a7b1 test-visibility: enable narrow-heads
Summary:
Made some edits, mostly about `--hidden`, and phases to make the test
compatible.

Mutation store cannot represent undo (unamend) relationship and hidden
but non-obsoleted commits show up as `o`.

Reviewed By: DurhamG

Differential Revision: D22175001

fbshipit-source-id: 75dcc66238b4f465f5ac183278359d133758faf6
2020-07-02 13:22:33 -07:00
Jun Wu
b3e8cbb300 test-commitcloud: enable mutation for some tests
Summary: They are compatible now.

Reviewed By: DurhamG

Differential Revision: D22174970

fbshipit-source-id: f4825420529dac7c63a28df6c41aa40a254a4b33
2020-07-02 13:22:33 -07:00
Jun Wu
50e46cb0b3 test-fb-hgext-pushrebase: enable modern configs
Summary:
With lots of edits, mostly maintaining bookmarks, the test is compatible with
modern configs.

Reviewed By: DurhamG

Differential Revision: D22174985

fbshipit-source-id: b88cd25da36ebcde908c1b63a15f90e82d1692cb
2020-07-02 13:22:32 -07:00
Jun Wu
7ab22e23a0 test-fb-hgext-pushrebase: make it a bit more verbose
Summary: This makes it easier to see changes with modern configuration.

Reviewed By: DurhamG

Differential Revision: D22174957

fbshipit-source-id: c49f270281c06debd055435362b95509093c1e99
2020-07-02 13:22:32 -07:00
Jun Wu
93e45ff8a4 test-histedit-fold: enable modern configs
Summary: With some edits the test is compatible with modern configs.

Reviewed By: DurhamG

Differential Revision: D22174972

fbshipit-source-id: 971740f3a94048c15fcfc09436df7e09b3e169b8
2020-07-02 13:22:32 -07:00
Jun Wu
a47ebe97c2 test-histedit-edit: enable modern configs
Summary:
Stripping does break `histedit --abort`. Seems not worthwhile to support since
strip is rare. Edit the test so it's using modern configs.

Reviewed By: DurhamG

Differential Revision: D22174965

fbshipit-source-id: 090b92946311e192b9ee36ffa27718a62fc791ee
2020-07-02 13:22:32 -07:00
Jun Wu
47fdcbf7ac test-fb-hgext-remotefilelog-linknodes: enable modern configs
Summary: This test needs a few edits to be compatible with modern setup.

Reviewed By: DurhamG

Differential Revision: D22175002

fbshipit-source-id: 1b75b6535a46bd21d746259778b079f6c53a94d0
2020-07-02 13:22:32 -07:00
Jun Wu
4155a7063c test-fb-hgext-remotefilelog-local: enable modern configs
Summary: This test needs a few edits to be compatible with modern setup.

Reviewed By: DurhamG

Differential Revision: D22174969

fbshipit-source-id: 8f9c1b926d05070cfd8f17ca539693fa580de421
2020-07-02 13:22:32 -07:00
Jun Wu
de7450f3fb test-fb-hgext-treemanifest: enable modern configs
Summary:
This test needs some edits to be compatible with modern setup.  Some
tests about legacy features are removed.

Reviewed By: DurhamG

Differential Revision: D22174983

fbshipit-source-id: e62de2b9571f3366b9c3c4bbfdb66cd7d990e317
2020-07-02 13:22:32 -07:00
Jun Wu
ad33709d93 test-fb-hgext-treemanifest-treeonly: enable modern configs
Summary:
This test needs a lot manual edits to be compatible with modern setup.  Some
tests about legacy features are removed.

Reviewed By: DurhamG

Differential Revision: D22174976

fbshipit-source-id: 09ef10f94438753469ed8725a4b8a5bdfed177cf
2020-07-02 13:22:32 -07:00
Jun Wu
998f09b3ec test-fb-hgext-tweakdefaults: enable modern configs
Summary:
This test needs some manual edits to be compatible with modern setup.
Some tests about legacy features are removed.

Reviewed By: DurhamG

Differential Revision: D22174997

fbshipit-source-id: 0423a45c4d085f4b1128b11b5f0b9876ed82e950
2020-07-02 13:22:32 -07:00
Jun Wu
c84731b9b2 test-fb-hgext-tweakdefaults: migrate off revision numbers
Summary: This test needs some manual editing to fully migrate off revision numbers.

Reviewed By: DurhamG

Differential Revision: D22174980

fbshipit-source-id: baf2ea5f591870fa7560b8a9d23c2a357851e028
2020-07-02 13:22:31 -07:00
Jun Wu
3d1a257f58 test-hggit-extra: enable modern configs
Summary: Needs a minor change and the test is now compatible.

Reviewed By: DurhamG

Differential Revision: D22174960

fbshipit-source-id: e39800165737463d20e67cf1ce9b8f7cd4115be5
2020-07-02 13:22:31 -07:00
Jun Wu
0eb12d09dc test-remotenames: enable modern configs
Summary: These 2 tests only have revision number changes.

Reviewed By: DurhamG

Differential Revision: D22174959

fbshipit-source-id: 5a9176081149f043a0bc468ac9b8ab7392105ef2
2020-07-02 13:22:31 -07:00
Jun Wu
3c8236a4c0 test-remotenames-pull-rebase: enable modern configs
Summary: Needs some manual changes.  This makes the test use modern configs.

Reviewed By: DurhamG

Differential Revision: D22174977

fbshipit-source-id: 494123168ff027212d77dfd3480142597bbd54a9
2020-07-02 13:22:31 -07:00
Jun Wu
9ac7828d5b test-histedit-*: enable modern configs for some easy tests
Summary:
Those tests only need minor fixes like using `max(desc(x))` to avoid selecting
older `x` commits. Changes are only about revision numbers.

Reviewed By: DurhamG

Differential Revision: D22174984

fbshipit-source-id: a3032acb879030e3873839bfe44877f358e63f36
2020-07-02 13:22:31 -07:00
Jun Wu
dd5bb7bb58 test-histedit-arguments: enable modern configs
Summary: This enables mutation, visibility and narrow-heads.

Reviewed By: DurhamG

Differential Revision: D22174986

fbshipit-source-id: 4b3cb0de7e25b14aaafba07b877fd0a153a8fcb7
2020-07-02 13:22:31 -07:00
Jun Wu
064973a4ba tests: migrate some noevolution tests off revision numbers
Summary: By fix-revnum.py. This makes them easier to migrate to modern setups.

Reviewed By: DurhamG

Differential Revision: D22174963

fbshipit-source-id: 4f59685f93742305dafb3b347e5e80b92bcf0c99
2020-07-02 13:22:31 -07:00
Jun Wu
a2195a9c53 test-rebase-dest: enable modern configs
Summary: With fix-revnum.py the test can be easily migrated.

Reviewed By: DurhamG

Differential Revision: D22174994

fbshipit-source-id: 272fcf890d5e6e5b6791d957361fe59e0266742a
2020-07-02 13:22:31 -07:00
Jun Wu
6ed8ba77b9 test-rebase-rename: enable modern configs
Summary: With some manual edits and fix-revnum.py the test is now compatible.

Reviewed By: DurhamG

Differential Revision: D22174971

fbshipit-source-id: c28a45df3b3ab5c976609e934c3eab2dd39a4734
2020-07-02 13:22:31 -07:00
Jun Wu
5d32484cf3 test-rebase-transaction: enable modern configs
Summary: It's only revision number changes.

Reviewed By: DurhamG

Differential Revision: D22175004

fbshipit-source-id: df18e65e974aff169c523917a8c2ea656903e71a
2020-07-02 13:22:31 -07:00
Jun Wu
1f362e9651 test-rebase-scenario-global: enable modern configs
Summary: Still need some manual changes. But the test now works reasonably.

Reviewed By: DurhamG

Differential Revision: D22174954

fbshipit-source-id: 33be68c7a5ce9c7689e830837ce38bb55ca2cc25
2020-07-02 13:22:30 -07:00
Jun Wu
79154c88ab test-rebase-scenario-global: fix usage of revision numbers
Summary: This is done by running the fix-revnum.py script.

Reviewed By: DurhamG

Differential Revision: D22174981

fbshipit-source-id: 1c99100ce5c984a6dd67cc92d14ec077e3e4b7b4
2020-07-02 13:22:30 -07:00
Jun Wu
473b07c328 tests: add a way to fix revision number usages automatically in tests
Summary:
Some tests use too many revision numbers (ex. test-rebase-scenario-global.t).
It's time consuming to fix it manually. Write a script to help with that.

This will be used by the next diff.

Reviewed By: DurhamG

Differential Revision: D22174956

fbshipit-source-id: a873ad326ecbd9cdfa2df58839b0ef21626e1506
2020-07-02 13:22:30 -07:00
Jun Wu
5265f6d372 test-rebase-newancestor: enable modern configs
Summary:
This turns on modern setups including visibility, mutation and narrow-heads.
The test used revision numbers. Changing them to non-revision-numbers fixes it.

Reviewed By: DurhamG

Differential Revision: D22174962

fbshipit-source-id: c851afecaf18b989888e7f40d69ffaa58cda95bd
2020-07-02 13:22:30 -07:00
Jun Wu
ad3c659616 test-rebase-interruptions: enable modern configs
Summary: This enables modern setup for the test.

Reviewed By: DurhamG

Differential Revision: D22175003

fbshipit-source-id: 6e153d4c48e02420c43989e317139d66b89da1da
2020-07-02 13:22:30 -07:00
Jun Wu
4dd49baba7 test-rebase-inmemory: enable modern configs
Summary:
The test used a lot of revision numbers. Changing them to non-revision-numbers
fixes it.

Reviewed By: DurhamG

Differential Revision: D22174974

fbshipit-source-id: 51915afa481ac0263eaeaa3339df8e10a2bc35d5
2020-07-02 13:22:30 -07:00
Jun Wu
dfd8ab5938 test-rebase-detach: enable modern configs
Summary:
This turns on modern setups including visibility, mutation and narrow-heads.
The test used revision numbers. Changing them to non-revision-numbers fixes it.

Reviewed By: DurhamG

Differential Revision: D22174958

fbshipit-source-id: 2a8c178021be9931e66b77f00d3de59d8c794ce5
2020-07-02 13:22:30 -07:00
Jun Wu
a539962c38 test-rebase-conflicts: enable modern configs
Summary:
This turns on modern setups including visibility, mutation and narrow-heads.
The test used revision numbers. Changing them to non-revision-numbers fixes it.

Reviewed By: DurhamG

Differential Revision: D22175005

fbshipit-source-id: c6292f10c27d03102df13a71332ef7a0304d5807
2020-07-02 13:22:30 -07:00
Jun Wu
f4f263fef9 test-rebase-bookmarks: enable modern configs
Summary:
This turns on modern setups including visibility, mutation and narrow-heads.
The test used revision numbers. Changing them to non-revision-numbers fixes it.

Reviewed By: DurhamG

Differential Revision: D22174964

fbshipit-source-id: 74d45b1b497497dfb6fa4b685e862d1bce4d4e5c
2020-07-02 13:22:30 -07:00
Jun Wu
942bc0cf0c test-rebase-flag: enable modern configs
Summary:
This turns on modern setups including visibility, mutation and narrow-heads.
Test seems fine - just revision number changes.

Reviewed By: DurhamG

Differential Revision: D22174998

fbshipit-source-id: fadec9b56be3cd3d5117f7418635e4d6042a52eb
2020-07-02 13:22:29 -07:00
Jun Wu
9c9545f5c3 test-fb-hgext-pushrebase-hgsql-mfs: delete the test
Summary:
The test was about pushing to hgsql servers. Nowadays we push to Mononoke
directly and sync to hgservers in a very different code path. Delete the
test as it's no longer relevant and involves too much low level details
to be compatible with modern setups.

Reviewed By: DurhamG

Differential Revision: D22174967

fbshipit-source-id: 08006bcf59090505d6116dbc024cb9378d27cf02
2020-07-02 13:22:29 -07:00
Jun Wu
2bd81db543 test-fb-hgext-fbhistedit-rebase-interactive: enable modern configs
Summary:
This turns on modern setups including visibility, mutation and narrow-heads.
The test only needs a few revision number fixup.

Reviewed By: DurhamG

Differential Revision: D22174973

fbshipit-source-id: 47470971fb361ac0bec45b932ad3fb66950f0d1c
2020-07-02 13:22:29 -07:00
Jun Wu
5434e42738 test-copy-move-merge: enable modern configs
Summary:
This turns on modern setups including visibility, mutation and narrow-heads.
The test only needs a revision number fixup.

Reviewed By: DurhamG

Differential Revision: D22174989

fbshipit-source-id: 3cef08e4e2214c9ffabc34fdd6e35cd02101172c
2020-07-02 13:22:29 -07:00
Jun Wu
04ddfd3c37 test-convert-hg-sink: turn on visibility and narrow-heads
Summary: Assign bookmarks explicitly to make commits visible.

Reviewed By: DurhamG

Differential Revision: D22174982

fbshipit-source-id: 5310e2f3fd53145c903b824043b0f6591517a156
2020-07-02 13:22:29 -07:00
Jun Wu
d9c8fdb3eb test-verify: turn on visibility and narrow-heads
Summary: It seems the test just passes with the change.

Reviewed By: DurhamG

Differential Revision: D22174979

fbshipit-source-id: 88b940e54fc7a5f71ca839cb583cf219fd3f30b9
2020-07-02 13:22:29 -07:00
Jun Wu
073ad87437 test-strip-cross: turn on visibility and narrow-heads
Summary:
This test works fine except for stripping rev 0 (the first commit).  Since
strip is not used in production for end-users and is likely going away, and we
are unlikely to strip the first commit of a repo on server-side, I just removed
the problematic test case to make it compatible.

Reviewed By: DurhamG

Differential Revision: D22174993

fbshipit-source-id: f362c6209852015558924151b58dc06b16c95df0
2020-07-02 13:22:29 -07:00
Jun Wu
f1afaa9ae4 tests: enable narrow-heads for more Python tests
Summary: Migrate some Python tests to use narrow-heads.

Reviewed By: DurhamG

Differential Revision: D22130167

fbshipit-source-id: 5cc71711b5bc674daed5040909e7cd141b7a9cfc
2020-07-02 13:22:29 -07:00
Jun Wu
5c567018c8 tests: enable narrow-heads for more tests
Summary: Migrate more tests to use narrow-heads.

Reviewed By: DurhamG

Differential Revision: D22130171

fbshipit-source-id: 92a1b1dc237a7f66b4430ef680d1a2f60e715778
2020-07-02 13:22:28 -07:00
Jun Wu
6fd6454502 tests: enable narrow-heads for test-fb-hgext-treemanifest-*
Reviewed By: DurhamG

Differential Revision: D22130166

fbshipit-source-id: dcff8bd6263c5cb6dd1f19320969f1d202b5da67
2020-07-02 13:22:28 -07:00
Jun Wu
b1809628fe tests: enable narrow-heads for test-d* to test-fb-hgext*
Summary: Most of them need extra server-side bookmarks for deciding phases.

Reviewed By: DurhamG

Differential Revision: D22130169

fbshipit-source-id: 2a4d3301fbf9dd8b8003fc319bda1180c6196ce8
2020-07-02 13:22:28 -07:00
Jun Wu
3b722c6ebc template: remove obsfate, instabilities, succsandmarkers
Summary: Those concepts use obsstore. They become no-ops with mutation. Remove them.

Reviewed By: DurhamG

Differential Revision: D22320091

fbshipit-source-id: eb9a8196b6ec8c8164a0d04cb7258c41cd5de596
2020-07-02 13:22:28 -07:00
Liubov Dmitrieva
6f8fc0e3a2 implement command to list workspaces
Summary:
New Commit Cloud command to list user's own worspaces in Commit Cloud

hg cloud ls

Reviewed By: markbt

Differential Revision: D22308127

fbshipit-source-id: 756c419a9bb3d6f50ddd5b4dd344cd35b9a02d2d
2020-07-02 04:49:06 -07:00
Jun Wu
dac395b3ce smartlog: collapse obsoleted stack
Summary:
When rebasing a long stack, it's common to have a long obsoleted (`x`) stack.
The `x` stack is likely duplicated with their successors therefore generally
not that useful. They take a lot of space, making it harder to find useful
commits. Collapse them in smartlog output by only showing their heads and
roots.

This is disabled for automation as VSCode @ FB has issues rendering the
"unstable" commits.

Screenshot of before vs after:
{F242018914}

Reviewed By: markbt

Differential Revision: D22289661

fbshipit-source-id: 1afce073e14abe8c23a05d52d60847fc5e0bfb66
2020-07-01 21:35:36 -07:00
Durham Goode
a36dc04467 py3: fix hg rage
Summary:
The subcommands it ran returned bytes then treated them as strings.
Let's decode them to strings.

Reviewed By: quark-zju

Differential Revision: D22339397

fbshipit-source-id: d9d503bd97271c649ad67c74d098b572c1bd7dea
2020-07-01 20:10:42 -07:00
Jun Wu
4032c7a591 test-revlog-mmapindex: remove the test
Summary:
With D22303305 (4868f5bf5b) the test is no longer valid - the mmap happened in Rust and
cannot be tested from Python wrapping functions. Remove the test.

Reviewed By: DurhamG

Differential Revision: D22316110

fbshipit-source-id: f7e16e2ac72908c836a7aeeefa1fb0ef035d01fc
2020-06-30 13:39:19 -07:00
Jun Wu
b2ce9d0ef8 run-tests: do not wait for the progress thread
Summary:
Sometimes `Ctrl+C` the test runner does not fully stop it. From gdb it seems
the test runner is waiting for a thread which might have deadlocked. The
progress thread does not have anything critical that need to sync back to
the main program. Avoid waiting for it to make Ctrl+C work better.

Reviewed By: kulshrax

Differential Revision: D22290453

fbshipit-source-id: bdc5260cbd339cc392728834330609343c0048d3
2020-06-29 18:45:41 -07:00
Jun Wu
01e3ea0f8f tests: enable narrow-heads for test-[bc]*
Summary: Most of them need extra server-side bookmarks for deciding phases.

Reviewed By: DurhamG

Differential Revision: D22117739

fbshipit-source-id: 711bf96063913fd6148125a5628f0b0f4efbf489
2020-06-29 13:53:04 -07:00
Jun Wu
4b45a2a185 test-pushrebase: use modern configs
Summary:
Enable narrow-heads.

Changed log revset from `:` to `all()` to make the test compatible.

Reviewed By: krallin

Differential Revision: D22200495

fbshipit-source-id: 148a82e77c953b9e7dbed055ef464c318e56cafa
2020-06-29 13:00:07 -07:00
Jun Wu
4c1634b9fd test-commitcloud: use modern configs
Summary:
Enable narrow-heads, and mutation. Disable obsmarker related features.

Change phase manipulation to `debugmakepublic` which works with narrow-heads.

Reviewed By: krallin

Differential Revision: D22200511

fbshipit-source-id: 8dec050f137e6cc055015fe084eb4cc67faa1216
2020-06-29 13:00:07 -07:00
Jun Wu
42b145a65d test-walker-scrub-blobstore: use modern configs
Summary:
Enable narrow-heads.

The test output seems a bit unstable - sometimes I got 28 there. So I globbed
it out.

Reviewed By: krallin

Differential Revision: D22200497

fbshipit-source-id: f005381a341d88c0bcbb09150e7d1878df7a38f3
2020-06-29 13:00:07 -07:00
Jun Wu
9eb40deffe test-pushrebase-emit-obsmarkers: use modern configs
Summary:
Enable narrow-heads.

Change the revset `:` to `all()`. With narrow-heads, `:` selects all commits
including those that are not referred by visible heads. The `all()` revset
only selects commits reachable from visible heads.

Reviewed By: krallin

Differential Revision: D22200498

fbshipit-source-id: beb863d42069ae898e419a4a75b3a707c72ae1f9
2020-06-29 13:00:07 -07:00
Jun Wu
e0c9b2b87b test-sqlblob: use modern configs
Summary:
Enable remotenames, selectivepull, and narrow-heads. Use the new stream clone
code path.

Selectivepull makes a difference. `hg pull -r HASH` also pulls the selected
bookmarks so an extra `pull` was unnecessary. Change the clone command to use
`-U` to trigger the new clone code path.

Reviewed By: krallin

Differential Revision: D22200499

fbshipit-source-id: 764202098c7e8afdbb5e2ee83679da7570c08c90
2020-06-29 13:00:07 -07:00
Jun Wu
adcf846f2f test-reduction: use modern configs
Summary:
Enable remotenames and narrow-heads.

Local bookmarks are replaced by remote bookmarks, causing the test change.

Reviewed By: krallin

Differential Revision: D22200500

fbshipit-source-id: aeee528d1766e0642c12e78a6c1a50cadc8a579a
2020-06-29 13:00:07 -07:00
Jun Wu
d1da1d70c1 test-push-redirector-sync-job: use modern configs
Summary:
Enable remotenames and narrow-heads.

The commits become 'draft' because there are no remote bookmarks.

Reviewed By: krallin

Differential Revision: D22200514

fbshipit-source-id: 04d0befa7c22756e936a28ffdcdf1305057cf062
2020-06-29 13:00:07 -07:00
Jun Wu
2875942761 test-infinitepush: use modern configs
Summary:
Enable remotenames and narrow-heads.

The test was migrated cleanly. The only change is that local bookmarks are
replaced by remote bookmarks.

Reviewed By: krallin

Differential Revision: D22200510

fbshipit-source-id: f5b8cd2ed125e9fc4e5daac897851d91fef5693f
2020-06-29 13:00:07 -07:00
Jun Wu
6ecf255fcf test-infinitepush-mutation: use modern configs
Summary:
Enable remotenames and narrow-heads.

Local bookmarks are replaced by remote bookmarks.

Reviewed By: krallin

Differential Revision: D22200503

fbshipit-source-id: 41ac4f4f606011dcaf6d0d9867b01fb77b9a79d8
2020-06-29 13:00:07 -07:00
Jun Wu
95cf4a2a39 test-infinitepush-hydrated: use modern configs
Summary:
Enable remotenames and narrow-heads.

Phase exchange is gone because of narrow-heads.
The remtoenames extension was written suboptimally so it issued a second
bookmarks request (which, hopefully can be removed by having selective
pull everywhere and migrate pull to use the new API).

Reviewed By: krallin

Differential Revision: D22200506

fbshipit-source-id: c522bb9fc1396d813e0f1f380c4290445bab3db3
2020-06-29 13:00:07 -07:00
Jun Wu
ffde9f50e9 test-infinitepush-commits-disabled: use modern configs
Summary:
Enable remotenames and narrow-heads. The `master_bookmark` is no longer a local
bookmark in the client repo.

Reviewed By: krallin

Differential Revision: D22200513

fbshipit-source-id: bc3c1715ce21f45a35bc67148eb00e44944bea6e
2020-06-29 13:00:06 -07:00
Jun Wu
8ecb79a921 test-gettreepack-sparse-update: use modern configs
Summary: Enable remotenames and narrow-heads.

Reviewed By: krallin

Differential Revision: D22201083

fbshipit-source-id: 585dff69db9dd725c8fa1090d47c85b150f979da
2020-06-29 13:00:06 -07:00
Jun Wu
439c029007 test-gettreepack-designated-nodes: use modern configs
Summary:
Enable remotenames and narrow-heads. The server gets one more request from
remotenames.

Reviewed By: krallin

Differential Revision: D22200502

fbshipit-source-id: 26bc28b19438c7be4a19eae6be728c83b113f822
2020-06-29 13:00:06 -07:00
Jun Wu
93318c255b test-bookmark-hg-kind: use modern configs
Summary:
Enable remotenames and narrow-heads. The client gets remote bookmarks instead
of local bookmarks during clone and phases are decided by remote bookmarks.

Reviewed By: krallin

Differential Revision: D22200515

fbshipit-source-id: 12a9e892855b3a8f62f01758565de5f224c4942b
2020-06-29 13:00:06 -07:00
Jun Wu
dbd29b7d06 tests: turn on narrow-heads for some tests
Summary: With narrow-heads, the phase exchange step is skipped.

Reviewed By: krallin

Differential Revision: D22200504

fbshipit-source-id: 6ab366e7e68eb3b82f52acaa8f488747435e0ecf
2020-06-29 13:00:06 -07:00
Jun Wu
889beacdf1 tests: enable narrow-heads for Mononoke tests
Summary:
Most tests pass without changes. Some incompatible tests are added to the
special list.

Reviewed By: krallin

Differential Revision: D22200505

fbshipit-source-id: 091464bbc7c9c532fed9ef91f2c955d6e4f2df0b
2020-06-29 13:00:06 -07:00
Jun Wu
4902a3300c tests: enable narrow-heads by default
Summary: Many tests are incompatible. But many are passing.

Reviewed By: kulshrax

Differential Revision: D22052475

fbshipit-source-id: 1f30ac2b0fe034175d5ae818ec2be098dbd5283d
2020-06-29 11:29:04 -07:00
Jun Wu
d8835e90a2 test-globalrevs: disable zstore commit data
Summary: This improves test compatibility.

Reviewed By: kulshrax

Differential Revision: D22174995

fbshipit-source-id: 27b4690567699004163b199b5ccbaf4f8850cd80
2020-06-29 11:29:04 -07:00
Jun Wu
6554961897 tests: replace 'phase --public' with 'debugmakepublic'
Summary: This makes narrow-heads migration smoother.

Reviewed By: ikostia

Differential Revision: D22052478

fbshipit-source-id: 83047ad6da4de2034c917bfd5be47a2f32d5cc3d
2020-06-29 11:29:04 -07:00
Jun Wu
b12980f84c commands: add debugmakepublic
Summary:
Many tests want to change commit phase to public. We don't want to leak this
feature to end-users. Therefore make a debug command.

Reviewed By: kulshrax

Differential Revision: D22052481

fbshipit-source-id: 4ce6a61120da0d74374465e97ac0ec0ff9638088
2020-06-29 11:29:04 -07:00
Jun Wu
4bfc5ea5d4 test-fb-hgext-undo: remove the test
Summary:
The test depends on too much details of the obsstore and is hard to
migrate to mutation. The undo command in production actually uses
a different code path (with narrow-heads, it rewrites metalog directly),
which is somewhat covered by test-undo-narrow-heads. Ideally we extend
the undo test with more cases under modern configs. For now let's just
remove the test with legacy configs to unblock migration progress.

Reviewed By: kulshrax

Differential Revision: D22174961

fbshipit-source-id: 57baf5e6f59938069b44a5db8c5ae1662f094f84
2020-06-29 11:29:04 -07:00
Jun Wu
50ed524e78 test-rebase-obsolete: remove the test
Summary:
It has too many dependencies on legacy components that it's too hard to
migrate.  `test-rebase-mutation` is the test that is more relevant.

Reviewed By: kulshrax

Differential Revision: D22174996

fbshipit-source-id: 40889bc2f80021839ce0ffe13098404e8aa97fbb
2020-06-29 11:29:04 -07:00
Jun Wu
2da2bfd958 test-commitcloud-sync-oscillation: remove the test
Summary:
The test is about syncing with obsmarkers. We no longer use obsmarkers so the
test is no longer relevant.

Reviewed By: kulshrax

Differential Revision: D22174999

fbshipit-source-id: 7615852b734319bc838b238f4c9b54252ba5c355
2020-06-29 11:29:04 -07:00
Jun Wu
9bb4871a10 test-phases: remove the test
Summary:
The test is mostly about manipulating phases and phase exchange in bundle2.
Both of them are gone with narrow-heads, which makes phases immutable.
Practically, phases affect whether commits are immutable and that are covered
by individual tests (ex. amend tests check amend fails on public commits).

Reviewed By: kulshrax

Differential Revision: D22174955

fbshipit-source-id: cabc0de552f0ede54a23a6e6eec47b14c2a863b9
2020-06-29 11:29:03 -07:00
Jun Wu
46da14cc76 hiddenerror: remove extension
Summary:
With narrow-heads (enabled in production and most tests) hiddenerror will
never happen. Remove the extension.

Reviewed By: kulshrax

Differential Revision: D22174987

fbshipit-source-id: e3e3823d3da89dfd51b60f65f8e138ea723cc00f
2020-06-29 11:29:03 -07:00
Jun Wu
11e6a05277 test-bundle2-pushback: remove the test
Summary: The pushback behavior is already tested extensively in pushrebase tests.

Reviewed By: kulshrax

Differential Revision: D22130172

fbshipit-source-id: 7b3a5ab2792969b1dce57ae09406aef063450568
2020-06-29 11:29:03 -07:00
Jun Wu
741016fb77 test-flagprocessor: remove the test
Summary:
We don't use the flag processor framework for things other than LFS in the
non-Rust code. It is coupled with revlog, which is going away. Our LFS usage is
covered by other tests.

Reviewed By: kulshrax

Differential Revision: D22130168

fbshipit-source-id: 78a04df49961e2faca0def71daeec6a40e45c4b5
2020-06-29 11:29:03 -07:00
Jun Wu
c3124548eb tests: remove tests about legacy phase exchange
Summary:
We have narrow-heads on in production. Phases are decided by remote bookmarks
instead of exchanged separately. Remove the test since it's no longer relevant.

Reviewed By: sfilipco

Differential Revision: D22052477

fbshipit-source-id: c60382448d5e4d3d2d1225762b6c133873016881
2020-06-29 11:29:03 -07:00
Jun Wu
5bb0223a54 localrepo: fix headrevs ordering
Summary:
The return order of `index2.headsancestors` and `index.headrevs` are different.
Fix it. This affects the default commit to update to after `hg clone` in some
tests.

Reviewed By: sfilipco

Differential Revision: D22200496

fbshipit-source-id: 273201461c814241ce8dafa6f7ca00f72ea83eab
2020-06-29 11:29:03 -07:00
Jun Wu
e97f281c3e repo: hide narrow-heads migration message on repo creation
Summary:
If the repo is newly created, do not show the migration message.
This makes migration smoother.

Reviewed By: sfilipco

Differential Revision: D22052480

fbshipit-source-id: 4857bcb3e38094501eaa63a52f09d49853cf761b
2020-06-29 11:04:23 -07:00
Jun Wu
01d2df5d5f repo: move remotenames heads logic to core
Summary:
This allows narrow-heads head calculation without the remotenames extension.

The test about related internal APIs is deleted. Other tests will cover the heads calculation indirectly.

Reviewed By: sfilipco

Differential Revision: D22052476

fbshipit-source-id: 99ad01b075b93e135d7f6c1bc27d837b19337726
2020-06-26 20:42:20 -07:00
Jun Wu
9630ef4a4d sparse: add debugsparsematch to match paths against a given sparse profile
Summary:
This makes it possible to implement sparse profile based target determinator
cleanly. The old approach is to change `.hg/sparse` every time, and run
`hg log --sparse FILE`, which is hacky and less efficient.

Reviewed By: kulshrax

Differential Revision: D15798327

fbshipit-source-id: 5d46e5b2619f70a911324776b39829446e87b932
2020-06-25 18:03:20 -07:00
Xavier Deguillard
d6ca62a1d7 win32: when removing file, open it as O_TEMPORARY as a last effort
Summary:
When a file is mmap'ed, removing it will always fail, even with all the rename
magic. The only option that works is to ask the OS to remove the file when
there is no other file handles to it. In Python, we can use the O_TEMPORARY for
that.

Reviewed By: quark-zju

Differential Revision: D22224572

fbshipit-source-id: bee564a3006c8389f506633da5622aa7a27421ac
2020-06-24 20:34:47 -07:00
Stefan Filip
cd49247df6 hgext: remove the churn extension
Summary: Not that useful and does not align with the direction we are headed.

Reviewed By: quark-zju

Differential Revision: D22213796

fbshipit-source-id: ffd86fc1a9207c134448836d0e54e48510a11135
2020-06-24 16:11:39 -07:00
Stefan Filip
f77fedfd80 python3: fix test-hghave.t
Summary: Binary vs string difference for compression input.

Reviewed By: quark-zju

Differential Revision: D22212333

fbshipit-source-id: ffbaab337ef4f1b4518a508814808ba7cbda690a
2020-06-24 15:31:37 -07:00
Meyer Jacobs
08533c2b4f Back out "rage: open subprocesses in text mode"
Summary:
Original commit changeset: d91cee7909f4

This change broke hg rage, see T69004770.

Reviewed By: ikostia, xavierd

Differential Revision: D22210509

fbshipit-source-id: 79c68a41d198e770b1077da7365078d5c1653829
2020-06-24 13:16:56 -07:00
Jun Wu
b4d3329bef win32text: remove the extension
Summary: The extension was deprecated by the eol extension.

Reviewed By: DurhamG

Differential Revision: D22129826

fbshipit-source-id: 293a57b4039f424154955454e0a7a74dc7d23069
2020-06-24 11:51:27 -07:00
Xavier Deguillard
ecee8f404a remotefilelog: properly decode the meta-flag
Summary:
In Python3, array indexing into a byte string returns a int, not a string.
Let's instead use the struct module to extract a byte string out of it that we
can then decode afterwards.

Reviewed By: DurhamG

Differential Revision: D22097226

fbshipit-source-id: e6b306b4d3bcf2ba08422296603b56fcadbb636e
2020-06-24 09:41:23 -07:00
Xavier Deguillard
c0e458788a tests: fix the progress tests
Summary:
These were broken mostly due a test issue (using bytes instead of str), and a
small difference when printing "units_per_sec", which was an int in python2,
and was computed as a float in python3.

Reviewed By: DurhamG

Differential Revision: D22095813

fbshipit-source-id: 8af8332dad5366d2c168485b120a984ff1ba558a
2020-06-24 09:41:23 -07:00
Thomas Orozco
266607333c hg/mononoke: fix broken test message expectation
Summary:
I landed D22118926 (e288354caf) yesterday expecting those messages at about the same time
xavierd landed D21987918 (4d13ce1bcc), which removed them. This removes them from the
tests.

Reviewed By: StanislavGlebik

Differential Revision: D22204980

fbshipit-source-id: 6b1d696c93a07e942f86cd8df9a8e43037688728
2020-06-24 03:27:55 -07:00
Durham Goode
dab8077917 py3: fix test-command-template-t.py
Summary: It now passes

Reviewed By: quark-zju

Differential Revision: D22193416

fbshipit-source-id: 8c1a783eb9fe46de1773ec3b8c23465cb0c766b0
2020-06-24 01:43:35 -07:00
Durham Goode
ddd4801feb py3: fix test-absorb-t.py
Summary: It now passes

Reviewed By: quark-zju

Differential Revision: D22168764

fbshipit-source-id: 3be5e92419bc53d39a4e8b6c064794aa73fb4d23
2020-06-23 21:47:47 -07:00
Xavier Deguillard
c074611dee worker: remove the forkers
Summary:
Now that the workers are in Rust, we no longer need the forker version in
Python. For now, the Python LFS extension still uses the threaded worker so
keep this one for now, when that extension will be removed we can remove the
rest of the worker code.

In theory, not all repository would benefit from the Rust workers, but these
are not supported at FB due to not being remotefilelog based.

Reviewed By: DurhamG

Differential Revision: D21987295

fbshipit-source-id: d17b9730651671608cf13f7abe6a9bb32251e140
2020-06-23 18:47:44 -07:00
Xavier Deguillard
dc8c24ab30 remotefilelog: enable the rust stores by default
Summary:
The Rust store code has been enabled everywhere for a few weeks now, let's
enable it by default in the code. Future changes will remove the config as well
as all the code associated with the non Rust store code.

The various tests changes are due to small difference between the Rust code and
the Python one, the biggest one being it's handling of corrupted packfiles. The
old code silently ignored them, while the new one errors out for local
packfiles. The test-lfs-bundle.t difference is just due to an ordering
difference between Python and Rust.

Reviewed By: kulshrax

Differential Revision: D21985744

fbshipit-source-id: 10410560193476bc303a72e7583f84924a6de820
2020-06-23 18:47:44 -07:00
Jun Wu
5d5fca5d6c sigtrace: support collecting sigtrace periodically automatically
Summary:
There are lots of "hanging" questions in the support group. While not all of
them are our fault (ex. mergedriver), we don't have an easy reply to tell
users what's actually going on.

This diff adds a way to write sigtrace periodically so we can include it in
rage output.

Reviewed By: sfilipco

Differential Revision: D22009699

fbshipit-source-id: 5349f613b08507ed02cc0e3fa00963fd7d4c3d21
2020-06-23 14:11:49 -07:00
Jun Wu
1020f76e7d stackdesc: remove the crate
Summary: The tracing APIs and error context APIs can achieve similar effects.

Reviewed By: xavierd

Differential Revision: D22129585

fbshipit-source-id: 0626e3f4c1a552c69c046ff06ac36f5e98a6c3d8
2020-06-23 14:06:54 -07:00
Jun Wu
98ec775d12 py3: fix treestate related tests
Reviewed By: sfilipco

Differential Revision: D22129405

fbshipit-source-id: 4b3338aa09b0834e3c23d94e50929f9e6105b8f6
2020-06-23 14:06:54 -07:00
Carolyn Busch
17dbece6ab tests: fix test-commit-interactive.t for py3
Summary: Make test-test-commit-interactive.t python 3 compatible. Note I wasn't sure if it was worthwhile to spend too much time on the translation portion of the test. If someone objects to the deletion, I can spend more time on it.

Reviewed By: DurhamG

Differential Revision: D22122960

fbshipit-source-id: d232971581fca0532ed05c8ca1fdb7b5e8bd99e0
2020-06-23 12:53:28 -07:00
Carolyn Busch
52d2b59ef5 tests: fix test-shelve-t.py in python3
Summary: Make shelve python 3 compatible.

Reviewed By: DurhamG

Differential Revision: D22122890

fbshipit-source-id: e96d7dc9192f48ad9ec4d33ef8107e99b99e3a61
2020-06-23 12:53:28 -07:00
Thomas Orozco
e288354caf sparse: prefetch trees before iterating through the whole manifest
Summary:
If we're going to iterate through the whole manifest, we should probably
prefetch it. Otherwise, we might end up doing a whole lot of sequential
fetching. We saw this this week when a change landed in sparse profiles that
caused requests to Mononoke to increase 100-fold.

Unfortunately, I don't think we can selectively only fetch the things we are
missing, so this just goes ahead and fetches everything unconditionally. If
there is a better way to do this, I'm all ears.

Reviewed By: StanislavGlebik, xavierd

Differential Revision: D22118926

fbshipit-source-id: f809fa48a7ff7b449866b42b247bf1da30097caa
2020-06-23 08:37:23 -07:00
Durham Goode
f9c03960e2 py3: set LC_ALL for a rm line in test-fb-hgext-pushrebase-cannot-rebasepublic.t
Summary:
This test appears to fail when run in hgbuild. It's not clear why it
doesn't repro locally, but it appears to be a locale issue, so let's just for it
to use C.

Reviewed By: singhsrb

Differential Revision: D22178365

fbshipit-source-id: 007c86681ff1bd4845b1feb41b7bbb031edf172b
2020-06-22 19:01:02 -07:00
Arun Kulshreshtha
c1d964b17e tests: make EdenAPI server available to tests
Summary: Add the EdenAPI server to the `hg_mononoke_run_tests` test target. This will make it possible to start an EdenAPI server in Mercurial's Buck tests.

Reviewed By: quark-zju

Differential Revision: D22147098

fbshipit-source-id: 1e29b7c06f1dd74f26d821943cd44ef09a7d505f
2020-06-22 15:18:20 -07:00
Durham Goode
a0f1169789 py3: fix test-fb-hgext-sampling.t
Summary: Now it passes

Reviewed By: quark-zju

Differential Revision: D22143037

fbshipit-source-id: 725269096d7f29872d945b9cbfceedfcfad4e459
2020-06-22 11:34:03 -07:00
Durham Goode
474877a124 py3: fix test-hook.t
Summary: It now passes

Reviewed By: quark-zju

Differential Revision: D22145284

fbshipit-source-id: 235a0d4b75bd1bae402e61cf36f978a515190a8f
2020-06-22 11:29:42 -07:00
Durham Goode
d9be71caf7 py3: fix test-bookmarkstore.py
Summary: Easy fix

Reviewed By: quark-zju

Differential Revision: D22143857

fbshipit-source-id: c35e7121a2be4152da24d19615dc38d551011282
2020-06-22 11:29:41 -07:00
Durham Goode
96e6337e2a py3: fixes test-export-t.py
Summary: It now passes

Reviewed By: quark-zju

Differential Revision: D22146555

fbshipit-source-id: 97b82a9dcd564a287e590940f6191456ca059868
2020-06-22 11:27:52 -07:00
Xavier Deguillard
b3a13a6fd8 debugedenimporthelper: make it python3 compatible
Summary:
While the code contained type information, some of them were not entirely
correct, path for instance should be str, command arguments are also passed in
as str, not bytes.

Reviewed By: ikostia

Differential Revision: D22104689

fbshipit-source-id: 50cbc9f81a3d9cc324f9105f0bbfbc71d9ca9e98
2020-06-19 16:52:30 -07:00
Arun Kulshreshtha
88ecb984c5 tests: rename environment variables
Summary: Per our ongoing effort to reduce the usage of potentially problematic terminology, rename the environment variables used to include and exclude tests.

Reviewed By: singhsrb

Differential Revision: D22143371

fbshipit-source-id: 97a0f73b21183f94d34af929e75cd531e4e24196
2020-06-19 15:33:18 -07:00
Durham Goode
74da65a38f py3: reupgrade mysql-connector-python to yummy version
Summary:
This is required for migrating to python 3. Originally this broke
builds on non-fbcode centos7 platforms. Since we don't need hgsql in non-fbcode
platforms, I've just tweaked it to skip the hgsql tests for non-fbcode centos7.

Reviewed By: quark-zju

Differential Revision: D22140187

fbshipit-source-id: 01676db9d006375bd3b5ae9e8f13f5592e36b074
2020-06-19 15:25:26 -07:00
Stefan Filip
a2cbbf7f89 python3: fix test-eol.t
Summary: In Python3, b'a\n'[-1] is 10 whereas in Python2 it is "\n".

Reviewed By: quark-zju

Differential Revision: D22128582

fbshipit-source-id: 3b13a14efd81ea2de4fd7125597e3c7ec6371492
2020-06-19 15:22:32 -07:00
Stefan Filip
d0987cd948 python3: fix test-atomictestfile.py
Summary: Python3

Reviewed By: xavierd

Differential Revision: D22125298

fbshipit-source-id: 2eb63a697be59bd33c9328fba5ef96a4cae66f43
2020-06-19 15:15:26 -07:00
Stefan Filip
690ccca46d python3: convert test-url to python3
Summary: Python 3

Reviewed By: quark-zju

Differential Revision: D22124540

fbshipit-source-id: 6ede3929bce8aed55c6203e305d08cfb312737e7
2020-06-19 15:11:55 -07:00
Durham Goode
d02d5cdbfe py3: fix test-fsmonitor*
Summary: These now pass

Reviewed By: quark-zju

Differential Revision: D22127383

fbshipit-source-id: bcaad400d9f849251e396b68ad1b4d04c8831314
2020-06-19 13:40:18 -07:00
Durham Goode
2138a84cee py3: fix test-fb-hgext-fastannotate-*
Summary: They now pass

Reviewed By: quark-zju

Differential Revision: D22126938

fbshipit-source-id: 60655e470d56187f50220b56a4628af73833066c
2020-06-19 13:40:18 -07:00
Durham Goode
fe720eb8cf py3: fix test-commit.t
Summary: It had some in-test python that needed to be updated.

Reviewed By: quark-zju

Differential Revision: D22097852

fbshipit-source-id: ebe4ab19a2e4bed73badc1d34d6fcf2db6072559
2020-06-19 13:40:17 -07:00
Durham Goode
4bfa413ecc py3: fix test-fb-hgext-errorredirect.t
Summary: It now passes

Reviewed By: quark-zju

Differential Revision: D22105461

fbshipit-source-id: 0f19faaf7fe3b365e2c825625838a74eea3ee9eb
2020-06-19 13:40:17 -07:00
Durham Goode
45b9cabfb3 py3: fix test-profile.t
Summary: Now it passes

Reviewed By: xavierd

Differential Revision: D22104180

fbshipit-source-id: 7d5f512d4294ced12d60e5ea7b2e9121447247c0
2020-06-19 13:40:17 -07:00
Durham Goode
24e2c44860 py3: fix test-dispatch.t and statprof
Summary: Fixes test-dispatch.t and fixes statprof while we're at it.

Reviewed By: xavierd

Differential Revision: D22103518

fbshipit-source-id: 7d795c6f9e3e2c8958746c10e39f55922a923dc5
2020-06-19 13:40:17 -07:00
Durham Goode
6dd5d70b1e py3: fix test-ssh.t
Summary: It now passes

Reviewed By: xavierd

Differential Revision: D22102239

fbshipit-source-id: 78a680eb06ad1ab1be94279c7c4668be9a8673be
2020-06-19 13:40:17 -07:00
Durham Goode
4409ebb103 py3: fix test-context.py
Summary:
It now works with python 3.  I dropped some test output.  In one case
it was confirming that various path encoding work, but we only support utf8 now.
I also dropped some bit that enabled debug output, since the output order was
not the same between python 2 and 3 and it seemed non-trivial to fix.

Reviewed By: xavierd

Differential Revision: D22101132

fbshipit-source-id: 682e7c61f1dd18cce34bdc014c85d560f883bd18
2020-06-19 13:40:17 -07:00
Durham Goode
7f1588131b py3: set LANG="en_US.UTF-8" for most tests
Summary:
We support unicode file paths, and in python 3 those get passed to
python libraries as unicode strings. The tests set LANG=C which mean the python
library tries to convert the path to ascii, but fails for any non-ascii
characters. Let's switch to LANG="en_US.UTF-8" to match our production
behavior and make tests about unicode paths work.

Reviewed By: xavierd

Differential Revision: D22098359

fbshipit-source-id: c3057edc66e6e32f7b8b49374e622d02bd05711f
2020-06-19 13:40:17 -07:00
Durham Goode
8a15d29e7f py3: fix test-visibility.t
Summary:
This module was using binascii.hex directly instead of using Mercurial hex
function.

Reviewed By: xavierd

Differential Revision: D22096490

fbshipit-source-id: 32c912c16415ffd94371ad945c4df2f5a82b92e5
2020-06-19 13:40:17 -07:00
Meyer Jacobs
49d5ada3f4 status: remove pickle formatter, fix test
Summary:
Remove pickle formatter, as part of python3 migration.

Fix test-status.t for python3 compatibility.

Remove test-status.t python2 requirement.

Reviewed By: xavierd

Differential Revision: D22121912

fbshipit-source-id: 1cfdd18880198ef16973463ed24cf9afb28a7afb
2020-06-19 13:31:25 -07:00
Meyer Jacobs
0a676501ac rage: open subprocesses in text mode
Summary: For python3 compatibility, explicitly open subprocesses in text mode (universal_newlines=True instead of text=True for backwards compatibility), and do not explicitly .decode("utf-8"), as all strings are already utf-8.

Reviewed By: xavierd

Differential Revision: D22123138

fbshipit-source-id: d91cee7909f4e87b4a04b85fa2a2929aec052da3
2020-06-19 10:19:21 -07:00
Stanislau Hlebik
2f71a99850 hgsql: add --syncfromreplica option
Summary:
Context: while syncing ovrsource commits into fbsource as a preparation for
megarepo we noticed that there are some commits that are particularly large
(e.g. up to 4Gb). Syncing them causes hgsql to become unavailable for 10-20
mins until all hg servers catch up - during that time hg log -r tip --forcesync
would just throw mysql unavailable errors.

As a mitigation for this we tried to make hgsql read from replicas instead of
master and it worked! (see D22094976 for more details). However the approach we
chose was quite hacky.

This diff tries to make it less hacky. It add --syncfromreplica option which
will be used by remote_backup.sh script on hg servers. if we don't have a lot
of read traffic on hg servers (and it should be the case for repos that are
hosted on Mononoke) then hg servers should try to read mostly from replica.

One important note here - the repository's state *might* go back in time with --syncfromreplica. I.e. consider the case where we move a bookmark without adding a new commit. Now, let's say local repository got the latest state from mysql leader. Then when we try to sync from replica if this replica is behind the local state of repository then we'd fetch the bookmarks from replica even though they are older.
With our current setup where we have a lot of different repos on different hg servers in completely different state this problem should be acceptable.

Reviewed By: ikostia

Differential Revision: D22118491

fbshipit-source-id: 4bfa869b697326441de6c004cd548df483049b9d
2020-06-19 10:16:44 -07:00
Xavier Deguillard
7943c9a7fd tests: fix test-lfs.t in python3
Summary:
The write method returns the number of bytes written, and python3 print these
if not captured.

Reviewed By: quark-zju

Differential Revision: D22096665

fbshipit-source-id: 2b1abd994df4c705515a6dc3d01c720f056f0411
2020-06-18 18:52:05 -07:00
Xavier Deguillard
592d84dffb tests: fix test-fb-hgext-remotefilelog-prefetch.t in python3
Summary:
The expected message are printed via repo.ui.debug, which may not be the same
device as print uses, and thus the output may be interleaved in a different
way. By using the same way of printing, this issue is avoided.

Reviewed By: ikostia

Differential Revision: D22097487

fbshipit-source-id: 6e49f44987f5660a00e72c082f0a5a483dded9ae
2020-06-18 15:17:04 -07:00
Mark Thomas
b0b6425f63 visibility: add hg debugvisibility status
Summary: Add a command to print out the current status of visibility tracking.

Reviewed By: quark-zju

Differential Revision: D22089413

fbshipit-source-id: 729e9f36fbc13ba90518dcd428a44c02ce358167
2020-06-18 12:15:00 -07:00
Mark Thomas
2eb20def5a commitcloud: require visibleheads for sync
Summary: Commit cloud sync works best when visibleheads are enabled.  Default to requiring it.

Reviewed By: quark-zju

Differential Revision: D22089414

fbshipit-source-id: b786103d5c5f65a7908eb97a973af9eca5990b22
2020-06-18 12:15:00 -07:00
Xavier Deguillard
67db664778 dynamicconfig: read file as bytes
Summary:
Somehow reading the file with `open("r")` will try to decode it as ascii, but
that file may contain utf-8 characters, so open it as bytes, and then decode
it.

Reviewed By: DurhamG

Differential Revision: D22105188

fbshipit-source-id: 0cfbd8c5417b637dd76391f86226e24ee663baf7
2020-06-18 10:44:57 -07:00
Mark Thomas
d9702a314a sampling: log repo root and repo shared root
Summary:
Add logging of the repo root and repo shared root to the sampling extension.

Reduce the number of different strings that are logged by replacing any path
component that equals the user's username (e.g. their home directory) with
`$USER`.

Reviewed By: farnz

Differential Revision: D22066053

fbshipit-source-id: 39221e5182b3d4df51afa386497003e637a50b13
2020-06-16 10:25:03 -07:00
Carolyn Busch
89f238b8dd Replace whitelist/blacklist term
Summary: Replaces usages of whitelist/blacklist with include/exclude/allow. These terms are more descriptive and less likely to contribute to racial stereotyping. More context: https://fb.workplace.com/groups/sourcecontrolteam/permalink/2926049127516414/

Reviewed By: farnz

Differential Revision: D22039299

fbshipit-source-id: d5b4cdeca681e1f4c992f7ef0b9f772b2ae1abd3
2020-06-15 15:01:19 -07:00
Jun Wu
6584ad18f6 run-tests: add a way to record $TESTTMP changes in source control
Summary:
Add a `--record` flag, which uses `git` to track changes in `$TESTTMP`.
I use it to track changes with C revlog vs the Rust revlog.

Reviewed By: farnz

Differential Revision: D22007501

fbshipit-source-id: a8027aa4b2b3b97c3cf5f642434451826fcbded9
2020-06-15 14:41:52 -07:00
Carolyn Busch
2c7f30d0c4 configparser: replace whitelist/blacklist term
Summary: Replace usages of whitelist/blacklist with include/exclude/filter/allow. These terms are more descriptive and less likely to contribute to racial stereotyping. More context: https://fb.workplace.com/groups/sourcecontrolteam/permalink/2926049127516414/

Reviewed By: kulshrax

Differential Revision: D22039298

fbshipit-source-id: 255c7389ee5ce5e54bbccdfb05ffa4cafc6958e5
2020-06-15 12:47:08 -07:00
Jun Wu
295047e02a tests: remove some rarely used tests
Summary:
Those tests show up as "skipped". I removed some rarely used ones:
- test-check-jshint: we seldom write javascript.
- test-check-shbang: a slow test that does not do much.
- test-chg: chg is being tested in other tests by default.
- test-docker-packaging: probalby already broken, we don't use docker.
- test-verify-repo-operations: a slow test that is too expensive to run with
  limited value.

Reviewed By: markbt

Differential Revision: D21989103

fbshipit-source-id: 8080ad68dc75b59f87336b94af38c8231f4f10f4
2020-06-15 11:36:07 -07:00
Jun Wu
7728e73e01 mutation: do not auto migrate if proxy-obsstore is enabled
Summary:
There is no need to migrate if the obsstore is a proxy to the mutation store.
This avoids a crash reading the attribute `_all`.

Reviewed By: DurhamG

Differential Revision: D21999245

fbshipit-source-id: bfa6439982834c6835412fc175132526525af548
2020-06-11 10:00:42 -07:00
Xavier Deguillard
e2bb3e23d7 tests: do not enable mutation for test-common-commands-fb.t
Summary: The test breaks, let's not enable mutation for it.

Reviewed By: DurhamG

Differential Revision: D21998151

fbshipit-source-id: 9c06485287d906837444f39faf90886933decc9b
2020-06-11 09:44:24 -07:00
Durham Goode
17eb13e7b5 configs: fix config generation when executed from outside the repo
Summary:
When kicking off the background process, we were depending on the
current working directory being inside the repo. This is not always true, like
when the current command was invoked like `hg -R xxx log -r .`. Let's invoke the
debugdynamicconfig command with the explicit path.

Reviewed By: quark-zju

Differential Revision: D21983297

fbshipit-source-id: 72981ea596e62dced3918f2fc6272953ab3d84cd
2020-06-10 22:16:39 -07:00
Xavier Deguillard
16777c3d81 merge: remove the rustworkers option
Summary: It's now the default.

Reviewed By: DurhamG

Differential Revision: D21981563

fbshipit-source-id: 9e27e65ea8e47019f1542a505f5b7726c2cbeba2
2020-06-10 20:10:29 -07:00
Xavier Deguillard
d4a20e4160 tests: disable treemanifest in test-fb-hgext-pushrebase-protection.t
Summary:
Treemanifest was recently enabled in this test, but it breaks the Windows
tests. For now, let's just go back to the previous state and we can investigate
later.

Differential Revision: D21989349

fbshipit-source-id: fb3d3d1315400f56a6166a01112affc0a4d96da6
2020-06-10 19:37:13 -07:00
Xavier Deguillard
879e485aa9 tests: fix test-requires-t.py
Summary:
Somehow clone-dst isn't empty which makes the second clone to fail due to it,
let's just clone it elsewhere.

Differential Revision: D21989189

fbshipit-source-id: 125f33f3f498d0c089785018e39ee7c5b795b472
2020-06-10 19:37:13 -07:00
Jun Wu
704fb871c6 tests: enable mutation for some Python tests
Summary: Those tests only need minor changes to be compatible with mutation.

Reviewed By: sfilipco

Differential Revision: D21913606

fbshipit-source-id: 0a2b0e08cb558960a7d0f938300f375c34457a62
2020-06-10 19:30:01 -07:00
Jun Wu
5344951764 tests: turn on mutation, disable obsstore for tests
Summary:
Incompatible tests are blacklisted.

The affects non-tests environment: `proxy-obsstore` is turned on.
That is in theory not very different from having an empty obsstore.
If it becomes an issue we can easily turn it off.

Reviewed By: sfilipco

Differential Revision: D21899139

fbshipit-source-id: e4a87ecced0542e7852b48b1a807775e523b3cc9
2020-06-10 19:30:01 -07:00
Jun Wu
74ff740a59 tests: migrate more tests to mutation
Summary: Those tests can be migrated with minor changes like rev number fixups.

Reviewed By: sfilipco

Differential Revision: D21913589

fbshipit-source-id: 0ee080ea9d70ded74c07ce6a93d309437b992bd6
2020-06-10 19:30:01 -07:00
Jun Wu
d388ab6674 test-amend: use mutation
Reviewed By: sfilipco

Differential Revision: D21899140

fbshipit-source-id: d1707ec91ee1802bda88a0b1c1be246dfc89ef97
2020-06-10 19:30:00 -07:00
Jun Wu
03a5255e56 test-drawdag: use modern setup
Summary: Some `x` commits become `o` because they don't have successors.

Reviewed By: sfilipco

Differential Revision: D21913601

fbshipit-source-id: 8d23edd4daa948433969460be9e6488865be7fb0
2020-06-10 19:30:00 -07:00
Jun Wu
4efd06e29b test-commit-revive: use modern configs
Reviewed By: sfilipco

Differential Revision: D21913593

fbshipit-source-id: fb83477fde8287da34e67c2e34c6269029d0469f
2020-06-10 19:30:00 -07:00
Jun Wu
41dd58675e tests: migrate some tests to use mutation
Summary:
Change `configure evolution` to `configure mutation-norecord`.
The tests pass without further modification.

Reviewed By: sfilipco

Differential Revision: D21913598

fbshipit-source-id: 93ac6ce21fb87482a388508f151520f4e6f0bd31
2020-06-10 19:29:59 -07:00
Jun Wu
19326b3489 run-tests: make output format friendly for adhoc scripts
Summary:
I found myself friendly editing the output of run-tests.py:

  Failed test-failure.t: output changed
  Failed test-failure-unicode.t: output changed

to extract file names:

  test-failure-unicode.t
  test-failure.t

Then use the file names as parameters to other commands, like `run-tests.py`
again, or `hg revert`, or `hg shelve`.

Change the output format to print the filenames directly to make it easier to
use.

Reviewed By: sfilipco

Differential Revision: D21913609

fbshipit-source-id: 4b1d2265f384ad9afbe478b7ff0d6e543eff00df
2020-06-10 19:29:59 -07:00
Jun Wu
812b9c546b contrib: remove obsstore related perf commands
Summary: This unblocks switching mutation on for test-contrib-perf.t

Reviewed By: sfilipco

Differential Revision: D21913605

fbshipit-source-id: 045e7ad7d71709e5f52171ab28b8da605fd2d540
2020-06-10 19:29:58 -07:00
Jun Wu
5140e6950b cleanobsstore: remove the extension
Summary: We're getting rid of obsstore. The extension is no longer needed.

Reviewed By: sfilipco

Differential Revision: D21899142

fbshipit-source-id: 6e4dd2b2ddfa9325c19d6d1d9951099748260904
2020-06-10 19:29:58 -07:00
Jun Wu
cb68b3c6a0 commitcloud: remove pullcreatemarkers feature
Summary:
The feature is off in production.

It calls the "scan changelog" code path in pullcreatemarkers.py, which
is also unused in production.

This allows us to remove a test that no longer passes with the mutation config.

Remove it.

Reviewed By: sfilipco

Differential Revision: D21913600

fbshipit-source-id: 23850fca2d1dc3d135d25954f00a08dc6d13972e
2020-06-10 19:29:58 -07:00
Jun Wu
38141700d8 test-fb-hgext-inhibit: remove the test
Summary:
The test uses `obsolete.revive`, which is no longer supported.
The alternative is to use unhide / undo which revives commits by changing
visibleheads directly.

Reviewed By: sfilipco

Differential Revision: D21913591

fbshipit-source-id: fea8c00692ba84c3a079012176970efb5aa29fae
2020-06-10 19:29:57 -07:00
Jun Wu
5fd229d2f1 test-obsolete-bounds-checking: remove the test
Summary: We're migrating off obsstore. The test is no longer relevant.

Reviewed By: sfilipco

Differential Revision: D21913592

fbshipit-source-id: 8a721a9eea19ad04027f014727cdf0e6fb9a6b60
2020-06-10 19:29:57 -07:00
Jun Wu
8a8e8a8948 test-histedit-obsolete: remove the test
Summary:
The test is mostly about obsmarkers and is not that valuable with mutation.
Delete it since we do have mutation + histedit test coverage.

Reviewed By: sfilipco

Differential Revision: D21913594

fbshipit-source-id: 8c785a698fcf7c0d9f947e961c66960c13ea1111
2020-06-10 19:29:57 -07:00
Jun Wu
530723b653 arcdiff: use core autopull API
Summary: This unblocks turning mutation on for test-commitcloud-lazypull-phab.t.

Reviewed By: sfilipco

Differential Revision: D21913590

fbshipit-source-id: 2580f2c054a3db753d40ea5aacdb8d2860e8cd3b
2020-06-10 19:29:56 -07:00
Jun Wu
f231cd0db3 unamend: use core autopull API
Summary: This unblocks turning on mutation for test-commitcloud-lazypull.t

Reviewed By: sfilipco

Differential Revision: D21913604

fbshipit-source-id: 5f52b179cea526f7260bf036323926b779da46f8
2020-06-10 19:29:56 -07:00
Jun Wu
7ed5a1ebfd test-bundle2-exchange: remove the test
Summary:
The test is coupled with legacy logic (obsmarker, phase exchange, over
ssh/http, bundle1, etc.), is flaky (6%-10% flaky score), and hard to maintain.
It provides little value since we probably want Thrift / Serde / HTTP protocols
instead of improving bundle2. Therefore remove it.

Reviewed By: sfilipco

Differential Revision: D21913603

fbshipit-source-id: 9d3d7410e60b67aadf816c917949772f991d2e65
2020-06-10 19:29:55 -07:00
Jun Wu
72881bf471 smartlog: remove obsolete templates
Summary:
They are no-op with mutation, which is enabled in production. Therefore remove
the template keywords and tests.

Reviewed By: sfilipco

Differential Revision: D21913602

fbshipit-source-id: 40ef3a915d591d6bcae2ca7931e388b5d5e00c25
2020-06-10 19:29:55 -07:00
Jun Wu
3c841e26c5 obsolete: ignore prune markers if visibility is on
Summary:
Pruned commits are handled by visibility. Ignore them when calculating
`obsolete()`.

This change makes transition to mutation smoother. The latter does not allow
obsoleting commits without successors.

Practically, this means some `x` commits will show as `o`s.

Reviewed By: sfilipco

Differential Revision: D21913596

fbshipit-source-id: 8a6495d040595ead1f6f08cf81e095e25cd8ff1f
2020-06-10 19:29:55 -07:00
Jun Wu
49c75cfa9d debugobsolete: stop printing obsmarkers
Summary: This makes transition to mutation smoother.

Reviewed By: sfilipco

Differential Revision: D21913599

fbshipit-source-id: 74cc0b7f0608a952eded4a40291b56b291a221e5
2020-06-10 19:29:54 -07:00
Jun Wu
ff888f03a6 repair: remove "saved backup bundle to" message
Summary:
The code path printing that message is rarely used in production setup.  This
makes transition to mutation easier.

Reviewed By: sfilipco

Differential Revision: D21913595

fbshipit-source-id: 3aa22575c11e38dbb7d4c4cbc7aad8dde2e755ed
2020-06-10 19:29:54 -07:00
Jun Wu
9044ccc3da bundle2: remove 'n new obsolescence markers' message
Summary: This makes transition to mutation smoother.

Reviewed By: sfilipco

Differential Revision: D21913608

fbshipit-source-id: b9ba470572ed68dff75104bba9dbb5c8622dcfb0
2020-06-10 19:29:54 -07:00
Jun Wu
9cd4491c02 transaction: remove summary callback
Summary:
The summary callback is only used to display "obsoleted n changesets".
Remove it to make transition to mutation smoother.

Reviewed By: sfilipco

Differential Revision: D21913597

fbshipit-source-id: e47fa9df0033d1302ffc8dfa3b9885eb75861f4b
2020-06-10 19:29:53 -07:00
Durham Goode
9473b487b5 tests: enable treemanifest for ~100 more tests
Summary:
Enables treemanifest for about 100 more tests. To make them pass I had
to expose the gettreepack capability from peers, which just works, and enable
treeonly and sendtrees by default in the tests, which I probably should've done
before anyway.

Reviewed By: quark-zju

Differential Revision: D21894955

fbshipit-source-id: 7a6a4d453824fb8c81a797a5487bf2ecc2b67761
2020-06-10 19:29:48 -07:00
Xavier Deguillard
edd44536ae transaction: copy files before truncation
Summary:
On Windows, if a file is memory mapped it cannot be truncated, unfortunately,
with the 00changelog.i being almost 500MB, this means that every time Mercurial
starts, the file needs to be read entirely. With the code being moved to Rust,
this read is done twice, resulting in a memory consumption of over 900MB.

Instead of always trying truncate the file in place, let's just try to truncate
it first, and then copy it, truncate it and then move it back in place. This
will allow us to memory map the 00changelog.i on Windows, which should
significantly reduce the memory consumption of Mercurial.

Reviewed By: DurhamG

Differential Revision: D21953553

fbshipit-source-id: e0f447fea017a34c8da8cdbbc6914cee7b5b2bee
2020-06-10 19:29:45 -07:00
Durham Goode
6f7b096d91 treemanifest: override root node during normal hg push
Summary:
We need to support pushing legacy flat manifets commits without push
rebase. Currently we rebuild the tree on the server and recompute it's hash,
which can result in a tree hash instead of a flat hash for the pushed commit.
Since we're provided with the correct hash via the push, we should just use that
directly.

Since the hash isn't validated, it opens some opportunities for receiving
incorrect data from the server, but we can disable this functionality at some
point, once all legacy repos have been merged in.  Then we can get rid of the
need for flat manifest hashes entirely once we switch to a new hash scheme.

Reviewed By: quark-zju

Differential Revision: D21962513

fbshipit-source-id: 8cdaf3a4e2aba73d5fc97fcb78821d2c88f5284f
2020-06-10 19:29:45 -07:00
Carolyn Busch
9bd69cbb3a enable passing py3 tests
Summary: Enable all disabled py3 tests that are passing.

Reviewed By: xavierd

Differential Revision: D21896122

fbshipit-source-id: 35b8dd6bb7a1b9f2d002f1b021989f642ed790ec
2020-06-10 19:29:42 -07:00
Kostia Balytskyi
dc91c602d1 infinitepush: support setting a reason for disabling writes
Reviewed By: StanislavGlebik

Differential Revision: D21929217

fbshipit-source-id: 5924a29945da4b4bb4bbf6f8e93f427d66665900
2020-06-10 19:29:41 -07:00
Durham Goode
55ba025a8e tests: fix test-deprecate.t
Summary: I made a change before landing my last diff and didn't retest.

Reviewed By: xavierd

Differential Revision: D21944268

fbshipit-source-id: a5c820cef5b0fc019c7be5d096db9d0e7b3e5a44
2020-06-10 19:29:40 -07:00
Meyer Jacobs
96ef9dda5d debug: Add commit metadata storage and templating for marking stable commits
Summary:
Introduced a new local commit metadata storage system, smallcommitmetadata, which stores a simple local JSON file for a mapping of (node, category) -> value.

This data can be manipulated with the debugsmallcommitmetadata command, and can be consumed in the smartlog using the smallcommitmeta template func.

Total number of entries can be limited with smallcommitmetadata.entrylimit configuration option, which defaults to 100.

Reviewed By: DurhamG

Differential Revision: D21673611

fbshipit-source-id: 2239a47867118dd86b15944058505ddf67548549
2020-06-10 19:29:39 -07:00