Commit Graph

7 Commits

Author SHA1 Message Date
Durham Goode
ad813edcbd treemanifest: enable treemanifest by default in tests
Summary:
Now that all our repos are treemanifest, let's enable the extension by
default in tests. Once we're certain no one needs it in production we'll also
make it the default in core Mercurial.

This diff includes a minor fix in treemanifest to be aware of always-enabled
extensions. It won't matter until we actually add treemanifest to the list of
default enabled extensions, but I caught this while testing things.

Reviewed By: ikostia

Differential Revision: D15030253

fbshipit-source-id: d8361f915928b6ad90665e6ed330c1df5c8d8d86
2019-05-28 03:17:02 -07:00
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
4ddedaf7d2 tests: remove most rocksdb test cases
Summary:
RocksDB and InnoDB are highly compatibile. There is no need to test RocksDB
engine for every hgsql related tests. Only use rocksdb for 2 of the tests.

Reviewed By: phillco

Differential Revision: D10055068

fbshipit-source-id: f9b7ef546fe7d457b0390e49014ebbe56d3c12c1
2018-09-26 14:20:15 -07:00
Saurabh Singh
d2c0a06655 sqlrefill: fix bug leading to failure of commits after sqlrefill
Summary:
`test-hgsql-sqlrefill.t` exposes an issue which leads to the
repository ending up in an uncommittable state. This commit fixes that issue by
adding the expected data to the database.

Reviewed By: quark-zju

Differential Revision: D8925906

fbshipit-source-id: 1e0ec827df6e755f72575b03f094b0ca5a400e9b
2018-07-23 12:59:04 -07:00
Saurabh Singh
f517e8799c sqlrefill: add test for commits on repository failing after sqlrefill
Summary:
This commit exposes an issue where a successful `sqlrefill` on a
repository which had no data in the database leaves the repository in a state
which can take no further commits.

This exposed issue will be fixed in D8925906.

Reviewed By: quark-zju

Differential Revision: D8925904

fbshipit-source-id: c289c67d90fdb527e6b324ce10f44b0e79e66585
2018-07-23 12:59:03 -07:00
Saurabh Singh
a12fedd9e6 sqlrefill: fix issue with heads not being in sync after sqlrefill
Summary:
`test-hgsql-sqlrefill.t` exposed an issue with `sqlrefill` where the
database is inconsistent with the state of the repository if the repository had
no data in the database before the invocation of `sqlrefill`. This commit fixes
that issue by also updating the `revision_references` table in this case.

Reviewed By: quark-zju

Differential Revision: D8925895

fbshipit-source-id: ca94ba1b3bd168128edc0c845b2fc1439c15181c
2018-07-23 12:59:02 -07:00
Saurabh Singh
26ab49fd6c sqlrefill: introduce tests for sqlrefill
Summary:
This commit just introduces some tests for `sqlrefill`.

In particular, it exposes an issue with `sqlrefill` where the heads are not in
sync if the `sqlrefill` is used on a repository which has no corresponding
entry in the database.

Reviewed By: quark-zju

Differential Revision: D8925898

fbshipit-source-id: 46eb388feafd8c7ec61cf9bb61f774055a902867
2018-07-23 12:59:01 -07:00