Summary:
./setup.py's logic to pick a version no longer works in fbsource because it only works if `.hg` is in the current
directory. (It set it to 'unknown'.)
We already moved the build logic to a streamlined system of (YYMMDD_HHmmSS_hash), so let's do the same with the actual version that
gets shipped with the release.
(Note: this ignores all push blocking failures!)
Reviewed By: quark-zju
Differential Revision: D6794773
fbshipit-source-id: 5de44b9a3541babddeff06e096b5b1faa8733e47
Summary:
Enables running `check-*` tests from fbsource. This used to check for the existence of a `.hg` folder to detect a repo (so
it can run `hg files`). Internally, we'll always have a repo, and externally we'll likely use git to publish so we'll need another
solution there anyway.
(Note: this ignores all push blocking failures!)
Reviewed By: DurhamG
Differential Revision: D6792787
fbshipit-source-id: 342e29d3a99e82ccd24effb8df02ac6309e80909
Summary:
- Like D6791251, test-fb-hgext-fastmanifest-access.t is a pure fastmanifest test, and I'd like to keep it that way given the rigidity
of the existing output. And plenty of fastmanifest tests remain to test both.
- test-fb-hgext-sparse-extensions.t enables simplecache later on in the test already; I just enabled it earlier, which causes the cache to be warm a bit earlier than before, but I think the difference hardly matters.
This should be the last barrier to default-enabling simplecache.
(Note: this ignores all push blocking failures!)
Reviewed By: DurhamG, quark-zju
Differential Revision: D6792256
fbshipit-source-id: dce775903d312f54f67b4eb05d88779b648359a3
Summary:
simplecache prevents parts of this test from being exercised, since it sits in front. To be sure let's disable it to make sure everything hits fastmanifest.
(Alternatively, we could accept this particular change.)
(Note: this ignores all push blocking failures!)
Reviewed By: DurhamG
Differential Revision: D6791251
fbshipit-source-id: 7eec2931c38b55585a83e4f935f434adbd5dd911
Summary:
flake8 looks very useful, though not all of its default rules apply to the Mercurial codebase.
I've added the start of a config files so we can keep it but start to disable or tweak rules that don't fit the existing code
style. I added a few to get started.
Reviewed By: DurhamG
Differential Revision: D6791079
fbshipit-source-id: c98662f57d21ed8e4f5def465b3c92765dd69f92
Summary:
When used with hggit, simplecache would treat all hggit overlayctxs as having the `nullid` node. This is used in the cache key for the result of `status()`; this caused the return value of all hggit's changectxs' `status()` to be intermingled.
There are arguably two issues here:
- hggit's `overlaychangectx` simply implemented `node()` and didn't set a `_node` like changectx does. Changectx refers to this property internally (and other external callers might do so too) so we should probably set it.
- simplecache was reading the `changectx._node` property instead of the more public `changectx.node()`. This returned `nullid` because of the above.
Either change would fix it but I sent both to be safe. I look forward to tightening the context class interfaces in the future.
(Note: this ignores all push blocking failures!)
Reviewed By: quark-zju
Differential Revision: D6788335
fbshipit-source-id: eb4b3cebc1b6ee6011405cdb7d702cdf5cac0904
Summary:
Same fix as D6788335, though not blocking anything. Use the public `node()` function
on contexts and exclude None, nullid, and wdirid from caching.
Reviewed By: DurhamG
Differential Revision: D6790845
fbshipit-source-id: 4ccdc6889c993bb1a8379d50ecc92cb2aa03513d
Summary:
This fixes an obvious mistake. It wasn't noticed because it's part of the last
"cleanup" before landing the change. And it runs on a big repo which hides
the problem.
On smaller repos, changelog is inlined and clindex won't be used because the
Rust index does not support inlined revlogs. `repo.updatecaches()` will raise
`AttributeError` since the original `self.changelog.index` object does not have
`updatecaches()`. In that case, it's obvious that we should not skip the
original `repo.updatecaches()` call. The same applies to `repo.destorying()`.
Since after the fix, tests are passing. Let's enable clindex by default. As
explained above, clindex is not actually well exercised because of inlined
revlog. We should probably special case changelog to be always non-inlined.
That's probably a separate diff.
Reviewed By: phillco
Differential Revision: D6767200
fbshipit-source-id: c8432eec6c02c06c4d49c13df150e1b25bbaa1aa
Summary:
This extension can be a bit noisy when defaulted-on. Let's disable its debug output in
tests (except fot its own tests).
Differential Revision: D6777765
fbshipit-source-id: e2a6c6b7527336a1fac24078d2b49eb1e75ecabf
Summary:
The helper could be used in individual tests to enable chg if chg exists.
This allows us to have more precise control on what tests to use chg instead
of using a global flag in run-tests.py.
This makes certain tests containing many hg commands much faster. For example,
`test-revset.t` took 99 seconds before:
% ./run-tests.py test-revset.t --time
.
# Ran 1 tests, 0 skipped, 0 failed.
# Producing time report
start end cuser csys real Test
0.000 99.990 86.410 12.000 99.990 test-revset.t
And 10 seconds after:
% ./run-tests.py test-revset.t --time
.
# Ran 1 tests, 0 skipped, 0 failed.
# Producing time report
start end cuser csys real Test
0.000 10.080 0.380 0.130 10.080 test-revset.t
Also enable it for some other tests. Note the whitelist is not complete. We
probably want to whitelist more tests in the future.
The feature could be opted out by deleting `contrib/chg/chg`.
Reviewed By: phillco
Differential Revision: D6767036
fbshipit-source-id: 8220cf408aa198d5d8e2ca5127ca60e2070d3444
Summary: We probably want this script to work going forward. A lot of cleanup is needed, but at least now it produces a working binary.
Differential Revision: D6770776
fbshipit-source-id: dc2d44bd66e16c5bee53aadf262d6d3dee2fea96
Summary: This manifests itself on MacBooks where dulwich is not installed.
Differential Revision: D6759617
fbshipit-source-id: c90c35ebaa4fd2a14b1ad2fa0fadaca3c6ea8c29
Summary:
This makes it easier to run integration tests where we want to load
additional sets of config files.
Reviewed By: DurhamG
Differential Revision: D6755017
fbshipit-source-id: af062fcc465eee969e1315f9430333908ef38303
Summary:
The keyword extension is rarely used. And it breaks sshaskpass because
Python standard library `collections` (which does not use absolute import)
will import the wrong `keyword` module:
$ hg pull ssh://localhost/foo --debug
pulling from ssh://localhost/foo
running SSH_ASKPASS=/tmp/tmpj_6pDJttysrv/2991364.sh DISPLAY=localhost:10.0 TTYSOCK=/tmp/tmpj_6pDJttysrv/2991364 ssh -oControlMaster=no localhost 'hg -R foo serve --stdio'
sending hello command
sending between command
remote: Traceback (most recent call last):
remote: File "/usr/lib64/python2.7/site-packages/hgext/sshaskpass.py", line 43, in <module>
remote: import collections
remote: File "/usr/lib64/python2.7/collections.py", line 10, in <module>
remote: from keyword import iskeyword as _iskeyword
remote: File "/usr/lib64/python2.7/site-packages/hgext/keyword.py", line 93, in <module>
remote: from mercurial.i18n import _
remote: File "/usr/lib64/python2.7/site-packages/mercurial/i18n.py", line 15, in <module>
remote: from . import (
remote: File "/usr/lib64/python2.7/site-packages/mercurial/encoding.py", line 15, in <module>
remote: from . import (
remote: File "/usr/lib64/python2.7/site-packages/mercurial/error.py", line 17, in <module>
remote: from . import pycompat
remote: File "/usr/lib64/python2.7/site-packages/mercurial/pycompat.py", line 22, in <module>
remote: import cookielib
remote: File "/usr/lib64/python2.7/cookielib.py", line 32, in <module>
remote: import re, urlparse, copy, time, urllib
remote: File "/usr/lib64/python2.7/urlparse.py", line 123, in <module>
remote: from collections import namedtuple
remote: ImportError: cannot import name namedtuple
Reviewed By: singhsrb
Differential Revision: D6766686
fbshipit-source-id: af67a4d8c736158951c737b790904ba11419d432
Summary:
`run-tests.py` should set up `sys.path` correctly so `import mercurial` in
the hgsubversion tests should just work.
Also add a comment in `run-tests.py` to clarify this.
The hgsubversion module check is removed since it assumes the module lives in a
same directory as the test, which is not true with the `run-test.py --rebuild`
case.
Reviewed By: phillco
Differential Revision: D6758588
fbshipit-source-id: ba34253991e671dc972bcb1900243eab6b69fd92
Summary: I noticed that we didn't have any unit tests covering wire protocol argument parsing.
Differential Revision: D6757891
fbshipit-source-id: 17ec2be2f7e6bf193983178938dcc27e23dfff71
Summary:
This ensures that watchman doesn't complain when it starts watching this
directory.
Differential Revision: D6757821
fbshipit-source-id: 30b3e71b9601e74af51ad7ac18e1f197777b9e72
Summary: Otherwise this test will fill up with default-on tests that will be a pain to filter manually. Plus it's a sensible flag to have.
Differential Revision: D6760553
fbshipit-source-id: 083cb2d8a7cffe28eef812edad2f4c5d997db981
Summary:
`_peerorrepo` calls `extensions.extensions()` to figure out on which modules to run reposetup. This uses a slightly
different code path than that patched by D6716674 and double-checks if an extension is enabled. So we need to patch here too.
Reviewed By: quark-zju
Differential Revision: D6758486
fbshipit-source-id: b5bfe2d11e5e2aeb2d3a0ee7c9d6e3e2c213233d
Summary:
This was blocking us default-enabling `fbsparse`; however, this function is actually incredibly fragile and can break with a variety of extensions enabled (even blackbox).
E.g., try this on the latest release and you'll get an exception!
```
cd $(mktemp -d); hg init a; hg share a b; cd b; hg unshare
```
That particular breakage is called by blackbox trying to look at `repo[None]` to do some logging, but anything that tries to read `repo.dirstate` after this will print the exception. The root cause is this line which is trying to override `repo.root`:
```
repo.unfiltered().__init__(repo.baseui, repo.root)
```
It's trying to update the repo's path to indicate that it is independent and no longer shared. But, the initializer isn't really designed to be called twice, AFAICT, and doing so here leaves the property caches out of sync with properties of the repo (namely `_filecache`).
Durham's suggestion was just to nuke `hg unshare`. This patch works around it for now, though, in case we want to keep it alive.
Reviewed By: quark-zju
Differential Revision: D6758397
fbshipit-source-id: 90d3773d9340f2a5b2e6e900a2194d8b931f410d
Summary:
...instead of '(untested!)'.
Partly this is necessitated by the `hg debugextensions` call in test-extension.t (post
D6758486). But it also seems like the right thing to do.
Reviewed By: ryanmce
Differential Revision: D6758599
fbshipit-source-id: 3ecfa52b0c9c1a028201d2eda0eaa706d80225c0
Summary:
Added options supported by diff:
```
-w --ignore-all-space ignore white space when comparing lines
-b --ignore-space-change ignore changes in the amount of white space
-B --ignore-blank-lines ignore changes whose lines are all blank
-Z --ignore-space-at-eol ignore changes in whitespace at EOL
```
Differential Revision: D6738122
fbshipit-source-id: bd4236ce7cb9d5f803f932cfec267de71b0067c2
Summary:
Some consumers still rely on enabling 'sparse=' so let's add a module
that just redirects to the real fbsparse.py.
Also updates configerator to use the newer name.
Reviewed By: markbt, quark-zju
Differential Revision: D6755971
fbshipit-source-id: 3a67f029045dacf927742a616a714fe632b97fea
Summary:
The isgooddelta tweak was introduced in D2693043 (perftweaks: change revlog
delta heuristic, 2015-11-24). Comparing with the existing version, the only
change is that we removed `dist > maxdist` check.
Note that the upstream commit 895ecec31 (revlog: add an experimental option
to mitigated delta issues (issue5480), 2017-06-23) also introduces a config
option to override `maxdist` to make the condition fail, which basically does
a same thing.
Instead of introducing new config options or adding more "if"s to the
codebase to make it more obscure, let's just simplify it by disabling the
check entirely, and removing the `dist` concept, removing two config
options: `experimental.maxdeltachainspan` and `perftweaks.preferdeltas`.
The `chainlen > self._maxchainlen` check should be enough for keeping
delta chain length bounded.
Reviewed By: DurhamG
Differential Revision: D6752529
fbshipit-source-id: e8fd8ec39240191db5fb274190fc661e97087a78
Summary: Added --rebuild for the old behavior.
Reviewed By: phillco
Differential Revision: D6753296
fbshipit-source-id: 84f26af285662f91bc59db8b2a3145212118a9b6
Summary:
Given the multi-core era, it seems to be a good default to make use of all
available cores. Use `-j 1` to get the old behavior.
Reviewed By: phillco
Differential Revision: D6752704
fbshipit-source-id: 842ddea1d89160eed030fc71ba08024859db9268
Summary:
This enables clindex for its nodemap. Verification is turned off by default
for the performance win since we have been running verification in
production for a while.
Reviewed By: phillco
Differential Revision: D6751412
fbshipit-source-id: bc3e87df86e86a758392bdd4aef3e282f397fe04
Summary: Also change the internal API so it no longer accepts the "heads" argument.
Reviewed By: ryanmce
Differential Revision: D6745865
fbshipit-source-id: 368742be49b192f7630421003552d0a10eb0b76d
Summary: This removes the effectflag logic from both core and perftweaks.
Reviewed By: ryanmce
Differential Revision: D6745769
fbshipit-source-id: 55ed1676e7117bca358471c256805ded7bc83f3c
Summary: The tests are landed in core so those tests could be removed.
Reviewed By: ryanmce
Differential Revision: D6745446
fbshipit-source-id: f85c3e7899d4bb24bedb71d84601d7113928a4c4
Summary: To be fixed later, now I need to test the hgbuild.
Differential Revision: D6748921
fbshipit-source-id: 519555286a43ef7852e37b699e30197c1ad85424
Summary:
Previously it's `:. & follow(FILE)` and there is a Python loop iterating
`:.`. This patch makes it `follow(FILE) & :.`.
In the common case, `_logrevs` returns a large revset in desc order. So it
makes sense to put it at the right side of `&` operator. The only exception is
when `_logrevs` uses user-specified revset (`-r`), whose order needs to be
respected and size is unknown.
Test Plan:
Ran all tests.
Facebook:
This reduces `hg log FILE` from ~3 seconds to ~0.5 seconds.
```
# Before
% time hg log cmd_util.py --pager=off --config extensions.fastlog=! -T'{oneline}\n'
11e9d4 D5997870 mbolin Use --home-dir to compute the config dir, if specified. 2017-10-06
5041e2 D4888633 simpkins [eden] move eden/fs/cli to eden/cli 2017-04-14
7dc2bd D4760528 simpkins [eden] an "eden debug" CLI command and thrift APIs to support it 2017-04-03
hg log cmd_util.py --pager=off --config extensions.fastlog=! -T='{oneline}\n' 2.88s user 0.09s system 99% cpu 2.975 total
# After
% time hg log cmd_util.py --pager=off --config extensions.fastlog=! -T'{oneline}\n'
7dc2bd D4760528 simpkins [eden] an "eden debug" CLI command and thrift APIs to support it 2017-04-03
5041e2 D4888633 simpkins [eden] move eden/fs/cli to eden/cli 2017-04-14
11e9d4 D5997870 mbolin Use --home-dir to compute the config dir, if specified. 2017-10-06
hg log cmd_util.py --pager=off --config extensions.fastlog=! -T='{oneline}\n' 0.42s user 0.03s system 98% cpu 0.456 total
```
Fastlog is disabled since a network request makes the time less stable.
Logging a single file is answered locally by remotefilelog ancestor handling.
Reviewers: durham, #mercurial
Reviewed By: durham
Subscribers: durham
Differential Revision: https://phabricator.intern.facebook.com/D6735007
Signature: 6735007:1516163080:0d7ddae9f24933d795ba7aaa4461916c7fdd2309
Summary:
It's pretty handy. The implementation is simple and clean. So move it from
contrib and enable it by default. "import"s are adjusted to make the module
checker happy.
Security and UX wise, since we have `--debugger` already, adding another
REPL seems fine.
Test Plan: Ran all tests
Reviewers: phillco, #mercurial
Reviewed By: phillco
Differential Revision: https://phabricator.intern.facebook.com/D6741283
Signature: 6741283:1516225662:ddc19a663e7ecef2a1fdaa5041f308dc838a8471
Summary:
`lfs` is the better large file solution. `largefiles` is rarely used, and
its implementation is less clean. So let's remove it.
Test Plan:
Ran all tests. A subrepo test was removed instead of cleaned up since the
longer term plan is to also drop subrepo support.
Reviewers: phillco, #mercurial
Reviewed By: phillco
Differential Revision: https://phabricator.intern.facebook.com/D6740361
Signature: 6740361:1516225594:555e3803571ad05e0434021897a2823ac99347ae
Summary:
Since we moved some files, these failures changed.
Depends on D6719894
Test Plan: - ./run-tests, see passing
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D6719911
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