Commit Graph

42460 Commits

Author SHA1 Message Date
Ryan McElroy
4488942ef2 infinitepush: move infinitepush from fb-hgext to hgext
Summary:
This is part of the overall plan to move extensions from fb-hgext to
hgext. Follow up commits will address some of the test issues and move the
infinitepush related tests out of fb-hgext to hgext.

Test Plan: Ran all the tests.

Reviewers: rmcelroy, #mercurial, #sourcecontrol

Reviewed By: rmcelroy

Differential Revision: https://phabricator.intern.facebook.com/D6691670

Signature: 6691670:1515578586:8d7836aebb474856559c6dbe6fe2f572c8bdf7f1
2018-01-10 08:10:27 -08:00
Saurabh Singh
e803561cdc pushrebase: skip adding --to option to push command if it already exists
Summary:
pushrebase extension adds the --to option to push command if the
remotenames extension is not loaded. This is not a robust enough check as other
extensions like infinitepush can also add the --to  option leading to duplicate
options. This commit addresses the same.

Test Plan: Ran all the tests.

Reviewers: rmcelroy, #mercurial, #sourcecontrol

Reviewed By: rmcelroy

Differential Revision: https://phabricator.intern.facebook.com/D6691642

Signature: 6691642:1515578521:9f783df23df9fa8d3291a6f050cc1d5b6e5dd2fa
2018-01-10 08:10:27 -08:00
Kostia Balytskyi
8159540c93 setup.py: add windows conditioning
Summary: This makes fb_build_nupkg.py work again on Windows.

Test Plan:
- run `python fb_build_nupkg.py clean build --release test`
- run `.\build\hg\hg.exe sl` and some similar commands, see things pass

Reviewers: rmcelroy, #sourcecontrol

Reviewed By: rmcelroy

Differential Revision: https://phabricator.intern.facebook.com/D6692551

Signature: 6692551:1515591647:b23106a6a4bbd7b6443512cc6f4514c8092b78d8
2018-01-10 05:51:25 -08:00
Stanislau Hlebik
b13d15159a infinitepush: fix infinitepush pull for cgversion 3
Summary:
Previously if only cgversion 3 is supported by the server, then hg up HASH
may fail if _rebundle() is needed.
This diff fixes it by implementing the same logic as upstream mercurial. It
uses bundle capabilities to find out which versions client supports and it
intersects it with versions that are supported by the server.

This is grafted from D6655986

Test Plan:
Tested in fb-hgext: ran unit-test

Reviewers:

Subscribers:

Tasks:

Tags:
2018-01-09 22:41:46 -08:00
Mark Thomas
75980fb243 build: vendor in Rust dependencies
Summary:
Rust dependencies are vendored in by downloading a package containing all Rust
dependencies.

The package can be updated using the new `vendorcrates.py` script.

Test Plan: Build using the vendored packages.

Reviewers: quark, #mercurial

Reviewed By: quark

Differential Revision: https://phabricator.intern.facebook.com/D6689642

Tasks: T24908724

Signature: 6689642:1515548647:8051ec3dadd98873f0312bb67978846ba029b558
2018-01-09 17:48:32 -08:00
Durham Goode
9dd17e53dc tests: move left over tests 2018-01-09 16:55:34 -08:00
Durham Goode
1143152a51 contrib: move builddeb to contrib/builddeb_fb/ 2018-01-09 16:44:27 -08:00
Durham Goode
bd2d632274 contrib: move git-sl 2018-01-09 16:30:14 -08:00
Durham Goode
81f30f45fb scripts: move fb-hgext/scripts/ to contrib/ 2018-01-09 16:22:02 -08:00
Jun Wu
898d4e21c5 setup: make rust a hard dependency
Summary:
This reduces the number of situations we have to think about, like whether to
enable clindex, treedirstate or not.

Test Plan: `make local`

Reviewers: durham, #mercurial

Reviewed By: durham

Subscribers: durham, mbthomas

Differential Revision: https://phabricator.intern.facebook.com/D6687198

Signature: 6687198:1515543062:c4202564bce0f602ad4f898c23c9eeadd635aa3d
2018-01-09 13:44:53 -08:00
Jun Wu
f1518f6d73 check-module-imports: fix fastannotate, absorb and traceprof
Summary:
Reorder the imports to make the module checker happy.
The module checker should be aware of Cython module paths. Do it manually.

Test Plan: Run `test-check-module-imports.t`

Reviewers: durham, #mercurial

Reviewed By: durham

Differential Revision: https://phabricator.intern.facebook.com/D6688384

Signature: 6688384:1515540420:bec02696b24c12cb4fa2595fd235fc8f3246b2a2
2018-01-09 15:10:05 -08:00
Durham Goode
96e2b2d55d tests: update check module
The recent changes changed a bunch of imports, so let's update check module
2018-01-09 15:23:52 -08:00
Durham Goode
e05e6e6cc5 cstore: fix python test imports 2018-01-09 15:23:52 -08:00
Durham Goode
b805623673 fastmanifest: fix import paths 2018-01-09 15:23:52 -08:00
Durham Goode
55eddfbd07 ctreemanifest: fix imports 2018-01-09 15:23:52 -08:00
Durham Goode
3435e3fb82 cfastmanifest: move into hgext.extlib module 2018-01-09 15:23:52 -08:00
Durham Goode
3cc56d6007 imports: fix imports to refer to hgext 2018-01-09 15:23:52 -08:00
Durham Goode
8103079702 imports: import from hgext instead of hgext3rd
The only reason these worked is because they were in the system python path.
Which means the in-repo code wasn't actually being tested.
2018-01-09 15:23:52 -08:00
Phil Cohen
bf8527e7a9 lib: add READMEs to lib, extlib, cext 2018-01-09 15:20:46 -08:00
Saurabh Singh
8beb7a0e56 test-check-module-imports: fix the path for traceprof tests.
Summary: The path was not modified in the test which results in test failure.

Test Plan: Ran test-check-module-imports.t

Reviewers: durham, #mercurial, #sourcecontrol

Reviewed By: durham

Differential Revision: https://phabricator.intern.facebook.com/D6688247

Signature: 6688247:1515539001:ac926dab6d8bf9dbb8cf6738f499a6c84c85fad2
2018-01-09 15:03:49 -08:00
Saurabh Singh
aab037404d test-check-module-imports: fix the path for cstore tests.
Summary: The path was no modified in the test which results in test failure.

Test Plan: Ran test-check-module-imports.t

Reviewers: durham, #mercurial, #sourcecontrol

Reviewed By: durham

Differential Revision: https://phabricator.intern.facebook.com/D6688188

Signature: 6688188:1515538788:d19857787c0b4abada9caa2710f0f64b3a70f659
2018-01-09 15:00:01 -08:00
Saurabh Singh
6fbc1896e9 setup: remove unused import itertools
Summary: This was being reported by the test-check-pyflakes.t

Test Plan: Ran test-check-pyflakes.t.

Reviewers: phillco, #mercurial, #sourcecontrol

Reviewed By: phillco

Differential Revision: https://phabricator.intern.facebook.com/D6687882

Signature: 6687882:1515537725:e00da283e422ea363d11abd20cc63277bbe5cd9b
2018-01-09 14:42:45 -08:00
Saurabh Singh
5a62bbf298 fastmanifest: move fastmanifest tests from fb-hgext/tests to tests/
Summary: Now that D6685044 moved fastmanifest, we can also move the tests. Note
that test-fb-hgext-fastmanifest.t was moved seprately by Durham.

Test Plan: Ran all the tests.

Reviewers: quark, #mercurial, #sourcecontrol

Reviewed By: quark

Subscribers: durham, quark

Differential Revision: https://phabricator.intern.facebook.com/D6686584

Signature: 6686584:1515531785:3a9fa022f443faed6f3110eeef22d8ea72fcee3f
2018-01-09 14:21:39 -08:00
Jun Wu
04f520998c traceprof: enforce native stderr on Windows to avoid crash
Summary:
On Windows `FILE*` seems to be different in traceprofimpl.cpp and Python:

```
# fp passed from traceprof.pyx:profile(fp=sys.stderr) to traceprofimpl.cpp
0x0000000000d23cc0 {_Placeholder=0x0000000000d23360 }
    _Placeholder: 0x0000000000d23360

# stderr as seen from traceprofimpl.cpp natively
ucrtbase.dll!0x00007ffb29465510 (load symbols for additional information) {_Placeholder=0x0000000000000000 }
    _Placeholder: 0x0000000000000000
```

Workaround that by enforcing output Windows to use stderr for now.

Test Plan:
```
C:\hg> python2 setup.py build_ext -i
...

C:\hg> type a.py
import sys
from mercurial import ui
from hgext import traceprof
def f(): g(1)
def g(x): print(x)
with traceprof.profile(ui.ui(), sys.stderr): f()

C:\hg> python2 a.py
1
    | <module>                                  a.py:1
    | __exit__                                  C:\...\contextlib.py:21
Total time: 0 ms
```

Reviewers: #mercurial

Differential Revision: https://phabricator.intern.facebook.com/D6686958
2018-01-09 13:26:14 -08:00
Jun Wu
dcbc5e9b19 setup: remove mercurial.cyext package
It was moved to other places.
2018-01-09 13:47:44 -08:00
Jun Wu
fb45633a19 distutils_rust: use atomic replace to install the .so file
Summary:
Python loads .so using mmap. Rewriting a .so in-place when there is a Python
process with that .so mmap-ed could crash that Python process. Therefore
let's avoid rewriting the destination .so in-place.

This was discovered by a txnclose Python hook I used to keep binaries
up-to-date. It caused segfault after building the Rust extensions currently
loaded by the Python process running the hook.

Test Plan: `hg push` triggering that txnclose hook won't crash on the remote.

Reviewers: durham, #sourcecontrol

Reviewed By: durham

Differential Revision: https://phabricator.intern.facebook.com/D6686739

Signature: 6686739:1515532516:24c0b7066ff15a39a7bd824e779569f4a886d7df
2018-01-09 13:05:51 -08:00
Jun Wu
fc29bfdf18 patchrmdir: move to hgext
Summary: Also make it compatible with Windows by making it a no-op on Windows.

Test Plan:
`make local` and try from IPython:

```
In [1]: from hgext import patchrmdir

In [2]: os.rmdir
Out[2]: <function posix.rmdir>

In [3]: patchrmdir.uisetup(None)

In [4]: os.rmdir
Out[4]: <functools.partial at 0x375f580>
```

Reviewers: durham, #mercurial

Reviewed By: durham

Subscribers: durham, fried

Differential Revision: https://phabricator.intern.facebook.com/D6681125

Signature: 6681125:1515523144:e186b45978d4a82ec8a0d18a02b0a524fca1c3b3
2018-01-08 19:25:13 -08:00
Jun Wu
a5976a9d50 traceprof: move to hgext and make it more portable
Summary:
Get rid of `gettimeofday` and switch to C++11 `std::chrono` for Windows/rare
platform compatibility.

Also format the code using clang-format.

Test Plan:
Make sure it build on both x64 and Power8 platform.
`make local` and try it in IPython:

```
In [1]: from hgext import traceprof

In [2]: def f():
   ...:     g(1)
   ...:

In [3]: def g(x):
   ...:     print(x+1)
   ...:

In [4]: from mercurial import ui

In [7]: with traceprof.profile(ui.ui(), sys.stderr):
   ...:     f()
   ...:
2
    | <module>                                  ipython2:3
    | start_ipython                             IPython/__init__.py:93
    | launch_instance                           application.py:650
    | start                                     ipapp.py:342
    | mainloop                                  interactiveshell.py:479
    | interact                                  interactiveshell.py:459
    | run_cell                                  interactiveshell.py:2591
    | run_ast_nodes                             interactiveshell.py:2770
    | run_code                                  interactiveshell.py:2851
    | <module>                                  <ipython-input-7-2e5a012739d1>:1
    | __exit__                                  contextlib.py:21
Total time: 0 ms
```

Note: it crashes on Windows, which will be workarounded in a later patch.

Reviewers: rmcelroy, #mercurial

Reviewed By: rmcelroy

Subscribers: fried

Differential Revision: https://phabricator.intern.facebook.com/D6681062

Tags: aarch64

Signature: 6681062:1515488414:6b7a51eda9e9764560d415350630590e4817fae2
2018-01-08 17:45:51 -08:00
Jun Wu
f446276fe1 test-run-tests: stabilize the test (issue5735)
Summary:
Previously there is a race condition because things happen in this order:

  1. Check shouldStop
  2. If shouldStop is false, print the diff
  3. Call fail() -> set shouldStop

The check and set should really happen in a same critical section.

This patch adds a lock to address the issue.

The patch was also sent as https://phab.mercurial-scm.org/D1830

Test Plan: Run `run-tests.py -l test-run-tests.t` many times and it no longer fails.

Reviewers: durham, #mercurial

Reviewed By: durham

Subscribers: durham

Differential Revision: https://phabricator.intern.facebook.com/D6680300

Signature: 6680300:1515524998:260c3e198330e7e6c94dcb6cf155f14a055b760a
2018-01-08 17:23:24 -08:00
Jun Wu
26485b34fb cython: move extensions to better places
Summary:
clindex is an hg extension, so moved to `hgext`.
linelog is not an hg extension, but is only used by hg extensions, not
`mercurial/`, so moved to `hgext/extlib`.

Test Plan: `make local` and `run-tests.py` without `-l` and with an empty `PYTHONPATH`.

Reviewers: durham, #mercurial

Reviewed By: durham

Subscribers: fried

Differential Revision: https://phabricator.intern.facebook.com/D6685080

Signature: 6685080:1515525106:88ebb275d0cac041911f243a3e82b82482b6cd34
2018-01-09 10:50:46 -08:00
Jun Wu
a50053ffbe cython: build all extensions by default
Summary: clindex does not use any POSIX APIs so it can work on Windows.

Test Plan: `make local` on both Windows and Linux.

Reviewers: durham, #mercurial

Reviewed By: durham

Differential Revision: https://phabricator.intern.facebook.com/D6684821

Signature: 6684821:1515523520:aa48d4669fe658563f9457fc1a6194ec7fadd937
2018-01-09 10:33:45 -08:00
Durham Goode
c67e790eb4 cstore: move some left over tests 2018-01-09 13:11:10 -08:00
Durham Goode
fd68710043 misc: delete unused files 2018-01-09 13:07:22 -08:00
Durham Goode
60349dec1e tests: fix some broken tests
The rust directory should be removed. fastmanifest should've had a module added
to setup.py. I accidentally moved a fastmanifest test in my earlier commit, so I
need to update it.
2018-01-09 12:58:51 -08:00
Durham Goode
0fbed23c0d treemanifest: move treemanifest tests to tests/
Summary:
Now that fastmanifest and treemanifest are moved, we can moved the
tests.

Test Plan: make local && ./run-tests.py

Reviewers: singhsrb, #mercurial

Reviewed By: singhsrb

Subscribers: singhsrb

Differential Revision: https://phabricator.intern.facebook.com/D6685334

Signature: 6685334:1515526455:57791d7f9d2a3f2a6119c0e79a81b31e63a11c60
2018-01-09 12:59:00 -08:00
Durham Goode
fbed515666 setup: add directory modules to setup.py
setup.py needs an explicit list of all the directory modules, otherwise it
doesn't build them. This caused test-help to fail when run without -l because
they weren't copied to the target directory. I'm not sure how the tests have
been passing actually. My guess is they were importing the extensions from the
system python.
2018-01-09 12:38:05 -08:00
Saurabh Singh
163b35ec2e fastmanifest: fix test-check-code.t related errors
Summary:
D6685044 changed the location of fastmanifest which exposed it to the
additional test that failed. This commit fixes fastmanifest to address that
test.

Test Plan: Ran all the tests.

Reviewers: #mercurial, #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6685170
2018-01-09 11:13:10 -08:00
Saurabh Singh
ad7d64e944 fastmanifest: move fastmanifest from fb-hgext to hgext
Summary:
This is part of the overall plan to move extensions from fb-hgext to
hgext. Follow up commits will address some of the test issues and move the
fastmanifest related tests out of fb-hgext to hgext.

Test Plan: Ran all the tests.

Reviewers: durham, #mercurial, #sourcecontrol

Reviewed By: durham

Subscribers: durham

Differential Revision: https://phabricator.intern.facebook.com/D6685044

Signature: 6685044:1515524660:7cb9f8f28478e7bbf816f3823406c788b79a053a
2018-01-09 11:13:10 -08:00
Durham Goode
253f51f15e treemanifest: move to hgext/
Summary: Moves the extension itself.

Test Plan:
make local && ./run-tests.py

A future patch fixes the tests once
fastmanifest is also moved.

Reviewers: phillco, #mercurial

Reviewed By: phillco

Differential Revision: https://phabricator.intern.facebook.com/D6684580

Signature: 6684580:1515521896:68a4d648d9f5433d6eeda8be01740fbe12abf44e
2018-01-09 11:06:49 -08:00
Saurabh Singh
9da30944be cfastmanifest: move to hgext/extlib/
Summary:
Moves ctreemanifest into hgext/extlib/. D6679698 was committed to scratch branch
by mistake.

Test Plan: make local && cd tests && ./run-tests.py

Reviewers: durham, #mercurial, #sourcecontrol

Reviewed By: durham

Differential Revision: https://phabricator.intern.facebook.com/D6684623

Signature: 6684623:1515522634:9bec363d00990d9ff7d5f655e30ab8cae636155c
2018-01-09 10:36:54 -08:00
Kostia Balytskyi
c9301441f5 fb-hgext: drop empty hgext3rd files
Summary: Drop em all!

Test Plan: - run tests (still running)

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6683892
2018-01-09 09:14:35 -08:00
Kostia Balytskyi
ae3a6e0052 fb-hgext: fix fastannotate tests
Summary: Fix all the fastannotate tests.

Test Plan: - run tests, see them pass!

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6683772
2018-01-09 09:00:03 -08:00
Kostia Balytskyi
6e6cc496dd fb-hgext: move all of the fastannotate tests to core
Summary:
We moved the `fastannotate` itself, let's move the tests now.

Depends on D6683689

Test Plan: - run tests in the next commit in this stack

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6683764
2018-01-09 08:57:40 -08:00
Kostia Balytskyi
edc5c3ab25 fb-hgext: move clindex to core
Summary:
Move clindex to core.

Depends on D6683664

Test Plan: - run tests, see them pass

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6683689
2018-01-09 08:42:20 -08:00
Kostia Balytskyi
0904c08353 cython: do a minor refactoring of cythonization logic
Summary: Just a preparation to be used later.

Test Plan: - it builds!

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6683664
2018-01-09 08:42:20 -08:00
Ryan McElroy
790efe918e duplicates: make test robust
Summary:
This test output is unstable. Let's make the test robust by ignoring
the shelve extension (which we will soon delete) and squelching the unrelated
output.

Test Plan: run-tests.py multiple times

Reviewers: ikostia, #mercurial

Reviewed By: ikostia

Differential Revision: https://phabricator.intern.facebook.com/D6683495

Signature: 6683495:1515513516:efd3964a0053b48d770b2af04b244295dba2d807
2018-01-09 08:18:14 -08:00
Kostia Balytskyi
883e143037 tests_: temporarily accept test-duplicateoptions.py.out
Summary:
Temporary accept insignificant failures until we figure stuff out.

Depends on D6683266

Test Plan: - run `test-duplicatieoptions`, see it passing

Reviewers: rmcelroy, #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6683271
2018-01-09 06:54:58 -08:00
Kostia Balytskyi
88396f2bb1 fastannotate: drop the short version of --no-content
Summary:
`test-duplicateoptions` complains about `-h` being a duplicate, since it's a default help option.

Depends on D6683248

Test Plan: - run the test, see the mention of this option disappear

Reviewers: stash, #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6683266
2018-01-09 06:52:59 -08:00
Kostia Balytskyi
925e76d0c6 smartlog: do not specify -T twice
Summary:
`formatteropts` already give us the `-T`.
Depends on D6683245

Test Plan: - run `test-duplicateoptions`, see this particular thing disappear

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6683248
2018-01-09 06:48:08 -08:00
Kostia Balytskyi
8fcdc5f35c extensions: drop the core sparse.py extension
Summary:
We have our fbsparse, which we are using. We can rename it later when configs
are in the same repo as the extension files.

Test Plan: - run tests, see only the failures related to the other commits in the stack

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6683245
2018-01-09 06:47:00 -08:00