Commit Graph

42475 Commits

Author SHA1 Message Date
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
Kostia Balytskyi
e45048e95b hg: use py2exe for packaging built mercurial
Summary:
py2exe allows us to reduce startup time by 0.4s to 1s in some cases.

Depends on D6798345

Reviewed By: DurhamG

Differential Revision: D6798433

fbshipit-source-id: 566cd01f33c7bce32f577bd7b662642a4316c92b
2018-04-13 21:50:59 -07:00
Andrew Regner
537d945c15 Do not probe the home directory because autofs
Summary:
I got tired of my prompt taking a long time to return to me sometimes after a command ended, and started to investigate, and found this:

```
aregner  4069767  0.0  0.0 115052  5076 pts/17   Ss+  12:32   0:00  \_ -bash
aregner   298922  0.0  0.0 115052  3540 pts/17   S+   14:40   0:00  |   \_ -bash
aregner   298923  0.0  0.0 115052  3668 pts/17   S+   14:40   0:00  |       \_ -bash
aregner   273995  0.0  0.0 115052  4824 pts/9    Ss+  14:32   0:00  \_ -bash
aregner   274061  0.0  0.0 115052  3820 pts/9    S+   14:32   0:00      \_ -bash
[devbig308 (77bac96|remote/fbcode/warm):~/2nd-fbcode] strace -p 298923
strace: Process 298923 attached
stat("/home/.hg",
```

Sometimes it will hang ong this for 5+ minutes.  I'm assuming this has something to do with autofs and NFS home dirs or something or another, but it doesn't matter because when it gets to this point it should just stop looking for a source control directory.

Reviewed By: ryanmce

Differential Revision: D6790747

fbshipit-source-id: d32c74476046aa6b62bc26725eea6b60a4eaa9f7
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
Phil Cohen
6e301ce9ab setup: prepend version with 4.4.2
Reviewed By: DurhamG

Differential Revision: D6820709

fbshipit-source-id: 27a9e4a09b2b3cf6107a7dbff981eba0e1cc1d51
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
Mark Thomas
086eb81b0d treedirstate: remove unused import
Summary: Remove the unused `os` import that I somehow missed in D6818952.

Reviewed By: ryanmce

Differential Revision: D6819544

fbshipit-source-id: 072be0a956a6ac2bbe96f72c6fc3c79907d22c9a
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
Jun Wu
d942f5a88e hg: basic support for building hg using buck
Summary:
Adds some basic building blocks to build hg using buck.

Header files are cleaned up, so they are relative to the project root.

Some minor changes to C code are made to remove clang build
warnings.

Rust dependencies, fb-hgext C/Python dependencies (ex. cstore,
mysql-connector), and 3rd-party dependencies like python-lz4
are not built yet. But the built hg binary should be able to run
most tests just fine.

Reviewed By: wez

Differential Revision: D6814686

fbshipit-source-id: 59eefd5a3ad86db2ad1c821ed824c9f1878c93e4
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
Wojciech Lis
9e3e4e85df Fixing LFS upload
Summary:
This fixes lfs upload by avoiding use of workers. The perfect fix
would be to make handler work with the workers and multithreading, but that
is much more complex. The downlaoding has been working fine for 1.5 months now
without any reported issues so leaving that to use workers.

Reviewed By: quark-zju

Differential Revision: D6804951

fbshipit-source-id: d5ce92b35c5cbcd64174e47df7a19507c98ed64a
2018-04-13 21:50:58 -07:00
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