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
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
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
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
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
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
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
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
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
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.
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
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.
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
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
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
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
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
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
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
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
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
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
This wasn't broken, but should mirror the non-in memory case to save an extra write.
Differential Revision: https://phab.mercurial-scm.org/D1807
(grafted from d592d5905ae972407fb6f9d649db1e2d41bf6c85)
(grafted from 9111386f1fe8316b9079669d0bd0e33704ba2a0c)
Summary:
Some issues are difficult to fix right now so I'm just checking a few
errors in.
Test Plan: run-tests.py
Reviewers: mitrandir, #mercurial
Reviewed By: mitrandir
Subscribers: mitrandir, terrelln
Differential Revision: https://phabricator.intern.facebook.com/D6675890
Tasks: T24908724
Signature: 6675890:1515493853:bfdd6c504be2bd0208c2e272183354c688019ac9
Summary: This fixes a test-check issue and makes the code safer.
Test Plan: run-tests.py
Reviewers: ikostia, #mercurial
Reviewed By: ikostia
Differential Revision: https://phabricator.intern.facebook.com/D6682545
Signature: 6682545:1515505853:0e9f81c33bbf4c2579ec16f14153fab5fea832fd
Summary: Seems like some unneeded stuff.
Test Plan: - run this test, see it passing
Reviewers: rmcelroy, #sourcecontrol
Reviewed By: rmcelroy
Differential Revision: https://phabricator.intern.facebook.com/D6682999
Signature: 6682999:1515505094:237d85fb2393393a5ac2936949772f4aec5f47c1
Summary: Missed fix of wrong imports.
Test Plan: - run this test, it passes now
Reviewers: rmcelroy, #sourcecontrol
Reviewed By: rmcelroy
Differential Revision: https://phabricator.intern.facebook.com/D6682995
Signature: 6682995:1515504928:f8a0f2bff4c6dc1ff311ecdc12db63a3cfb69b3f
Summary:
Temporary change. Meant to be fixed later.
Depends on D6675437
Test Plan: - all the tests pass!
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D6675475
Summary:
These scripts are not necessary anymore.
Depends on D6675381
Test Plan: - less complaints from styling tests
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D6675405
Summary:
Some new help contents are now generated with test-help.t
Depends on D6675351
Test Plan: - test-help.t is passing now
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D6675363
Summary:
Previously, we were loading extensions from the environment which
is not good for actually getting the right docs.
> It is just plain wrong. --ikostia
Test Plan: run-tets.py
Reviewers: ikostia, #mercurial
Reviewed By: ikostia
Differential Revision: https://phabricator.intern.facebook.com/D6682879
Signature: 6682879:1515500917:a0b79bdae32dfa300fcab83488012c77a5145e15
Summary:
These fixes are related to documentation-related check-style tests.
Depends on D6675344
Test Plan: - more tests pass
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D6675351
Summary:
This is a big bulk of generally almost-obvious fixes to the moved tests. Mostly
these fixes have to do with correct importing of the actual extensions.
Depends on D6675329
Test Plan:
- ./run-tests.py fails less after this commit
- see further commits for more test fixes
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D6675344
Summary:
This commit moves most of the stuff in hgext3rd and related tests to
hg-crew/hgext and hg-crew/test respectively.
The things that are not moved are the ones which require some more complex
imports.
Depends on D6675309
Test Plan: - tests are failing at this commit, fixes are in the following commits
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D6675329
Summary: Fixes an issue where the build would fail if the directory had not been made.
Test Plan: ./setup.py build works now
Reviewers: mbthomas, #mercurial
Differential Revision: https://phabricator.intern.facebook.com/D6681061
Summary:
Moves the remotefilelog extension into hgext/ and it's tests into
tests/.
I did not fix up all the check-module errors, since it's a ton of work for
very little impact at this point.
Test Plan: make local && ./run-tests.py
Reviewers: #mercurial
Differential Revision: https://phabricator.intern.facebook.com/D6680030