Commit Graph

8 Commits

Author SHA1 Message Date
Jun Wu
9dc21f8d0b codemod: import from the edenscm package
Summary:
D13853115 adds `edenscm/` to `sys.path` and code still uses `import mercurial`.
That has nasty problems if both `import mercurial` and
`import edenscm.mercurial` are used, because Python would think `mercurial.foo`
and `edenscm.mercurial.foo` are different modules so code like
`try: ... except mercurial.error.Foo: ...`, or `isinstance(x, mercurial.foo.Bar)`
would fail to handle the `edenscm.mercurial` version. There are also some
module-level states (ex. `extensions._extensions`) that would cause trouble if
they have multiple versions in a single process.

Change imports to use the `edenscm` so ideally the `mercurial` is no longer
imported at all. Add checks in extensions.py to catch unexpected extensions
importing modules from the old (wrong) locations when running tests.

Reviewed By: phillco

Differential Revision: D13868981

fbshipit-source-id: f4e2513766957fd81d85407994f7521a08e4de48
2019-01-29 17:25:32 -08:00
Aida Getoeva
7046f81a00 bisect -c: fix empty changeset after sparse skip
Summary: If the there is no changeset left after sparse skip in `--command` mode, show the result and return, as it's done in manual testing mode.

Reviewed By: markbt

Differential Revision: D13650568

fbshipit-source-id: 8e867a38858d84d9a10078b74e2087318c81b01e
2019-01-14 11:55:11 -08:00
Aida Getoeva
7775a9c220 bisect: test -c in case when all nodes skipped
Summary: Adding new test to show that sparse skip with `--command` doesn't show the correct answer

Reviewed By: markbt

Differential Revision: D13650567

fbshipit-source-id: f4b6670fe67d6ef2543efedd91d9760e1e6bc74c
2019-01-14 11:55:11 -08:00
Kostia Balytskyi
650abf4b9e tests: stop importing sparse from an explicit python file
Summary:
Importing anything from python files with explicit breaks embedded
aproach we use on Windows.

For one of the tests, I did add `hg debugshell -c "from hgext import sparse;
print sparse.__file__` just to make sure the same file is used in practice.

Reviewed By: singhsrb

Differential Revision: D13258984

fbshipit-source-id: 4c86e1dccfd4f525a14019dc4b9586d798f2bffe
2018-11-30 02:19:16 -08:00
Kostia Balytskyi
86f07601f7 sparse: rename fbsparse into sparse in tests
Reviewed By: phillco

Differential Revision: D10335084

fbshipit-source-id: 91e0a17957561410e397a006f99ebf549d34e1e4
2018-10-16 14:27:29 -07:00
Aida Getoeva
346ddf5248 bisect: don't test empty commits in sparse profiles
Summary:
Currently `hg bisect` asks to run test on all commits it picked as a result of bisection, even if the changes between last checked nodes and chosen one relate to the files, which are not in the sparse profile.
And so it updates to the one of such commits, shows that "0 files were updated" and asks to run tests.

In this diff I check next potential node (result of bisecting) if there are changes between last good commit/last bad commit and the node. And go further to the next bisection iteration if the node can be skipped (nothing was changed since last good commit in sparse profile's files, so we can assume that the node is good as well).

If there are changes on both sides: between bad and the node, good and the node, I ask to run tests.

Reviewed By: markbt

Differential Revision: D9629683

fbshipit-source-id: f8c5d82f7b44ac14a9190c846ee65d635e447af1
2018-10-08 06:16:19 -07:00
Stanislau Hlebik
1b816bd86e revert bisect change
Summary:
In D7001328 we've added a new feature that skips commtis if there are no
changes relative to the sparse checkout. Unfortunately that causes lots of
treepacks downloads and makes bisect unusable. Let's revert the change.

Reviewed By: ryanmce, farnz

Differential Revision: D7182016

fbshipit-source-id: 274b29ca6a7b4c3faf83883b64f5ad3b0289873e
2018-04-13 21:51:23 -07:00
Serafeim Mellos
3a42733be6 Teach bisect to ignore empty commits on sparse checkouts
Summary: Skip empty commits in sparse repositories when doing bisection

Reviewed By: ryanmce, farnz

Differential Revision: D7001328

fbshipit-source-id: 8493d20389410b522e70ce41cc3e33ac9361781d
2018-04-13 21:51:12 -07:00