Commit Graph

7 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
c2b973b47a absorb: fix message when there are only deleted commits
Summary:
Even if no new commits are created, absorb might still have "applied" some
changes by deleting commits. Let's fix the end-user message.

Reviewed By: DurhamG

Differential Revision: D13531959

fbshipit-source-id: 4d942f3ccd8201e8b62c8bc1c86227d41021b5f9
2018-12-20 17:54:23 -08:00
Jun Wu
5e0fc4c563 absorb: use scmutil.cleanupnodes
Summary:
`scmutil.cleanupnodes` was initially ported from absorb to simplify other
commands. Now use it to simplify absorb itself.

This solves a crash when `self.finalnode` is empty (ex. no new commits are
created, only with commits deletion).

Reviewed By: DurhamG

Differential Revision: D13531961

fbshipit-source-id: 7006b5ac5dfc4db897413d18ccd26eedde3c98d9
2018-12-20 17:54:22 -08:00
Jun Wu
e07d80c6af absorb: stop writing absorb_source metadata
Summary:
It was to workaround the upstream obsmarker design which cannot support cycles.
Now that our internal obsmarkers can have cycles just fine, and the upcoming
mutation metadata makes it impossible to have cycles. Drop the workaround.

Reviewed By: DurhamG

Differential Revision: D13531960

fbshipit-source-id: d569172f0d2d5a3b4e1f6589be44ac21a09604f3
2018-12-20 17:54:22 -08:00
Mark Thomas
529aa8872e absorb: use ngettext for message plurals
Summary: Pluralize messages using ngettext.

Reviewed By: quark-zju

Differential Revision: D12921683

fbshipit-source-id: a8dce90b3b9318597f888a8aca72351012de05ae
2018-11-06 03:19:01 -08:00
Jun Wu
8c4a52d608 config: enable obsstore by default
Summary:
This makes tests closer to production setup and removes a bunch of "saved
backup bundle to ..." messages.

With D9236657, this should not hurt server-side performance.

Unfortunately a lot tests cannot be migrated easily, mostly because revision
numbers are used. They are left with a TODO.

Reviewed By: DurhamG

Differential Revision: D9237694

fbshipit-source-id: c993fce18f07aba09f6d70964e248af8d501575a
2018-10-26 18:54:40 -07:00
Mark Thomas
ced2b923b9 absorb: rename absorb tests
Summary: Remove `fb-hgext` from absorb test filenames.

Reviewed By: ikostia

Differential Revision: D10382215

fbshipit-source-id: 97546b47e19558d9ba6fcf6aab594c51fc6d472f
2018-10-16 03:03:02 -07:00