Commit Graph

14173 Commits

Author SHA1 Message Date
Jun Wu
eaabc7f3c6 edenscm: move sys.path handling to top-level edenscm
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
2019-07-25 17:43:41 -07:00
Jun Wu
60cf7203a4 testutil/dott: add a note about endless output
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
2019-07-24 14:32:29 -07:00
Jun Wu
2b63b9480e test-glog: fix the test
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
2019-07-24 14:32:29 -07:00
Jun Wu
d59fb2f5e8 test-glog: auto translate the test
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
2019-07-24 14:32:29 -07:00
Jun Wu
cc01957f18 test-glog: remove some tricky shell logic
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
2019-07-24 14:32:29 -07:00
Jun Wu
53ae854e52 test-obsolete: remove the test
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
2019-07-24 14:32:28 -07:00
Jun Wu
586a9e3edd test-log: fix the test
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
2019-07-24 14:32:28 -07:00
Jun Wu
e92f297e03 test-log: auto translate the test
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
2019-07-24 14:32:28 -07:00
Jun Wu
840c8f654d test-log: comment out a test case that cannot be translated
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
2019-07-24 14:32:27 -07:00
Jun Wu
4da37857d6 test-shelve: fix the test
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
2019-07-24 14:32:27 -07:00
Jun Wu
eba05c3fe7 test-shelve: auto translate the test
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
2019-07-24 14:32:27 -07:00
Jun Wu
e12b4c9b88 test-shelve: make it translatable
Summary: The t -> py translator is not smart about `  >>` in output. Workaround it.

Reviewed By: xavierd

Differential Revision: D16452934

fbshipit-source-id: 234b24a793cfc629650d63b9b0f56b17cdfa9a65
2019-07-24 14:32:27 -07:00
Jun Wu
d1597f8192 test-bookmarks-pushpull: remove the test
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
2019-07-24 14:32:26 -07:00
Jun Wu
263d95d20f test-revset: fix the test
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
2019-07-24 14:32:26 -07:00
Jun Wu
1fdb83c768 test-revset: auto translate the test
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
2019-07-24 14:32:26 -07:00
Jun Wu
84ae2cbc73 test-revset: comment out a test case that cannot be translated
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
2019-07-24 14:32:26 -07:00
Jun Wu
2e6455665f test-obsolete-bundle-strip: remove the test
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
2019-07-24 14:32:25 -07:00
Jun Wu
c07c411b27 test-command-template: fix the test
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
2019-07-24 14:32:25 -07:00
Jun Wu
0789866163 test-command-template: auto translate the test
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
2019-07-24 14:32:25 -07:00
Jun Wu
55afd053a3 test-command-template: replace some '>' to '.'
Summary: This makes the test auto-translatable.

Reviewed By: xavierd

Differential Revision: D16450198

fbshipit-source-id: 93bba2359d5d375995f8e18efc6274b3318b95b0
2019-07-24 14:32:25 -07:00
Jun Wu
96c5c34019 testutil/dott: implement pipes, head and tail
Summary:
This makes it possible to write:

  sh % 'command' | 'head -2'

in tests

Reviewed By: xavierd

Differential Revision: D16452932

fbshipit-source-id: 8af1355cebc40085fb7af67ceb24a4d54783d388
2019-07-24 14:32:24 -07:00
Jun Wu
462a97942d testutil/dott: implement chmod +x
Summary: Some tests use `chmod +x`. Implement it.

Reviewed By: xavierd

Differential Revision: D16452926

fbshipit-source-id: e354e7e0be97422c8c7e0e7c620c34945481a982
2019-07-24 14:32:24 -07:00
Jun Wu
d49bdd9fed testutil/dott: restore cwd after a command
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
2019-07-24 14:32:24 -07:00
Jun Wu
4ee9de2bd7 testutil/dott: fix (re) pattern matching
Summary:
Fixes 2 obvious mistakes:
- Other code uses `trailing space` instead of `trailing spaces`.
- The second `re.match` was mistyped.

Reviewed By: xavierd

Differential Revision: D16452929

fbshipit-source-id: d13cb1f792c2a7275e130ff5314d733b307dd635
2019-07-24 14:32:24 -07:00
Jun Wu
ca42b02813 testutil/dott: fix test command
Summary: The "succeed" code path was missing in the `test` command.

Reviewed By: xavierd

Differential Revision: D16452921

fbshipit-source-id: a276b774c528edaf60e0ecbbad00c15ddd8ba1d1
2019-07-24 14:32:23 -07:00
Jun Wu
b88812e338 testutil: stop generating lines with trailing spaces
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
2019-07-24 14:32:23 -07:00
Jun Wu
8beb778255 testutil/dott: fix translator dropping redirections
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
2019-07-24 14:32:23 -07:00
Jun Wu
6cd7d1799c encoding: add a way to change HGENCODING at runtime
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
2019-07-24 14:32:23 -07:00
Xavier Deguillard
5d9d464558 tests: remove mutablehistorypack from tests
Summary: Only one place was using it, remove it.

Reviewed By: quark-zju

Differential Revision: D16423138

fbshipit-source-id: 8a679c5d841f9e404099ba69023d98e02fa6a65b
2019-07-24 10:34:31 -07:00
Xavier Deguillard
c6dccb4955 remotefilelog: all the tests are now using rust mutable datapack
Summary: There is no longer any code depending on the python mutabledatapack.

Reviewed By: kulshrax

Differential Revision: D16392286

fbshipit-source-id: 7fa2a622d1df4e32846c5ab93639fd2d5b509a3e
2019-07-24 10:34:31 -07:00
Xavier Deguillard
334e0c0c2e remotefilelog: the rust mutable stores are the default
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
2019-07-24 10:34:30 -07:00
Zeyi (Rice) Fan
a62bf843cf Back out "RFC: hg: make zsh completion to return list of draft commits"
Summary:
Original commit changeset: 3493895a12ae

This is breaking `arc pull` in fbsource S183062

 #commitClose

Reviewed By: mitrandir77, singhsrb, xavierd

Differential Revision: D16441944

fbshipit-source-id: fd3f5c7027be1468bd8194e6b24dd136b9b767d2
2019-07-23 13:07:14 -07:00
Jared Bosco
089e77642a dispatch: replace final fancyopts call with native rust
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
2019-07-20 01:06:35 -07:00
Jared Bosco
93949f4629 dispatch: replace alias expansion and fancyopts parsing call with native rust
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
2019-07-20 01:06:34 -07:00
Jared Bosco
ae89e32851 cliparser: expose method to perform alias expansion on arguments
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
2019-07-20 01:06:34 -07:00
Jared Bosco
5f02e5cd5c dispatch: replace _parse's call to fancyopts with native code
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
2019-07-20 01:06:33 -07:00
Jared Bosco
3c30d27350 copytrace: remove copytrace flag from mutating global options table
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
2019-07-20 01:06:33 -07:00
Jared Bosco
ee1fcc3d2d bindings: create cliparser native binding to replace fancyopts early parsing
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
2019-07-20 01:06:32 -07:00
Jared Bosco
95b0be5bdc dispatch: remove strictflags and related tests
Reviewed By: quark-zju

Differential Revision: D15833690

fbshipit-source-id: 3469d8def660b116c0f82c674a19f06b18f29211
2019-07-20 01:06:32 -07:00
Jun Wu
c2027cc740 test-revset-age: migrate to Python and stablize it
Summary:
The test was flaky:

  --- test-revset-age.t
  +++ test-revset-age.t.err
  @@ -13,7 +13,6 @@

   Check age ranges
     $ hg log -T '{rev} {desc}\n' -r 'age("<30")'
  -  5 Changeset 5 seconds ago
     $ hg log -T '{rev} {desc}\n' -r 'age("<7m30s")'
     4 Changeset 420 seconds ago
     5 Changeset 5 seconds ago
  @@ -22,7 +21,6 @@
     4 Changeset 420 seconds ago
     5 Changeset 5 seconds ago
     $ hg log -T '{rev} {desc}\n' -r 'age("<1d")'
  -  2 Changeset 86369 seconds ago
     3 Changeset 3800 seconds ago
     4 Changeset 420 seconds ago
     5 Changeset 5 seconds ago
  @@ -53,10 +51,10 @@
     $ hg log -T '{rev} {desc}\n' -r 'age(">1d")'
     0 Changeset 31536000 seconds ago
     1 Changeset 86401 seconds ago
  +  2 Changeset 86369 seconds ago
     $ hg log -T '{rev} {desc}\n' -r 'age(">365d")'
     0 Changeset 31536000 seconds ago
     $ hg log -T '{rev} {desc}\n' -r 'age("<64m")'
  -  3 Changeset 3800 seconds ago
     4 Changeset 420 seconds ago
     5 Changeset 5 seconds ago
     $ hg log -T '{rev} {desc}\n' -r 'age("<60m500s")'
  @@ -87,16 +85,16 @@
     hg: parse error: invalid age in age range: 5h-10d
     [255]
     $ hg log -T '{rev} {desc}\n' -r 'ancestorsaged(., "<1d")'
  -  2 Changeset 86369 seconds ago
     3 Changeset 3800 seconds ago
     4 Changeset 420 seconds ago
     5 Changeset 5 seconds ago
     $ hg log -T '{rev} {desc}\n' -r 'ancestorsaged(.^, "<1d")'
  -  2 Changeset 86369 seconds ago
     3 Changeset 3800 seconds ago
     4 Changeset 420 seconds ago
     $ hg log -T '{rev} {desc}\n' -r 'ancestorsaged(., "1d-20d")'
     1 Changeset 86401 seconds ago
  +  2 Changeset 86369 seconds ago
     $ hg log -T '{rev} {desc}\n' -r 'ancestorsaged(., ">1d")'
     0 Changeset 31536000 seconds ago
     1 Changeset 86401 seconds ago
  +  2 Changeset 86369 seconds ago

Translate it to Python and patch `time.time` to stablize it.

Reviewed By: xavierd

Differential Revision: D16396479

fbshipit-source-id: 553bfe36094b2a2cbe939319606a627323cfc9eb
2019-07-19 19:36:33 -07:00
Jun Wu
3f21de52f4 test-fb-hgext-remotefilelog-local: try to make it less flaky
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
2019-07-19 19:36:33 -07:00
Jun Wu
a77e9a4d5a test-fb-hgext-remotefilelog-bgprefetch: try to make it less flaky
Summary:
The test was flaky:

  --- test-fb-hgext-remotefilelog-bgprefetch.t
  +++ test-fb-hgext-remotefilelog-bgprefetch.t.err
  @@ -211,7 +211,6 @@
     $ find $CACHEDIR -type f | sort
     $ echo b > b
     $ hg commit -qAm b
  -  * files fetched over 1 fetches - (* misses, 0.00% hit ratio) over *s (glob)
     $ hg bookmark temporary
     $ sleep 1
     $ hg debugwaitonprefetch >/dev/null 2>%1
  @@ -266,7 +265,7 @@
     $ hg rebase -s temporary -d foo
     rebasing 3:58147a5b5242 "b" (temporary tip)
     saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/58147a5b5242-c3678817-rebase.hg (glob)
  -  3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over *s (glob)
  +  2 files fetched over 2 fetches - (2 misses, 0.00% hit ratio) over 0.00s
     $ sleep 1
     $ hg debugwaitonprefetch >/dev/null 2>%1
     $ sleep 1

Reviewed By: xavierd

Differential Revision: D16393049

fbshipit-source-id: fb558e9c7f9cc51b1b133471220ac4862b985098
2019-07-19 19:36:32 -07:00
Jun Wu
b785df33a4 test-shelve: try to make it less flaky
Summary:
`...s ago` is flaky.

    --- test-shelve.t
    +++ test-shelve.t.err
    @@ -885,7 +885,7 @@
       +patch a
     No-argument --patch should also work
       $ hg shelve --patch
    -  default-01      (*s ago)    shelve changes to: create conflict (glob)
    +  default-01      (15s ago)   shelve changes to: create conflict

       diff --git a/shelf-patch-b b/shelf-patch-b
       new file mode 100644

Reviewed By: xavierd

Differential Revision: D16393050

fbshipit-source-id: 3906eabfd7ba9e4b11e7c4c8f236324afc607fff
2019-07-19 19:36:32 -07:00
Jun Wu
fa23fa1a77 test-fb-hgext-treemanifest-prefetch: try to make it less flaky
Summary:
`sleep ...` makes test flaky.

   --- test-fb-hgext-treemanifest-prefetch.t
   +++ test-fb-hgext-treemanifest-prefetch.t.remotefilelog.true.shallowrepo.false.err
   @@ -554,7 +554,7 @@
      $ sleep 1
      $ hg debugwaitonrepack
      $ ls_l $CACHEDIR/master/packs/manifests | grep datapack | wc -l
   -  \s*1 (re)
   +  3
    #endif

Reviewed By: xavierd

Differential Revision: D16391376

fbshipit-source-id: 3dc1ee3d1c8b85bc6b0a58570443b89aef86f55a
2019-07-19 19:36:32 -07:00
Jun Wu
237846d4ca tests: try to make build_nupkg.py test work
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
2019-07-19 15:08:17 -07:00
Jun Wu
bc191c2aa5 test-dirstate-completion: fix the test
Summary: Avoid creating the same repo.

Reviewed By: xavierd

Differential Revision: D16381413

fbshipit-source-id: 9f1d6bee685af5cec26e40e7669ef794ce6b23ce
2019-07-19 13:27:08 -07:00
Xavier Deguillard
f0a2127ace tests: remove newly added flaky test in test-hgsubversion-push-command.py
Summary: This newly added test keeps failing. Let's remove it from now.

Reviewed By: DurhamG

Differential Revision: D16381346

fbshipit-source-id: 11146d44fbbcd1e1c960fe4a0b6e3c28854f456d
2019-07-19 13:09:23 -07:00
Matt Glazar
9b88f1e59b Fix slow rebase for commits which move files
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
2019-07-19 12:35:22 -07:00
Xavier Deguillard
ec9ec06360 run-tests: add testpilot test runner
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
2019-07-19 11:47:04 -07:00
Xavier Deguillard
9151a3cc24 tests: fix test-run-tests.t
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
2019-07-19 11:39:56 -07:00