Commit Graph

42460 Commits

Author SHA1 Message Date
Wez Furlong
a3e8a19f3c merge in datapack fixes from eden
Summary:
pull in the following revisions from the copy of this code
we had under fbsource/scm/hgext:

2f7e4f11e002cf33e4878df77d6a0472adf31245 D6099388
e2a5a711e36c7392129b8753bea37c89a5d73a9c D6099754
77b975dcde28cd7c3d4ae2302bddb625682d1994 D6099753

Reviewed By: simpkins

Differential Revision: D6792967

fbshipit-source-id: e91a74329cddaf322172d3c7d9e1a05b3b6cba02
2018-04-13 21:50:57 -07:00
Jun Wu
5d8086f447 test-hgsql-lfs-sync: update lfs config
Summary:
D6698242 removes legacy lfs config options. This diff migrates it to the new
`lfs.url` config.

Reviewed By: singhsrb

Differential Revision: D6812621

fbshipit-source-id: 0a3196a8f08e11ca49fa053d57c3621b022657a2
2018-04-13 21:50:57 -07:00
Durham Goode
d70e1c23cc hg: use atomic temp for server tree cache
Summary:
Many processes may be reading and writing from this cache at once, so
let's be sure to use atomic temp.

Reviewed By: quark-zju

Differential Revision: D6811428

fbshipit-source-id: 5c6c157a60e294ab77cc5cb735c5705b7cddff87
2018-04-13 21:50:57 -07:00
Jun Wu
d25885950e remotefilelog: fix unbundle with lfs revisions
Summary:
unbundle should use raw revisions and keep flags as-is,
instead of using high-level `filelog.add` API.

Reviewed By: ryanmce

Differential Revision: D6806031

fbshipit-source-id: 3e1819a91ee869ac8023eefb3f3aa7542f770539
2018-04-13 21:50:57 -07:00
Jun Wu
8993e8a1b3 remotefilelog: add a test showing unbundle lfs content is broken
Summary: This reproduces a reported issue.

Reviewed By: wlis

Differential Revision: D6805761

fbshipit-source-id: 8b9c9564e9b0442fbcf3d69ebedf9f93f280494d
2018-04-13 21:50:57 -07:00
Durham Goode
0e1d917644 treemanifest: add a server side cache for tree entries
Summary:
We're seeing high load on the server when many clients are fetching treemanifest
entries. A lot of this stems from the cost of opening revlogs. Let's introduce a
simple on-disk cache that let's us avoid opening revlogs as much as possible.

Reviewed By: quark-zju

Differential Revision: D6797698

fbshipit-source-id: c131aa57be333dcb2e4453c6a1f9f4e24532a7ee
2018-04-13 21:50:57 -07:00
Durham Goode
88ec218bd4 hg: fix hgsql treemanifest test
Summary:
The import was using the old format here. Let's use the requireext
check instead to be more robust.

Reviewed By: quark-zju

Differential Revision: D6803848

fbshipit-source-id: cb8474245414c946a1ab6cc6c3cec18cd831de0d
2018-04-13 21:50:57 -07:00
Durham Goode
187978f40a hg: fix require-ext for core extensions
Summary:
The require-ext script tried to test the common extension module names
but failed to use the loop variable. This fixes that.

Reviewed By: quark-zju

Differential Revision: D6803708

fbshipit-source-id: 91a32bc2b63ea9ec0652342424f33c87b0898b70
2018-04-13 21:50:57 -07:00
Durham Goode
257a0246cf hg: fix check-shbang
Summary:
This was also using O(repo) file queries. Let's scope them down.
Performance here depends on us shipping a new rpm to users, so let's disable
this test until we do that.

Reviewed By: quark-zju

Differential Revision: D6803495

fbshipit-source-id: e49f00d1a606f0c0ceae6c1e8556f0137186da0a
2018-04-13 21:50:57 -07:00
Durham Goode
3b2cabfe55 hg: fix extensions-default
Summary:
Suggesting disabled extensions uses extensions.loadpath, which is no
longer supported for core extensions. Since this test is just testing that the
extension can be disabled, let's not worry about the exact output.

Reviewed By: phillco

Differential Revision: D6802719

fbshipit-source-id: 2a602e086f4809676ef8dd36ffc30f021b3186fc
2018-04-13 21:50:57 -07:00
Durham Goode
8b22044999 hg: fix test-contrib-perf.t
Summary:
This test tried to verify that the perf code could still handle
Mercurial version 1.2. Since we don't have tags in our repository, and since I
didn't want to hard code a hash since it wouldn't work in opensource land, let's
just drop the historical compatibility checking.

Reviewed By: quark-zju

Differential Revision: D6802362

fbshipit-source-id: 76f8d2b112784ce641457ff651832cb1b6c93540
2018-04-13 21:50:57 -07:00
Durham Goode
16270db464 hg: fix check execute
Summary:
check-execute was failing because the filesets are too slow (about 45+s
each). This fixes the performance by optimizing some internal fileset logic, and
by fixing a fileset to be scoped to the current working directory instead of the
whole repo.

Unfortunately the fileset implementation optimization needs to be deployed
before the test can benefit from it (since the test runs the system hg), so we
need to leave the test disabled until the fix rolls out.

Reviewed By: quark-zju

Differential Revision: D6802078

fbshipit-source-id: 26767c989e15b6d0ae5f5d9560309dafa5c380ff
2018-04-13 21:50:57 -07:00
Durham Goode
9b9a988499 hg: drop hg10 requirement for jshint and pylint
Summary:
Just drops the hg10 requirement since version numbers work differently
in our repo.  These still don't run unless you have the appropriate jshint and
pylint programs installed (which I don't).

Reviewed By: quark-zju

Differential Revision: D6802387

fbshipit-source-id: bdfda8257c358b3a6db839aa130b555124c8ef04
2018-04-13 21:50:56 -07:00
Durham Goode
8d8353d5e3 hg: fix check code
Summary:
This was timing out when run in a large repo. This patch fixes it to be
faster.

Reviewed By: singhsrb

Differential Revision: D6800750

fbshipit-source-id: 7021ab17b30727cafa4fc0654a7409c43793b3e9
2018-04-13 21:50:56 -07:00
Phil Cohen
0253aed679 flake8: disable for all folders for now
Summary: It's still too noisy. Let's disable it for now before London wakes up. We can add rules back in one-by-one as we fixup existing code.

Reviewed By: DurhamG

Differential Revision: D6794987

fbshipit-source-id: f7c95d660c5af4373b6c10545eb85cb5c63f282e
2018-04-13 21:50:56 -07:00
Phil Cohen
110b73de64 treedirstate: fix actual import confusing pyflakes
Summary: Pyflakes complains it's not used, but it's actually a reference to the native class. Make that obvious.

Reviewed By: quark-zju

Differential Revision: D6799935

fbshipit-source-id: 16060839385ab52d53e43b9b4b202b5771d01dc2
2018-04-13 21:50:56 -07:00
Phil Cohen
1678b89caf test-check-code: fix legitimate failure
Summary: These files were removed and one was added, so add to the expected test output.

Reviewed By: quark-zju

Differential Revision: D6799790

fbshipit-source-id: 514cb095cb727f465aa82b06465a49f17f0e0eb2
2018-04-13 21:50:56 -07:00
Phil Cohen
45c4a072f9 hgext: use relative imports wherever possible
Summary:
Port of D6798134 to fbsource. It eliminates module-import failures as well as errors like this:

```
mercurial.error.ForeignImportError: hgext.extlib.treedirstate: /home/phillco/.local/lib/python2.7/site-packages/hgext/extlib/treedirstate.so lives outside /..../hg
```

....that block other tests, like test-help.t

(Note: this ignores all push blocking failures!)

Reviewed By: quark-zju

Differential Revision: D6799259

fbshipit-source-id: b77d1b565dbf52165e0847002be498648658e064
2018-04-13 21:50:56 -07:00
Durham Goode
f9bcc09f4a hg: fix check pyflakes
Summary:
This test wasn't running because it had a hg10 check. Let's drop that
and fix the one failure.

Differential Revision: D6798754

fbshipit-source-id: 9d1f1f8b58ff14cba8228f9dc4c83ce21cab6c48
2018-04-13 21:50:56 -07:00
Durham Goode
f9cc757043 hg: fix check module imports test
Summary:
This needs to scope down the hg locate to just files in the current
main hg directory.

Differential Revision: D6798373

fbshipit-source-id: a31d66b05ba40439657afa4465667a72b5728123
2018-04-13 21:50:56 -07:00
Wez Furlong
326c2cca4f clang-format datapackstore.cpp
Summary: No functional changes.

Reviewed By: bolinfest

Differential Revision: D6793943

fbshipit-source-id: ad709c4ea29e0ab265d6aac3c3f1a18733706e46
2018-04-13 21:50:56 -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
Phil Cohen
e98ce2b8c1 moreversion: remove the extension (v2)
Summary:
The last diff lost most of its content after v2 was submitted. Resend.

(Note: this ignores all push blocking failures!)

Reviewed By: quark-zju

Differential Revision: D6795055

fbshipit-source-id: ed5f6d5eba9f8cfd505ed4ba1724110414b685f8
2018-04-13 21:50:56 -07:00
Phil Cohen
9ae6ff7bdd moreversion: remove the extension
Summary:
`hg version`, as of the last path, currently prints:

```
Mercurial Distributed SCM (version 20180123_174746_5cb750b72031)
Facebook Mercurial release: UNKNOWN-RELEASE
```

There's no need for us to print the second line now that the first represents the internal version ID.

(Note: this ignores all push blocking failures!)

Reviewed By: quark-zju

Differential Revision: D6794821

fbshipit-source-id: 499828832a0acb066adc260f852c3a743e41a563
2018-04-13 21:50:55 -07:00
Phil Cohen
3d3ab2cb56 setup.py: use new version system for picking hg's release version
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
2018-04-13 21:50:55 -07:00
Phil Cohen
e45033bb3c hghave: make the test-repo feature always return True
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
2018-04-13 21:50:55 -07:00
Phil Cohen
265c2610c7 simplecache: enable by default
Summary: Default-on this moderately hard extension.

Reviewed By: DurhamG, quark-zju

Differential Revision: D6792641

fbshipit-source-id: 475135f4f4f295a4e6356443405bd6eb185c310a
2018-04-13 21:50:55 -07:00
Phil Cohen
f85b6e89f9 extensions: turn off simplecache in one test, update another
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
2018-04-13 21:50:55 -07:00
Phil Cohen
fc9c2a7200 fastmanifest: turn off simplecache in its test
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
2018-04-13 21:50:55 -07:00
Phil Cohen
1c0c45585f hg: add flake8 config file
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
2018-04-13 21:50:55 -07:00
Phil Cohen
c97e746105 simplecache: fix for hggit
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
2018-04-13 21:50:55 -07:00
Phil Cohen
511a0a046f simplecache: ensure pathcopies doesn't cache special nodes
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
2018-04-13 21:50:55 -07:00
Jun Wu
34aebc68ca clindex: fix issues on small repos and turn on by default
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
2018-04-13 21:50:55 -07:00
Phil Cohen
7bcdda8bfc simplecache: allow debug output to be switched off
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
2018-04-13 21:50:55 -07:00
Durham Goode
b7dbb99114 tests: more test fixes
fbshipit-source-id: ee020b6b9664d94897184007519becb907220fa9
2018-04-13 21:50:55 -07:00
Durham Goode
954ae64c77 tests: update check tests
fbshipit-source-id: 7deb61c17bf461b7632a1d3f3d7f2ae8a8828ede
2018-04-13 21:50:55 -07:00
Jun Wu
effa0da8de test-helpers: add a helper to run test using chg
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
2018-04-13 21:50:54 -07:00
Kostia Balytskyi
0b9d49d16a windows: fix build_nupkg.py to work in a new setup
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
2018-04-13 21:50:54 -07:00
Kostia Balytskyi
e45985d846 hggit: skip, not fail a test if dulwich is missing
Summary: This manifests itself on MacBooks where dulwich is not installed.

Differential Revision: D6759617

fbshipit-source-id: c90c35ebaa4fd2a14b1ad2fa0fadaca3c6ea8c29
2018-04-13 21:50:54 -07:00
Liubov Dmitrieva
82b604cb44 infinitepush: rename commands
Summary: infinitepush: rename commands

Differential Revision: D6772334

fbshipit-source-id: c6a913c5e4b29ca6b92d2aa06b4b072c73d28697
2018-04-13 21:50:54 -07:00
Hollis Blanchard
5d56308d7e p4fastimport: fix ignored executable bits
Differential Revision: https://phab.mercurial-scm.org/D1912

fbshipit-source-id: 8972a19eb3faa7aeb91bf9a341702a7afffc7e63
2018-04-13 21:50:54 -07:00
Jun Wu
9fde63a970 run-tests: add a --extra-rcpath option to load other config files
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
2018-04-13 21:50:54 -07:00
Jun Wu
8238de1e82 keyword: drop the extension
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
2018-04-13 21:50:54 -07:00
Jun Wu
2c2e9112b0 hgsubversion: do not mess up with sys.path
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
2018-04-13 21:50:54 -07:00
Phil Cohen
5cae81a643 extensions: default-on conflictinfo, errorredirect, ...
Summary: ...mergedriver, and progressfile.

Reviewed By: quark-zju, singhsrb

Differential Revision: D6765952

fbshipit-source-id: 8eddcdeffa5d6532f737f45f7e1071c1a563a3cd
2018-04-13 21:50:54 -07:00
Siddharth Agarwal
946d70edca sshserver: add a couple of tests for argument parsing
Summary: I noticed that we didn't have any unit tests covering wire protocol argument parsing.

Differential Revision: D6757891

fbshipit-source-id: 17ec2be2f7e6bf193983178938dcc27e23dfff71
2018-04-13 21:50:54 -07:00
Siddharth Agarwal
af0f79a556 watchman: add an empty .watchmanconfig
Summary:
This ensures that watchman doesn't complain when it starts watching this
directory.

Differential Revision: D6757821

fbshipit-source-id: 30b3e71b9601e74af51ad7ac18e1f197777b9e72
2018-04-13 21:50:54 -07:00
Durham Goode
8e36a4eab5 excludedefault: update the tests
fbshipit-source-id: 1c2acaf5f5e0bfbf21e0d427e24d3e9975516151
2018-04-13 21:50:53 -07:00
Durham Goode
3666ccd6b2 clindex: disable by default for now
fbshipit-source-id: b1af6f49eebfbada4bf9637ea4935c618b0e7bb6
2018-04-13 21:50:53 -07:00