Commit Graph

16 Commits

Author SHA1 Message Date
Jun Wu
ac67645de2 ignore: stop using "{}" patterns
Summary:
Those are treated differently in eden or git vs ripgrep's ignore crate.
Tracking issue: https://github.com/BurntSushi/ripgrep/issues/1183

Change the gitignore rule to ignore `{}` patterns to solve the issue.

Reviewed By: sfilipco

Differential Revision: D13924426

fbshipit-source-id: 910bfff159509f2840ddcd4b4351577629228257
2019-02-06 13:02:59 -08: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
c12e300bb8 codemod: move Python packages to edenscm
Summary:
Move top-level Python packages `mercurial`, `hgext` and `hgdemandimport` to
a new top-level package `edenscm`. This allows the Python packages provided by
the upstream Mercurial to be installed side-by-side.

To maintain compatibility, `edenscm/` gets added to `sys.path` in
`mercurial/__init__.py`.

Reviewed By: phillco, ikostia

Differential Revision: D13853115

fbshipit-source-id: b296b0673dc54c61ef6a591ebc687057ff53b22e
2019-01-28 18:35:41 -08:00
Kostia Balytskyi
c5aa7a01b3 chg: learn to build a static lib
Summary:
In order to be able to run `chg` from the main `hg.rust` binary, we decided
that we will turn it into a static lib. This diff teaches our current build
scripts to do this.

Reviewed By: quark-zju

Differential Revision: D10853906

fbshipit-source-id: 8e0f37aa7e52d4a0610f36d7903eb0a318c193ad
2018-11-05 10:08:29 -08:00
Kostia Balytskyi
47a5b8d6c7 make: improve windows make logic
Summary:
This relies on adding chef's unix toolchain to the PATH rather than copying stuff from LFS.
Plus, this sets the `HGDEV` env var, which causes `exec\hgmain\src\hgenv.rs` to load
environment from `build\env`. Thus, we don't need to copy `build\hg\hg-python` to the repo dir.

Reviewed By: quark-zju

Differential Revision: D9559617

fbshipit-source-id: de70b262d81befffc651ee82dd5f5e7e0a9c6ed3
2018-10-12 14:55:09 -07:00
Jun Wu
783b7ae902 windows: use MSYS binaries to support run-tests.py
Summary:
MSYS provides binaries that tests need so we no longer
depend on system binaries, which might be broken.

MSYS can provide `make.exe` to make `make local` working,
so we don't depend on other things to provide `make`.

As we're here, change `run-tests.py` to use the right Python
interpreter and escape Windows paths.

Reviewed By: phillco

Differential Revision: D9505926

fbshipit-source-id: f17e77dfc599069d4fe849057b7a198758c2dd42
2018-08-27 11:36:42 -07:00
Kostia Balytskyi
b6f9443b79 hg: add comprehensive/.testtimes to .gitignore
Reviewed By: quark-zju

Differential Revision: D9421830

fbshipit-source-id: 3e105f15ea640c34e5127fa53475356c86b2ff72
2018-08-21 10:05:49 -07:00
Kostia Balytskyi
cf2ddc6ae6 hg.rust: add support for rust binary in setup.py and make local
Summary:
This causes `make local` to build the new binary, copy the result into the
`.../hg` dir and rename it into `hg.rust` (while `hgmain` seems like a good
crate name, it seems like the binary should be called `hg.rust`, at least for
now)

Reviewed By: quark-zju

Differential Revision: D9218057

fbshipit-source-id: 49a0e09ae78b8cdb64c7158da3bb4179a47d4af9
2018-08-17 10:51:47 -07:00
Jun Wu
fe7d598f49 setup: make GitHub export build
Summary:
I cloned the GitHub export and found it does not build. It's easy to fix so
let's do so.

Reviewed By: phillco

Differential Revision: D8772772

fbshipit-source-id: 8e86576175270b541c03803e7357a3f76d29e25a
2018-07-09 15:08:05 -07:00
Jun Wu
58029547d6 cleanup: remove Cargo.lock from check-in
Summary:
They cause a lot of churn when updating vendored crates. It's unnecessary to
check them in because the vendored crates basically pinned versions of all
dependencies.

Also clean up .gitignore, since it does not support "syntax:re".

Reviewed By: DurhamG

Differential Revision: D7562533

fbshipit-source-id: b9fcade6f38c0652a1b19ac4f90827dac7eed181
2018-04-21 03:42:58 -07:00
Martijn Pieters
abd2175e71 hg: actually run the tests in fb/tests
Summary:
There are tests in fb/tests we don't run as part of the test suite. Update the makefile and add buck infrastructure to run them.

 - Update the test-common-commands-hg.t test
 - Re-generate the fbcode/.hgignore file from the updated .gitignore

Reviewed By: quark-zju

Differential Revision: D7584511

fbshipit-source-id: d85800dccf0eb569a68db4b9e1d9796e3d7ac957
2018-04-13 21:51:54 -07:00
Saurabh Singh
99bff7b6fe hgbuild: write deb packages to a consistent location
Summary:
Currently, the `build_deb.py` writes the packages to the directory
from which the script was invoked. This leads to issues in integrating with our
continuous build setup. Therefore, this commit changes the script to write to a
known location.

Reviewed By: quark-zju

Differential Revision: D7511832

fbshipit-source-id: 85beaf37e92418cae932fd81c72065cf5d64c249
2018-04-13 21:51:47 -07:00
Jun Wu
406b752720 tests: use an environment variable for getdb.sh location
Summary:
Make `library.sh` read `$HGTEST_GETDB_PATH` for `getdb.sh` location. Unify
`getdb.sh` used by infinitepush and hgsql into one.

Reviewed By: ryanmce

Differential Revision: D6974635

fbshipit-source-id: 55bcebfbdaca7f43fb0cfca0d3e089e76cf9f24e
2018-04-13 21:51:11 -07:00
Jun Wu
e2a5493b04 basepack: workaround Python's mmap fd limit
Summary:
This is a resend of https://phab.mercurial-scm.org/D1430, without breaking
Windows.

I encountered "too many opened files" problem due to treemanifest packs on my
laptop. This patch seems to be the easiest solution without side effects. Other
choices are deleting files (seem like an non-ideal workaround), forcing a
repack (could be slow), and rewriting using Rust (could take too long).

The root cause is Python's `mmap` implementation has to keep a fd internally
to support `mmapobj.resize` API. We only need read-only operation on the
mmap object so the fd is unnecessary. Re-implement a minimal mmap interface
for this purpose.

Reviewed By: DurhamG

Differential Revision: D6835890

fbshipit-source-id: 74c429e957cb8677682604eb02fc38b5b8d13ef7
2018-04-13 21:51:00 -07:00
Ryan McElroy
830f0b8f45 include severeal more files in .gitignore
Differential Revision: D6796041

fbshipit-source-id: 55711f4cc210f8bdddfe00162e0af9316a367948
2018-04-13 21:50:56 -07:00
Liubov Dmitrieva
38ec3e4bce scm: fix gitignore
Summary: fix gitignore

Reviewed By: ryanmce

Differential Revision: D6784902

fbshipit-source-id: fc7bdd7c224d89c2e68ee8817352fdddbcdeb7cf
2018-04-13 21:50:56 -07:00