Commit Graph

12642 Commits

Author SHA1 Message Date
Jun Wu
30ca26055f run-tests: do not override --with-hg with -l
Summary:
When `--with-hg` and `-l` are both provided. `-l` will override
`--with-hg`, which is unfriendly. Let's do the reverse.

Reviewed By: DurhamG

Differential Revision: D6879863

fbshipit-source-id: 00ea9805431cc7afa6dd521cfb9059c898ed6d1f
2018-04-13 21:51:01 -07:00
Jun Wu
c03c09633f test-check: use --cwd to avoid issues
Summary:
`test-check-help.t` could run `hg help` and that command shouldn't be affected
by the current repo requirement. So let's add `--cwd /`.

`helpers-testrepo.sh` uses `-R path` and that only works if path is the repo
root. It's not guarnateed now. So let's use `--cwd` instead.

Reviewed By: DurhamG

Differential Revision: D6879867

fbshipit-source-id: 0b40ab71acf7eb215834ce323fc16156da9afcd3
2018-04-13 21:51:01 -07:00
Jun Wu
cc33c003c2 lz4: import lz4.block
Summary:
`lz4.block` needs to be imported explicitly before being able to
use `lz4.block.compress`.

We didn't notice this because we're using an old version of
`python-lz4`.

Reviewed By: DurhamG

Differential Revision: D6879877

fbshipit-source-id: 37e8fdc00386bef3733753f925ad308f42e5a740
2018-04-13 21:51:01 -07:00
Jun Wu
3a7081dc36 cleanup: remove pythonpath.py
Summary: This should be removed with D6865042.

Reviewed By: phillco

Differential Revision: D6879861

fbshipit-source-id: 960a9ab643f63d6d4a01dfb0ab7af77616cf9ea2
2018-04-13 21:51:01 -07:00
Durham Goode
01b34be972 hg: prefetch trees before producing changegroup
Summary:
When building a changegroup, sometimes we need to access the list of
files changed by each commit. To do so we need to inspect the manifest.
Previously this would end up downloading each tree one-by-one, producing a bunch
of pack files. With this patch we now do one bulk download at the very
beginning.

Reviewed By: quark-zju

Differential Revision: D6873076

fbshipit-source-id: b916c15efca0770129340f798d3e7b165da6aec9
2018-04-13 21:51:01 -07:00
Durham Goode
57cf49a88d hg: move prefetch onto repo object
Summary:
A future diff will add tree prefetching during changegroup creation. This
requires access to the tree prefetch function from the shallowbundle class.
let's move the prefetch functions onto the repo object in preparation for that.

Reviewed By: quark-zju

Differential Revision: D6873055

fbshipit-source-id: 18de0ee0f6ab566587509f9e23ebb2e5779ed1c8
2018-04-13 21:51:01 -07:00
Jun Wu
1cde63d99c codemod: drop hacks changing PYTHONPATH in tests
Summary:
Now they are unnecessary since `run-tests.py` will set up `PYTONPATH`
correctly.

Differential Revision: D6865042

fbshipit-source-id: ca95314f725968e14349a9d916434aa832c596f9
2018-04-13 21:51:00 -07:00
Adam Simpkins
d61006b81f update hg rebase -i -s to bail out on unsupported src revs
Summary:
`hg rebase -i` only works if the source revision is ancestor of the working
directory parent.  This updates the code to fail with an error message in this
case instead of rebasing nothing and reporting success.

Note that attempting to change the revset calculation to use `src::` instead
of `src::.` doesn't help fix anything--the histedit code simply rejects the
histedit operation when it finds commits that are not ancestors of the working
directory.

Reviewed By: quark-zju

Differential Revision: D6853548

fbshipit-source-id: 14600f31a5f4ca43c89a81e7b522656b65a056dc
2018-04-13 21:51:00 -07:00
Kaley Huang
b787f74134 p4fastimport: fix badsymlink test
Summary: test-p4fastimport-import-badsymlink.t is failing the regex match P58977427, and this fixes it.

Differential Revision: D6836164

fbshipit-source-id: df43a9e5e30a2745a5dbb36bc6cc07ab81179525
2018-04-13 21:51:00 -07:00
Liubov Dmitrieva
b5b151319c backout: use only first line of commit message for backout default message
Summary: backout: use only first line of original commit message (title) for backout default message.

Reviewed By: phillco

Differential Revision: D6846109

fbshipit-source-id: 68efbff9db698599a12cef45de7ab4af96cf184f
2018-04-13 21:51:00 -07:00
Liubov Dmitrieva
85159c20b5 Improve UX for short hash infinitepush feature
Summary:
Improve UX for short hash infinitepush feature

I would like to provide some suggestions in case there are several with the same prefix,
so we can provide better user experience.

Reviewed By: markbt

Differential Revision: D6845233

fbshipit-source-id: 4868c1dc599f60e4ac495b71a4aed2d57c36ffa4
2018-04-13 21:51:00 -07:00
Simon Farnsworth
c9914836f9 account for drawdag move in test-doctest.py
Summary:
D6827925 deletes drawdag.py from the tests directory; because the
tests in that revision were run on a repo with .pyc files left behind, the test
failure never happened. Move the test to the new location

Differential Revision: D6845181

fbshipit-source-id: 33c2836d81f66c9cc2a8e82a78b2d6835278a2ac
2018-04-13 21:51:00 -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
Jun Wu
f0a0b28223 test-infinitepush-bundlestore: stabilize the tests
Summary:
It seems chg might cause troubles like `--bundle-repo` becomes an unknown flag,
if run with other tests. So let's run the tests without chg.

Also avoid using subshells so `exit 80` (in `setup*` shell functions) would correctly
skip the test if `mysql-connector` is not installed.

Reviewed By: singhsrb

Differential Revision: D6841356

fbshipit-source-id: 72d70b8bcc1eac732a2fd89acd9865a8b23be074
2018-04-13 21:51:00 -07:00
Durham Goode
0e21c4e1ab hg: fix treeonly prepushrebase python hooks for treeonly pushes
Summary:
When pushing a treeonly commit to a tree+flat hybrid server, the server
needs to execute the hooks in treeonly mode so we never try to access the flat
manifests. Previously we did this for shell hooks by setting some environment
variables, but we didn't do it for python hooks that ran in process.

This diff makes the python hooks run against a bundle repo that is instantiated
in treeonly mode. No changes to any hooks are required, as the repo object they
are given is already in the correct mode.

Reviewed By: quark-zju

Differential Revision: D6840971

fbshipit-source-id: 9fcb97d972076911b35bccf3f79b60972bcafc33
2018-04-13 21:51:00 -07:00
Jun Wu
96a9afa2a5 drawdag: inline drawdag
Summary:
Since we have `debugbuilddag` as a builtin command, and `drawdag` is
pretty useful for writing clean test cases. Let's inline it. This would
simplify many tests since `drawdag=..." is no longer needed.

Reviewed By: DurhamG

Differential Revision: D6827925

fbshipit-source-id: b749f57fd5c55b2cb000dd2da2c2f9bc2386a519
2018-04-13 21:50:59 -07:00
Durham Goode
d4eed83607 hg: switch remotefilelog-local test to use regex
Summary:
The last attempt did not fix the flakyness. Let's just allow both
results for now.

Reviewed By: quark-zju

Differential Revision: D6839543

fbshipit-source-id: 0d66ee2bbb38aaed67ee2c890c024b3e8eb82a95
2018-04-13 21:50:59 -07:00
Durham Goode
1d3146a75e hg: fix check tests due to string literal issues
Summary:
A recent change added "from __future__ import unicode_literals" to a
few files, this changes the way strings are interpreted so we need to update
them to escape backslashes, otherwise they can be interpreted as unicode
characters and sometimes be invalid.

Reviewed By: quark-zju

Differential Revision: D6838181

fbshipit-source-id: 42fed1edafbb988342f482c3a63b5b235aba7390
2018-04-13 21:50:59 -07:00
Durham Goode
52f0c867dd hg: reduce test flakiness
Summary:
The remotefilelog-local test was notorious for being flaky. I was able
to reproduce the issue pretty consistently for a bit, and this change appears to
have made the problem go away. I can't promise it will work, but it seems to
have helped.

Reviewed By: quark-zju

Differential Revision: D6838177

fbshipit-source-id: d0ac0171fa2a93e28ed4afcabb5b15b5ee5e7d83
2018-04-13 21:50:59 -07:00
Liubov Dmitrieva
9d7e085b49 Implement support for short hashes
Summary:
[infinitepush] Implement support for short hashes

Also, fix test that was broken and lint errors

Reviewed By: StanislavGlebik

Differential Revision: D6814967

fbshipit-source-id: fef1ae79ef85ebf84aa88cd99367946256049192
2018-04-13 21:50:59 -07:00
Jordi Llull Chavarria
e731a435e4 Add missing column to infinitepush test table
Summary: The time column was missing in the bookmark test table

Reviewed By: StanislavGlebik

Differential Revision: D6819122

fbshipit-source-id: c0b4ede651ba5c598f0384580942cfb727b5fe61
2018-04-13 21:50:59 -07:00
Phil Cohen
1e0dbc1386 contbuild: fix test-shbang.t
Summary:
`build_rpm.py` has a /usr/bin/env shbang so it shouldn't be a failure here.

Although, it's had that shebang since 1/23/18.

Reviewed By: quark-zju

Differential Revision: D6825992

fbshipit-source-id: bf7ff3d61338384d8c6e26a93c71f4361687f1f2
2018-04-13 21:50:58 -07:00
Durham Goode
210bd25b94 hg: fix check code errors
Summary: These snuck in.

Reviewed By: phillco

Differential Revision: D6821043

fbshipit-source-id: bd4d83e2460bebdb2061dfbf84bed0139d1b72e1
2018-04-13 21:50:58 -07:00
Liubov Dmitrieva
68ac2c6418 Improve backout default message
Summary: [backout] Improve backout default message

Reviewed By: phillco

Differential Revision: D6818834

fbshipit-source-id: 3dc2465f64e37ff4bc96eff512ae991cf2a2f96d
2018-04-13 21:50:58 -07:00
Phil Cohen
87bb8c5500 rebase: fix a bug where rebases would wrongly be restarted
Summary:
If `rebase.experimental.inmemory` was enabled, but you ended up merging on-disk (e.g. you rebased the working copy parent), and you got merge conflicts, and didn't immediately solve them, hg would discard any work you did and restart the rebase unnecessarily.

The bug here is basically that `rbsrt.inmemory` field can be set to False later, because we make further calculations once we define the `rebaseset`. In that case `InterventionRequired` will get raised if the user didn't solve conflicts, but we'll catch it, thinking something went wrong "in-memory", and abort/rerun the rebase. I was too hasty in adding the "catch all exceptions and retry" block.

I solved this two ways -- first, move the rbsrt definition here and explicitly check the state in the Exception catch. Second, add an explicit catch for InterventionRequired and explain why with a comment.

Further refactoring of the rebase code will help here, I think, so we can consolidate all of this logic.

Reviewed By: DurhamG

Differential Revision: D6817683

fbshipit-source-id: eb8baba86ec0deb59a1e0b1cf9ffb02f056ecd92
2018-04-13 21:50:58 -07:00
Simon Farnsworth
30e993a160 template: add functions to truncate blocks and lines
Summary:
smartlog, among other places, would benefit from being able to
strictly limit the size of text output to the terminal. Provide two functions:
one truncates long lines in a filled block, the other limits the number of
lines of output. Both can optionally add a truncation marker.

Reviewed By: markbt

Differential Revision: D6819153

fbshipit-source-id: d95b654f4a6fef49ad4840f26ef74a18c370bdd8
2018-04-13 21:50:58 -07:00
Mark Thomas
11d62f6961 absorb: add -d option to include descriptions in absorb output
Summary:
Add a new `-d` option to `hg absorb`, which includes in the `-p` output the first 50
characters of the first line of the commit description for any commit that will
be absorbed into.

The width is configurable through `absorb.maxdescwidth`.

Reviewed By: ryanmce

Differential Revision: D6819341

fbshipit-source-id: 1a007aa5c15c047563b602559b338e5548bf1989
2018-04-13 21:50:58 -07:00
Mark Thomas
4b7dab149a hg: improve perf interactions with treedirstate
Summary:
There are a couple of ways that dirstate and fsmonitor interact with
treedirstate that are sub-optimal.

When iterating over all files in the dirstate map, use the iterator of keys
(`__iter__` rather than `iteritems`) to hit the treedirstate fastpath that
doesn't build the dirstate tuples.

Use `__getitem__` and catch the `KeyError` rather than `__contains__` followed
by `__getitem__`, as the latter involves two look-ups in the tree.

Skip the indirect call to `hastrackedfile` and `hasremovedfile` as these add
noticable overhead when called many times.

Also fix up the `test-check-code` failure for treedirstate.

Reviewed By: ryanmce

Differential Revision: D6818952

fbshipit-source-id: d49907c282a1b97c66a3d24257bdf54800d7da70
2018-04-13 21:50:58 -07:00
Durham Goode
2c5a125383 hg: fix check-code test
Summary: N/A

Reviewed By: quark-zju

Differential Revision: D6814855

fbshipit-source-id: bb98a13974205bdaef90d39db1271a5ed5b9c485
2018-04-13 21:50:58 -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
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
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
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
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
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
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
Phil Cohen
0900d9a168 extensions: add --excludedefault to hg debugextensions
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
2018-04-13 21:50:53 -07:00
Phil Cohen
02d588a3bc extensions: fix reposetup() not getting called for DEFAULT_EXTENSIONS
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
2018-04-13 21:50:53 -07:00
Phil Cohen
b0ad111094 sparse: use relative import
Summary: better!

Reviewed By: quark-zju

Differential Revision: D6760249

fbshipit-source-id: 45b172fe6853983f6e0611104e4fc511d9c73673
2018-04-13 21:50:53 -07:00
Phil Cohen
c7ff97160f share: fix hg unshare
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
2018-04-13 21:50:53 -07:00
Phil Cohen
c71baa2944 debugextensions: list default-on extensions as '(default)'
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
2018-04-13 21:50:53 -07:00
Kostia Balytskyi
486bb40de0 sparse: fix tests, broken by D6755971
Differential Revision: D6759900

fbshipit-source-id: 2629abc2b96e948ed69f0d30628d6a9994a19138
2018-04-13 21:50:53 -07:00
Dmitry Zhuk
df266f86b7 fbshow: add whitespace handling to hg show
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
2018-04-13 21:50:53 -07:00
Alexander Opeykin
b00bfa1fa2 display inifinitepush pull time
Reviewed By: StanislavGlebik

Differential Revision: D6748718

fbshipit-source-id: c1b5b529d1c492017e07a67629d8908bb0d19bb4
2018-04-13 21:50:53 -07:00
Durham Goode
a99b9eb0c2 sparse: add back sparse.py
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
2018-04-13 21:50:53 -07:00
Jun Wu
97dfe79221 perftweaks: fold isgooddelta tweak into core
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
2018-04-13 21:50:53 -07:00
Jun Wu
da7f79ac4a run-tests: use --local by default
Summary: Added --rebuild for the old behavior.

Reviewed By: phillco

Differential Revision: D6753296

fbshipit-source-id: 84f26af285662f91bc59db8b2a3145212118a9b6
2018-04-13 21:50:52 -07:00
Jun Wu
0d7d81e0c2 run-tests: make -j use CPU count by default
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
2018-04-13 21:50:52 -07:00
Jun Wu
07522dbb4e clindex: enable by default
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
2018-04-13 21:50:52 -07:00
Jun Wu
7fa918cefd perftweaks: move commit head detection removal logic to core
Summary: Also change the internal API so it no longer accepts the "heads" argument.

Reviewed By: ryanmce

Differential Revision: D6745865

fbshipit-source-id: 368742be49b192f7630421003552d0a10eb0b76d
2018-04-13 21:50:52 -07:00
Liubov Dmitrieva
e1ec40a30f Fix test
Summary: Fix test

Differential Revision: D6749910

fbshipit-source-id: 1eeb12992f6c883af4d66b645dda3f72f771e3dc
2018-04-13 21:50:52 -07:00
Jun Wu
fe0a348d39 perftweaks: move effectflag removal logic to core
Summary: This removes the effectflag logic from both core and perftweaks.

Reviewed By: ryanmce

Differential Revision: D6745769

fbshipit-source-id: 55ed1676e7117bca358471c256805ded7bc83f3c
2018-04-13 21:50:52 -07:00
Jun Wu
2fde5a03f5 lfs: remove duplicated tests
Summary: The tests are landed in core so those tests could be removed.

Reviewed By: ryanmce

Differential Revision: D6745446

fbshipit-source-id: f85c3e7899d4bb24bedb71d84601d7113928a4c4
2018-04-13 21:50:52 -07:00
Kostia Balytskyi
262eba6775 tests_: accept some more recently-introduced test-check failures
Summary: To be fixed later, now I need to test the hgbuild.

Differential Revision: D6748921

fbshipit-source-id: 519555286a43ef7852e37b699e30197c1ad85424
2018-04-13 21:50:52 -07:00
Liubov Dmitrieva
fa4d42e25e add commands 'hg enablebackup' and 'hg disablebackup'
Summary:
infinitepushbackup: add commands 'hg enablebackup' and 'hg disablebackup'
also, output backup status on 'hg sl command' if infinitepushbackup.enablestatus is on
fix 2 unrelated to this feature unit tests

Test Plan:
manually tested
https://phabricator.intern.facebook.com/P58867417

Reviewers: mbthomas, stash

Reviewed By: mbthomas

Subscribers: mitrandir, medson, mjpieters

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

Tasks: T24912975

Tags: bootcamp

Signature: 6688366:1516151792:47dc4a247df22b0d9912217e34503ad2fa785622

fbshipit-source-id: b847fd108ad8baaf337efa00ef445d86a64030e1
2018-04-13 13:04:39 -07:00
Jun Wu
19cda85a3a debugshell: enable it by default
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
2018-01-17 12:54:24 -08:00
Jun Wu
e81c53461e largefiles: remove the extension
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
2018-01-17 11:50:44 -08:00
Kostia Balytskyi
62064c1381 hgsubversion: accept some test-check line reshuffles
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
2018-01-17 03:23:44 -08:00
Kostia Balytskyi
0e5ac2ee76 hgsubversion: drop unneeded run.py
Summary: Depends on D6719906

Test Plan: - test-check cleanup is in the next diff in the stack

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6719920
2018-01-17 03:23:44 -08:00
Kostia Balytskyi
6134cd5994 hgsubversion: accept regexed output of comprehensive tests
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
2018-01-17 03:23:44 -08:00
Kostia Balytskyi
f47acc0834 hgsubversion: fixup comprehensive tests imports
Summary:
Here we make imports in `hgsubversion` tests work again.
This consists of two main parts:
1. tests were importing each other as python modules. Now that they have `-` in
their names, it is impossible. However, we can utilize some tricks to work
around this (`imp.load_source`)
2. tests where doing some weird location assumptions, we clean that up


Depends on D6719890

Test Plan: - `./run-tests -l test-hgsubversion-*`, see non-import-exception failures

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6719894
2018-01-17 03:23:44 -08:00
Kostia Balytskyi
5a73bf5843 hgsubversion: migrate all the tests to silentrunner
Summary:
This migration allows `./run-tests.py` to run `hgsubversion` tests. Since hgsubversion
tests are actually python unittests, we don't care about their output at all,
they fail differently. But the behavior of the test suite require us to match
whatever the tests prints. We do this later in the stack.

Depends on D6719886

Test Plan: - check that tests are runnable at least

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6719890
2018-01-17 03:23:44 -08:00
Kostia Balytskyi
82ca3e620b hgsubversion: rename test_util to test_hgsubversion_util
Summary:
This is in line with our general spirit of renaming things into test-extname-smth.

Depends on D6719883

Test Plan: - test fixes and runs follow in the stack

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6719886
2018-01-17 03:23:44 -08:00
Kostia Balytskyi
3cc5c5756c hgsubversion: move tests to the general tests dir
Summary:
Move tests to where we are used to them.

Note that I don't move comprehensive tests to the `tests` directory, since
I think that having them not run when `./run-tests.py` is run without arguments
may be a useful thing. In general, we may adopt this concept for the core as well.
If we decide we do want to move them, it's very easy to do.

Depends on D6719879

Test Plan: - fixups and test runs follow in the stack

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6719883
2018-01-17 03:23:44 -08:00
Kostia Balytskyi
72cbcae5a0 hgsubversion: rename tests from test_smth to test-hgsubversion-smth pattern
Summary:
Rename hgsubversion tests to match our tests name patterns.

Depends on D6719877

Test Plan: - just a rename, following diffs do fixups

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6719879
2018-01-17 03:23:44 -08:00
Kostia Balytskyi
34dcd51d76 run-tests: add simple regular expression support for .py.out files
Summary:
To incorporate hgsubversion tests into our test suite, we need to turn them into
silentrunner tests, which run python unittests, but do check for the output to match
some expected file. hgsubversion tests were not written with checking output in mind
(and even if they were, .t tests need globbing/regex support as well). So, this
simple support for (re) suffixes on .py.out files allow us to match unstable output.

Test Plan:
- perform some manual experiments
- following diffs in the stack make use of it

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6719877
2018-01-17 03:36:41 -08:00
Phil Cohen
66cb3160e1 sparse: don't materialize sparse files during IMM
There's no need to do this and not doing so speeds up IMM tremendously when the sparse profile had to be adjusted.

(This is the grafted version from the fb-hgext repo)

Test Plan:

I ran an IMM before and after this change. Both succeeded but the later version was
much faster.

Differential Revision: https://phab.mercurial-scm.org/D1805
2018-01-16 17:43:19 -08:00
Durham Goode
41fc137814 tests: fix lint error again 2018-01-16 14:22:33 -08:00
Durham Goode
81c3e03f81 tests: fix lint error in test 2018-01-16 09:25:50 -08:00
Kevin O'Sullivan
fa38fee98f Using a set() for names to remove duplicates before calling bookmarks.delete
Summary: Fixing a bug that causes a fatal crash when a user attempts to delete a bookmark by inputting it's name twice, for example:

# hg bookmark --delete name name
Test Plan: The following test has been added in the test/test-bookmarks.t file
https://pxl.cl/bmTf
 to test the new functionality:

~~~
kosullivan-mbp:hg-crew kosullivan$ hg diff tests/test-bookmarks.t
diff --git a/tests/test-bookmarks.t b/tests/test-bookmarks.t
--- a/tests/test-bookmarks.t
+++ b/tests/test-bookmarks.t
@@ -288,6 +288,10 @@
   abort: bookmark 'A' does not exist
   [255]

+ensure bookmark names are deduplicated before deleting
+  $ hg book delete-me
+  $ hg book -d delete-me delete-me
+
 bookmark name with spaces should be stripped

   $ hg bookmark ' x  y '
~~~
Reviewers: rmcelroy,rafeca
Subscribers: suiting
Tags: python,bootcamp,source_control
Tasks: 22525999
Differential Revision: https://phabricator.intern.facebook.com/D6711774
2018-01-16 15:20:21 +00:00
Kostia Balytskyi
3d0e3ddc15 tests_: don't rebuild the project in test-hghave.t
Summary:
Our new build process is slow because of all the rust and everything. I've seen
test-hghave.t time out a couple of times already.

Test Plan:
- `./run-tests.py -l test-hghave.t` - pass
- `./run-tests.py test-hghave.t` - pass

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6726709
2018-01-16 04:08:46 -08:00
Kostia Balytskyi
d93ba1d722 hggit: fix import in test-hggit-utl-parsing
Summary: It's failing curently in hgbuild.

Test Plan: ./run-tests.py

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6722972
2018-01-15 08:01:52 -08:00
Phil Cohen
72085d2e96 testdir: fix test-extension.t for DEFAULT_EXTENSIONS
Differential Revision: https://phabricator.intern.facebook.com/D6718663
2018-01-14 14:53:52 -08:00
Mark Thomas
5e4b8bd3a5 pushrebase: correctly track lastdestnode when rebasing merges
Summary:
The initial value of lastdestnode should be the commit onto which the rebase is
happening.

It should be updated whenever a new commit is added for which the p1 parent is
the old last dest node.

Test Plan: Run the new test, and show it now works.

Reviewers: durham, rmcelroy, #mercurial

Reviewed By: rmcelroy

Subscribers: mitrandir

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

Signature: 6709108:1515760332:32bef9892792c7c94117b8fe14364937d98ebbac
2018-01-12 19:32:46 -08:00
Mark Thomas
88d034ad12 pushrebase: add test showing failure to handle p2-parent merges
Summary:
If pushrebase is asked to rebase a commit where the p2-parent is the route to
the commit onto which the rebase is being made, then it is supposed to flip the
parents.  This is what ensures that the changes from the server-only commits
are not lost.

This doesn't work.  In this test, the "other" file, created on the server, is
lost in the final merged commit.

Test Plan: Added a test which demonstrates a failure.

Reviewers: quark, #mercurial

Reviewed By: quark

Subscribers: quark

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

Signature: 6709096:1515794007:0908765c24b18a7dcaf3672953e816095b0acf68
2018-01-12 19:34:12 -08:00
Phil Cohen
ed708bc77f tests: fix for D6717635 2018-01-12 16:58:28 -08:00
Phil Cohen
6095f32f96 extensions: enable githelp by default
Summary:
Demonstrate the full power of this batte station with the first extension to be default-enabled, `githelp.py`. This also lets us write a test for `DEFAULT_EXTENSIONS`
(`test-extensions-default.t`)

All other test changes are actual fallout from enabling the githelp extension.

Test Plan: Added a test.

Differential Revision: https://phabricator.intern.facebook.com/D6717098
2018-01-12 16:45:54 -08:00
Phil Cohen
f5d044ca3e tests: update test-check-module-imports.t
The landd version of D6713858 should've had these lines removed, but did not.
2018-01-12 16:16:28 -08:00
Francisco Massa
8efc997f51 phabricator-graphql: nice error message if ~/.arcrc is bad
Summary: When running hg ssl, if the .arcrc file is not proper JSON
(e.g., has a trailing comma), json.loads raises an exception that
was not being caught and lead to a stacktrace.

Test Plan: Locally run hg ssl with a bag .arcrc and the stack trace was gone.
Also write a test in test-fb-hgext-phabstatus.t

Reviewers: simonfar

Subscribers: luizmramos

Tasks: T24993088

Tags:
2018-01-12 10:46:25 +00:00
Saurabh Singh
10cdee8f68 hgsubversion: don't use 'svnadmin' in the tests
Summary:
The 'svnadmin' version on the system can be different from the one
expected the tests which leads to issues. Using the same logic as in commit
'39750dc6a11476d1a967311bef21f205f306f67d'.

Test Plan: cd tests/hgsubversion && ./run.py test_svnwrap.py

Reviewers: durham, #mercurial, #sourcecontrol

Reviewed By: durham

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

Signature: 6708715:1515718219:178b69a72193057214586d1618c6dc8846bf2f52
2018-01-11 16:52:57 -08:00
Phil Cohen
f3c01a963a testdir: fixes for test-check-pyflakes
Summary: Some files had missing imports; fix them.

Test Plan: Test suite now has fewer failures.

Reviewers: singhsrb, #sourcecontrol

Reviewed By: singhsrb

Subscribers: singhsrb

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

Signature: 6701257:1515648742:cf402234bbe67b08138f942ead8240a596298b7e
2018-01-10 21:37:35 -08:00
Phil Cohen
5b330bb027 testsdir: fix for fb/packaging
Summary:
Moving stuff into fb/packaging broke a few tests since they're
trying to apply the Mercurial linters on scripts that don't conform.

Let's exclude these directorites for now.

Test Plan: This fixes a test.

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6701215
2018-01-10 21:19:51 -08:00
Saurabh Singh
fddb5ec798 test-check-code: fix path to correct value
Summary: D6700784 encoded the the incorrect path. This commit addresses that.

Test Plan: Ran all the tests

Reviewers: singhsrb, #mercurial, #sourcecontrol

Reviewed By: singhsrb

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

Signature: 6700869:1515643366:9de76782a770b7ddc42b09bd06d07038f25c20b7
2018-01-10 20:05:57 -08:00
Saurabh Singh
cf825689ed facebook-hg-rpms: fix the tests due to D6700605
Summary:
D6700605 exposed new code to tests which resulted in some issues. This
commit addresses those test failures.

Test Plan: Ran all the tests.

Reviewers: phillco, #mercurial, #sourcecontrol

Reviewed By: phillco

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

Signature: 6700784:1515640770:034c3ccd602abc0b546d3936a31418803c17247b
2018-01-10 19:19:46 -08:00
Jun Wu
fb3c9c5675 lfs: add adhoc commands to upload and download blobs outside a repo
Summary:
We'd like to have a lightweight, portable tool to upload and download certain
binaries without checking them in.

This diff makes LFS do that. It's intended to be used for Rust vendored assets,
Cython and other dependencies' tarballs, and a prebuilt Python using MSVC on
Windows.

Comparing with dewey, this would unblock our Windows build.

Test Plan: Added a test.

Reviewers: durham, #mercurial

Reviewed By: durham

Subscribers: durham

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

Signature: 6699099:1515633647:2fb90c8ecb4395b0b12e8e8baf1c5ee7fa4d84b0
2018-01-10 16:07:18 -08:00
Jun Wu
f076d26725 lfs: remove internal url in test
Summary:
D5617283 requires test-lfs-test-server.t to be able to resolve an internal
domain and also requires some certain implementation detail at the endpoint
(ex. set error.code).

That will not work outside internal network. Let's change the test to just
use `lfs-test-server`. Note the logic also needs to be changed sicne
lfs-test-server does not set error.code to 404 but just removes "download"
from "actions".

Test Plan: Ran all tests.

Reviewers: durham, davidsp, #mercurial

Reviewed By: durham

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

Signature: 6698170:1515633241:2496a4c02de6916a8f74ac67c4628e6e3a049b1b
2018-01-10 15:08:16 -08:00
Jun Wu
840d98a378 testcodemod: clean up some "hgext3rd" references
Summary: Tests should not refer to hgext3rd directly.

Test Plan: Ran tests.

Reviewers: durham, #mercurial

Reviewed By: durham

Subscribers: durham

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

Signature: 6698786:1515632845:9a63120fb13eab17f268facd2be9b374506f665c
2018-01-10 15:36:54 -08:00
Jun Wu
5c05ef8327 extensions: forbid "foo=" from importing foreign mercurial modules
Summary: This avoids issues where a wrong (outside the repo) extension was used.

Test Plan: Ran all tests

Reviewers: durham, #mercurial

Reviewed By: durham

Subscribers: durham

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

Signature: 6690534:1515632034:1353c9272650cf925dd299d252592afd52970e98
2018-01-09 17:06:09 -08:00
Durham Goode
05a517b2d1 hgsubversion: fix tests to run with HGPLAIN
Summary:
A test was failing because the template it was using contained colors. Let's
just set HGPLAIN for all hgsubversion tests.

This also changes the module import checker to not just check for modules that
start with hgsubversion, since now we have modules like hgext.hgsubversion.

Test Plan: Ran the tests

Reviewers: singhsrb, #mercurial

Reviewed By: singhsrb

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

Signature: 6698665:1515628674:68d16f5560575a3623edea9919ec9e610bedd369
2018-01-10 16:21:03 -08:00
Mateusz Kwapich
c5eb76020a hgsubversion: adjust imports for the new module path
Summary:
hgsubversion now exists in hgext.hgsubversion, so the imports need to
be updated everywhere.

Test Plan: Ran the tests

Reviewers: singhsrb, #mercurial

Reviewed By: singhsrb

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

Signature: 6698653:1515628610:daad45a0e7566c784a4f5c8d7e6e5fed8976b92b
2018-01-10 16:20:54 -08:00
Mateusz Kwapich
6da99d7b2a hgsubversion: fix core tests
Summary: Mostly just check code updates.

Test Plan: Ran the tests

Reviewers: singhsrb, #mercurial

Reviewed By: singhsrb

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

Signature: 6698640:1515628510:7b80ef593d2007810064d8226a3b45e2a1ee370f
2018-01-10 16:20:45 -08:00
Mateusz Kwapich
f98fdd4963 hgsubversion: fix help test
Summary:
This test discovers what python files are available and ensures help
text is available. Since hgsubversion is now in the repo, we need to enable it
so `hg help subversion` works.

Test Plan: Ran the tests

Reviewers: singhsrb, #mercurial

Reviewed By: singhsrb

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

Signature: 6698628:1515629061:5cc01e14e6884010e76608f51dbc675d79374568
2018-01-10 16:20:37 -08:00
Mateusz Kwapich
fa935fcf5a hgsubversion: make sure we're loading hgsubversion and hg form the right place
Summary: Fix up the paths to make tests run with the new directory locations.

Test Plan: Tests are made to pass in a later diff.

Reviewers: quark, #mercurial

Reviewed By: quark

Subscribers: quark

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

Signature: 6698550:1515628538:010887d98cb473dfbc46ae26e183ebdb283902f8
2018-01-10 16:20:06 -08:00
Mateusz Kwapich
b1e4b49084 hgsubversion: move hgsubversion/tests to tests/hgsubversion
Test Plan: Tests are made to pass in later commits.

Reviewers: quark, #mercurial

Reviewed By: quark

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

Signature: 6698523:1515628418:39f509c8422cdc223f5e84ae18dfd7cfe9344b2e
2018-01-10 16:19:55 -08:00
Durham Goode
96101c63b5 moreversion: move to hgext/
Summary:
Moves the moreversion extension to hgext/ and updates the core setup.py
to process it. Eventually we should get rid of this and store the version number
as the normal Mercurial number, but that can happen later.

Test Plan:
make local && ./hg version
Mercurial Distributed SCM (version 4.4.2+8922-aa235b4cbeac+20180110)
Facebook Mercurial release: UNKNOWN-RELEASE

Reviewers: phillco, #mercurial

Reviewed By: phillco

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

Signature: 6696199:1515621476:7835f9110ec143737c488faf49cf547eee8f918e
2018-01-10 16:16:45 -08:00
Durham Goode
7f67b6a618 tests: update check code tests for fb/facebook-hg-rpms/ 2018-01-10 13:27:59 -08:00
Saurabh Singh
551e557862 infinitepush: move library-infinitepush.sh to infinitepush/library.sh
Summary: Makes more sense to have this structure after D6691821.

Test Plan: Ran all the tests.

Reviewers: quark, #mercurial, #sourcecontrol

Reviewed By: quark

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

Signature: 6694171:1515609818:1142419346e3458db7674b1b69036d88e82a1903
2018-01-10 10:44:15 -08:00
Kostia Balytskyi
c2556d553e remotenames: drop the dir and do some cleanup
Summary: Depends on D6693417

Test Plan: - run tests

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6693427
2018-01-10 09:01:52 -08:00
Kostia Balytskyi
4ba9c92043 fb-hgext: remove the directory
Summary: We've moved everything over!

Test Plan: - I like to live dangerously

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6693267
2018-01-10 08:48:02 -08:00
Phil Cohen
82285d3577 phabricator: move to extlib
Summary: Update import statements and code to match core linters.

Test Plan:
`run-tests.py -j8`

Source these versions of phabdiff.py, arcdiff.py, and phabstatus.py in my hgrc. Run hg st, diff, ssl and observe no crashes.

Reviewers: durham, rmcelroy, phillco, #mercurial

Reviewed By: rmcelroy

Subscribers: rmcelroy, quark, awestern

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

Signature: 6680961:1515578477:ea5f1591e390f6ca8a94f652daeb1db9de819fea
2018-01-10 08:39:19 -08:00
Ryan McElroy
559e7547a0 remotenames: re-enable hggit-related test
Summary: Backed out changeset 213f1f4306c1

Test Plan: `run-tests.py`

Reviewers: ikostia, #mercurial

Reviewed By: ikostia

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

Signature: 6693062:1515600922:d8380108fd3129ee6b739a47e72523e1c19b86ce
2018-01-10 08:15:55 -08:00
Saurabh Singh
80ce1d8bce infinitepush: move sql related infinitepush tests from fb-hgext/tests to tests
Summary:
Now that we moved infinitepush to hgext in D6691670, we can also move
the tests. The sql related tests need special attention because of the db
connection and mysql connector.

Test Plan:
Ran all the tests. Removed the mysql connector and checked that the
test is skipped. Also checked that the test is skipped if the db connection
details are not specified.

Reviewers: ikostia, singhsrb, #mercurial, #sourcecontrol

Reviewed By: ikostia

Subscribers: rmcelroy

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

Signature: 6691821:1515600428:279dc4796c9be721c5fa81ac2dcd6e065ac30f18
2018-01-10 08:10:27 -08:00
Saurabh Singh
d9f299ffe8 infinitepush: move some infinitepush tests from fb-hgext/tests to tests
Summary:
Now that we moved infinitepush to hgext in D6691670, we can also move
the tests.

Test Plan: Ran all the tests.

Reviewers: stash, #mercurial, #sourcecontrol

Reviewed By: stash

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

Signature: 6691848:1515573470:628d092f14cf3ae21c036883243c80eb3b01aa72
2018-01-10 08:10:27 -08:00
Saurabh Singh
567b4fad29 infinitepush: fix test-check-code.t related errors
Summary:
We changed the location of infinitepush which exposed it to the
additional test that failed. This commit fixes infinitepush to address that
test.

Test Plan: Ran all the tests.

Reviewers: rmcelroy, #mercurial, #sourcecontrol

Reviewed By: rmcelroy

Subscribers: rmcelroy

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

Signature: 6691723:1515578651:230bafc88354ecf10a31487967b43ab46a5a1279
2018-01-10 08:10:27 -08:00
Saurabh Singh
175ec57a52 infinitepush: modify description to address test-help.t
Summary:
We changed the location of infinitepush which exposed it to the
additional test that failed. This commit fixes infinitepush to address that
test.

Test Plan: Ran all the tests.

Reviewers: rmcelroy, #mercurial, #sourcecontrol

Reviewed By: rmcelroy

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

Signature: 6691691:1515578616:1ab451468835cc67a35f1d4d6e56a71f48db47e1
2018-01-10 08:10:27 -08:00
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
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
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
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
3cc56d6007 imports: fix imports to refer to hgext 2018-01-09 15:23:52 -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
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
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