Summary:
Let's move hgsubversion to absolute_import, just to be consistent with the rest
of Mercurial codebase.
Reviewed By: markbt
Differential Revision: D15392154
fbshipit-source-id: e4c32939aff0616790828da508f3feea158669e1
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
Summary:
In an upcoming diff we'll be making hgsubversion pull use a single
transaction. We need the lastpulled file to be part of that transaction. The
easiest way to do that is to store it in the database.
Reviewed By: quark-zju
Differential Revision: D13433558
fbshipit-source-id: 013ce09aa7a7382008979a7f424860fc98dc8b5d
Summary:
Previous code format attempt (D8173629) didn't cover all files due to `**/*.py`
was not expanded recursively by bash. That makes certain changes larger than
they should be (ex. D8675439). Now use zsh's `**/*.py` to format them.
Also fix Python syntax so black can run on more files, and all lint issues.
Reviewed By: phillco
Differential Revision: D8696912
fbshipit-source-id: 95f07aa0c5eb1b63947b0f77f534957f4ab65364
Summary:
According to scuba chart https://fburl.com/scuba/mn5nfdna, these are
not used by any critical client, don't seem useful and can be removed.
Reviewed By: quark-zju
Differential Revision: D8232616
fbshipit-source-id: ae07cfb00bfe45cd6f8c31f3fa0871c9ba1fdadf
Summary: Mostly empty lines removed and added. A few bugfixes on excessive line splitting.
Reviewed By: quark-zju
Differential Revision: D8199128
fbshipit-source-id: 90c1616061bfd7cfbba0b75f03f89683340374d5
Summary:
This looks most like a dirty hack in this stack, especially the largest file.
Unfortunately, on my some number of runs it looked like the output is not really
consistent: some lines were `verifying ...` and some `cannot verify ...` inconsistently
over the runs.
Hovewer, given that the `hgsubversion` test suite simply did not care about what
tests printed, I think this is acceptable.
Depends on D6719894
Test Plan: - `./run-tests.py`, see tests passing
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D6719906
Summary:
Here we make imports in `hgsubversion` tests work again.
This consists of two main parts:
1. tests were importing each other as python modules. Now that they have `-` in
their names, it is impossible. However, we can utilize some tricks to work
around this (`imp.load_source`)
2. tests where doing some weird location assumptions, we clean that up
Depends on D6719890
Test Plan: - `./run-tests -l test-hgsubversion-*`, see non-import-exception failures
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D6719894
Summary:
This migration allows `./run-tests.py` to run `hgsubversion` tests. Since hgsubversion
tests are actually python unittests, we don't care about their output at all,
they fail differently. But the behavior of the test suite require us to match
whatever the tests prints. We do this later in the stack.
Depends on D6719886
Test Plan: - check that tests are runnable at least
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D6719890
Summary:
This is in line with our general spirit of renaming things into test-extname-smth.
Depends on D6719883
Test Plan: - test fixes and runs follow in the stack
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D6719886
Summary:
Move tests to where we are used to them.
Note that I don't move comprehensive tests to the `tests` directory, since
I think that having them not run when `./run-tests.py` is run without arguments
may be a useful thing. In general, we may adopt this concept for the core as well.
If we decide we do want to move them, it's very easy to do.
Depends on D6719879
Test Plan: - fixups and test runs follow in the stack
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D6719883