Commit Graph

6 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
Jun Wu
d8bde83566 tests: fix test-extensions-default.t for buck
Summary: On buck build, extension discovery does not work.

Reviewed By: markbt

Differential Revision: D10862029

fbshipit-source-id: b9d5c4edde4d2f8518df47c22099fde29e2a09cc
2018-10-27 15:14:14 -07:00
Jun Wu
3c46b25bec hgext: remove unused extensions
Summary:
Remove extensions that are not used in prodution. These extensions are also
unlikely to be used in the future.

Reviewed By: ikostia

Differential Revision: D10473370

fbshipit-source-id: a936e30acd3ec4370434c583447942c6ee8d9b13
2018-10-20 19:08:43 -07:00
Durham Goode
3b2cabfe55 hg: fix extensions-default
Summary:
Suggesting disabled extensions uses extensions.loadpath, which is no
longer supported for core extensions. Since this test is just testing that the
extension can be disabled, let's not worry about the exact output.

Reviewed By: phillco

Differential Revision: D6802719

fbshipit-source-id: 2a602e086f4809676ef8dd36ffc30f021b3186fc
2018-04-13 21:50:57 -07:00
Phil Cohen
02d588a3bc extensions: fix reposetup() not getting called for DEFAULT_EXTENSIONS
Summary:
`_peerorrepo` calls `extensions.extensions()` to figure out on which modules to run reposetup. This uses a slightly
different code path than that patched by D6716674 and double-checks if an extension is enabled. So we need to patch here too.

Reviewed By: quark-zju

Differential Revision: D6758486

fbshipit-source-id: b5bfe2d11e5e2aeb2d3a0ee7c9d6e3e2c213233d
2018-04-13 21:50:53 -07:00
Phil Cohen
6095f32f96 extensions: enable githelp by default
Summary:
Demonstrate the full power of this batte station with the first extension to be default-enabled, `githelp.py`. This also lets us write a test for `DEFAULT_EXTENSIONS`
(`test-extensions-default.t`)

All other test changes are actual fallout from enabling the githelp extension.

Test Plan: Added a test.

Differential Revision: https://phabricator.intern.facebook.com/D6717098
2018-01-12 16:45:54 -08:00