Summary:
Make `import edenscm` take care of `sys.path` so as long as `import edenscm`
works, 3rd party pure Python dependencies and edenscmnative should be
importable.
This reduces adhoc sys.path handling in testutil.dott, and fixes an issue where
testing on Windows where `testuitl.dott` fails to run hg commands due to
missing 3rd party dependencies (because `edenscm.mercurial.entrypoint.run` is
not called, and edenscmdeps.zip is not in sys.path).
Reviewed By: sfilipco
Differential Revision: D16499458
fbshipit-source-id: 17e6e5754614dfcf352127d471c649ded4189e1a
Summary:
The `output` API is the thing that stops infinite output from being used.
If endless output is needed, it can be expressed using something like Python
generator. Then the callsites using `stdin` needs update as well.
Reviewed By: xavierd
Differential Revision: D16464660
fbshipit-source-id: 1b81c44c5089f03687aa63ed3ffda9a5399c199b
Summary:
Fix the Python code so the test actually runs.
The test took 102s, and now takes 4.8s.
Reviewed By: xavierd
Differential Revision: D16435788
fbshipit-source-id: 8dc2219fd05fd5915a592396ff72dd54f1ec730b
Summary:
This is done via:
python -m testutil.dott.translate --black --verify test-glog.t
hg mv --after test-glog.t test-glog-t.py
The test is currently broken (and skipped). It will be fixed in the next diff.
Reviewed By: xavierd
Differential Revision: D16452933
fbshipit-source-id: 40deb3c7f4c8d077de58ef4277be2129274b139c
Summary:
Remove logic printing rev numbers and comparing them with `log --no-graph`.
The test still tests rev numbers. But does not compare them with non-graph
log. This test is about `-G` after all.
This removes usage of programs including `sed`, `grep`, `cmp`, and `diff`.
Reviewed By: xavierd
Differential Revision: D16435790
fbshipit-source-id: 8d78a1d88ac0fb6feb32b8ec8516bac8a91fbdac
Summary:
This is the slowest `.t` test (108s). We're migrating away from obsmarkers.
The test also uses tricky shell functions that are hard to translate to `.py`.
Therefore just remove it.
Reviewed By: markbt
Differential Revision: D16435789
fbshipit-source-id: d8fca36d90525ed1db856239d1dafbcec73e7464
Summary:
Fix the Python code so the test actually runs.
The test took 114s, and now takes 6.7s.
Reviewed By: xavierd
Differential Revision: D16435786
fbshipit-source-id: 84caa4985a1b40189d31f163a479401206425b58
Summary:
This is done via:
python -m testutil.dott.translate --black --verify test-log.t
hg mv --after test-log.t test-log-t.py
The test is currently broken (and skipped). It will be fixed in the next diff.
Reviewed By: xavierd
Differential Revision: D16452930
fbshipit-source-id: 3376cebfe81bf9d103d041b2a79f53e7b303f7bd
Summary: This makes the test translatable. The second next diff will recover the test case.
Reviewed By: xavierd
Differential Revision: D16452922
fbshipit-source-id: 179b536d22f11a7a6a1501b289a84dd63d36a17c
Summary:
Fix the Python code so the test actually runs.
The test took 118s, and now takes 11s.
Reviewed By: xavierd
Differential Revision: D16452927
fbshipit-source-id: 6a975b76f64ec26c36c15aae4b21da3f4764276e
Summary:
This is done via:
python -m testutil.dott.translate --black --verify test-shelve.t
hg mv --after test-shelve.t test-shelve-t.py
The test is currently broken (and skipped). It will be fixed in the next diff.
Reviewed By: xavierd
Differential Revision: D16452928
fbshipit-source-id: d5dde98055230e1ad5730bb0f73fe3b6221542b5
Summary: The t -> py translator is not smart about ` >>` in output. Workaround it.
Reviewed By: xavierd
Differential Revision: D16452934
fbshipit-source-id: 234b24a793cfc629650d63b9b0f56b17cdfa9a65
Summary:
In production we use remotenames, which is a very different code path and
covered by remotenames tests. Therefore remove the non-remotenames pushpull
test.
The test took 247s.
Reviewed By: xavierd
Differential Revision: D16435787
fbshipit-source-id: dd35a9fdd3412c4b0391edcce8b7668ccb7bcf34
Summary:
Fix the Python code so the test actually runs.
The test took 143s, and now takes 5.5s.
Reviewed By: ikostia
Differential Revision: D16435791
fbshipit-source-id: 7eac98c371f78a90a5bb528350b9ff17f51a551c
Summary:
This is done via:
python -m testutil.dott.translate --black --verify test-revset.t
hg mv --after test-revset.t test-revset-t.py
The test is currently broken (and skipped), though. It will be fixed in the next diff.
Reviewed By: xavierd
Differential Revision: D16452931
fbshipit-source-id: 281d3b9edae86d536d4ed4872dc4e38afcda5589
Summary: This makes the test translatable. The second next diff will recover the test case.
Reviewed By: xavierd
Differential Revision: D16452923
fbshipit-source-id: ca45c42538012152f384a0cd8334a9c513507cad
Summary:
This is the 2nd slowest `.t` test. We're migrating away from bundles and
obsmarkers. The test also uses tricky shell functions that are hard to
translate to `.py`. Therefore just remove it.
Reviewed By: markbt
Differential Revision: D16435785
fbshipit-source-id: 93160ca12000c48c9cbd2b90de3631194cb913b1
Summary:
Manually fix the test so it runs. This is done by removing incompatible
features (cmp, diff), and rewritting bash for loops to Python loops.
It took 183s before, and 6.6s now.
Reviewed By: xavierd
Differential Revision: D16435711
fbshipit-source-id: abf8889caa8b9b7b4137c873f3926ce1c6792f55
Summary:
This is done via:
python -m testutil.dott.translate --black --verify test-command-template.t
hg mv --after test-command-template.t test-command-template-t.py
The test is currently broken, though. It will be fixed in the next diff.
Reviewed By: xavierd
Differential Revision: D16450199
fbshipit-source-id: 73f80fd616e34c402016ff82a37eb68651a75b6e
Summary: This makes the test auto-translatable.
Reviewed By: xavierd
Differential Revision: D16450198
fbshipit-source-id: 93bba2359d5d375995f8e18efc6274b3318b95b0
Summary:
This makes it possible to write:
sh % 'command' | 'head -2'
in tests
Reviewed By: xavierd
Differential Revision: D16452932
fbshipit-source-id: 8af1355cebc40085fb7af67ceb24a4d54783d388
Summary:
In case the command is `hg --cwd ...`, the side effect of changing pwd should
be reverted at the end of the command.
Reviewed By: xavierd
Differential Revision: D16452924
fbshipit-source-id: 82f96b66ad3fed123cb2e906fc51d6627b16c1f0
Summary: The "succeed" code path was missing in the `test` command.
Reviewed By: xavierd
Differential Revision: D16452921
fbshipit-source-id: a276b774c528edaf60e0ecbbad00c15ddd8ba1d1
Summary:
The `_repr` implementation can generate docstrings with trailing spaces if
`indent` is > 0.
Fix it by special handling the blank line case.
Reviewed By: xavierd
Differential Revision: D16452935
fbshipit-source-id: 99704ba3fb30b93aa35ba4fb16c1d853c58c6635
Summary:
In case there are multiple commands in a line, and the first command uses
redirections:
foo > bar && baz
The `> bar` got lost after translation. This is because the same `opts` Python
object (including `> bar` information) was returned and it was mutated.
Solve it by returning a copy of `opts` per command.
Reviewed By: xavierd
Differential Revision: D16452936
fbshipit-source-id: a7ab55cc44ebe628817f821412576e17f6f68a6f
Summary:
Make it possible to change the internal state of HGENCODING so we can run hg
logic within a single process without shelling out in the new dott test
framework.
Update testutil/dott to use it.
Reviewed By: xavierd
Differential Revision: D16452925
fbshipit-source-id: d21329854eeee171cc5d02d4f42f11dd273f2150
Summary: Only one place was using it, remove it.
Reviewed By: quark-zju
Differential Revision: D16423138
fbshipit-source-id: 8a679c5d841f9e404099ba69023d98e02fa6a65b
Summary: There is no longer any code depending on the python mutabledatapack.
Reviewed By: kulshrax
Differential Revision: D16392286
fbshipit-source-id: 7fa2a622d1df4e32846c5ab93639fd2d5b509a3e
Summary: This is now enabled for the entire fleet, let's hardcode this in the code now.
Reviewed By: kulshrax
Differential Revision: D16392289
fbshipit-source-id: 462152ded12d00cf8218526d51a911d6fe5975ca
Summary: Remove final fancyopts call to have all python parsing being done through native rust codepath, as well as clean-up some deprecated flags that would be special handling.
Reviewed By: quark-zju
Differential Revision: D16156284
fbshipit-source-id: ec5ccaeb982c78426e12ff1d7342b4ea6653e98e
Summary:
Replace the second to last fancyopts call with pure rust code parsing and error handling.
Make slightly nicer help messages for ambiguous commands instead of just saying every possible command possible.
Reviewed By: quark-zju
Differential Revision: D16063049
fbshipit-source-id: bfd9e58649b1de2d3485069ce8d5646927bc77f4
Summary:
Alias expansion originally occurs in mercurial through a chain of command handlers that point at their alias.
Now, aliases can be fully expanded early on into parsing to only resolve actual commands and not have to follow a chain of executions.
Reviewed By: quark-zju
Differential Revision: D16059122
fbshipit-source-id: cf28fba4a131ab29ceda87bc3e90d7a434e06625
Summary: Replacing another fancyopts call to be parsed by native Rust code. This diff introduces slightly hacky feeling behavior in order to handle cycles and resolving aliases, but will be fixed in a follow-up diff where Rust will fully expand the aliases completely removing the need for this confusing alias resolving, chaining, and execution.
Reviewed By: quark-zju
Differential Revision: D15902758
fbshipit-source-id: 11d9a479989a23de09bf96f8020d2fded6c06351
Summary:
Copytrace modified the global definitions table which was making it very difficult to keep track of side-effects as the code was executed, as well as making it harder to replace the fancyopts calls with native Rust.
Since the copytrace behavior can be achieved through a configuration, it now will no longer modify the global definitions table, and will display the correct flag for a user to use in order to get this same behavior.
Reviewed By: quark-zju
Differential Revision: D15902449
fbshipit-source-id: 1c254162d56823e65085b7047bb37513f187b487
Summary:
The current Python parsing library fancyopts does an early parse for global flags, as well as slightly different logic for parsing out flags.
Switching this fancyopts call should allow fancyopts to be completely replaced by the native code path, and start using Rust parsing for hg.
This enforces command line arguments to be utf8. At Facebook, our `hg` wrapper already crashes if that is not the case. So it shouldn't cause new issues.
Reviewed By: quark-zju
Differential Revision: D15837079
fbshipit-source-id: 95634ebc814f8865960181f23282e5283068057c
Summary:
The test was flaky:
--- test-fb-hgext-remotefilelog-local.t
+++ test-fb-hgext-remotefilelog-local.t.err
@@ -31,7 +31,6 @@
M x
M y
? a
- 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over 0.00s
$ hg add a
$ hg status
M x
Reviewed By: xavierd
Differential Revision: D16393051
fbshipit-source-id: 3dad1970200388b8339bc2e73b7a092336edc70d
Summary:
build_nupkg.py test will copy tests/ to build/embedded/tests/ before running
them. That breaks testutil.dott "edenscm" module discovery. Try to fix it by
making "edenscm" module discovery consider "build/embedded/python27.zip".
Reviewed By: xavierd
Differential Revision: D16383017
fbshipit-source-id: 52e19182d3e5e7267221244bd39d9a146928d8df
Summary: This newly added test keeps failing. Let's remove it from now.
Reviewed By: DurhamG
Differential Revision: D16381346
fbshipit-source-id: 11146d44fbbcd1e1c960fe4a0b6e3c28854f456d
Summary:
When rebasing or showing a diff for a commit which moved files, remotefilectx.ancestors (called by _tracefile) calculates the linkrev for each ancestor. Sometimes [1], this is a disaster:
* remotefilectx._linkrev executes its slow path and scans the change log.
* For each entry in the change log, remotefilectx._linkrev downloads trees if needed.
* Hg downloads trees one-by-one (as of D15964145).
remotefilectx.ancestors is only calculating linkrevs so it can sort the ancestors topologically. _tracefile only needs the ancestors to be ordered topologically, not by linkrev. remotefilectx.ancestors's calls to remotefilectx._linkrev are redundant.
Optimize _tracefile's use of remotefilectx.ancestors: order remotefilectx objects topologically (breadth-first) without sorting by linkrev. Create a new function for this purpose (topological_ancestors) to avoid possibly breaking other callers of remotefilectx.ancestors. As a side effect, make this new function return remotefilectx objects lazily, similar to the filectx.ancestors function.
On my machine, with warm caches, this speeds up 'hg diff -c' and 'hg rebase' for a modestly-sized commit. 'hg diff -c' takes 0.64 seconds, down from 65.6 seconds.
[1] Hypothesis: After 'hg amend', 'hg bundle' packages linkrevs which refer to the pre-amend commit (which is not serialized into the bundle) rather than the post-amend commit. 'hg unbundle' thus creates linkrevs referring to a missing commit.
Reviewed By: DurhamG
Differential Revision: D16297426
fbshipit-source-id: 407597d5e36fc06b33719c28f5ea5052e01dc7a3
Summary:
Testpilot can give us a lot of things for free, including the automatic
detection of flaky tests, disabling of them, re-enabling too, easy retries on
failure, timeouts, better tracking, and the list goes on.
At a first step, I'd like to make the testpilot runner the default in hgbuild
to get all the benefits listed above.
Reviewed By: quark-zju
Differential Revision: D16294182
fbshipit-source-id: aadfbac9eb05e9d64336daba7a50a6263e38c162
Summary: When all tests are skipped, run-tests.py no longer return a 80 error code.
Reviewed By: singhsrb
Differential Revision: D16380129
fbshipit-source-id: e84a3558df8c2c4ebef9a382a1172d859a47e220