Commit Graph

1795 Commits

Author SHA1 Message Date
Durham Goode
a0f1169789 py3: fix test-fb-hgext-sampling.t
Summary: Now it passes

Reviewed By: quark-zju

Differential Revision: D22143037

fbshipit-source-id: 725269096d7f29872d945b9cbfceedfcfad4e459
2020-06-22 11:34:03 -07:00
Durham Goode
474877a124 py3: fix test-hook.t
Summary: It now passes

Reviewed By: quark-zju

Differential Revision: D22145284

fbshipit-source-id: 235a0d4b75bd1bae402e61cf36f978a515190a8f
2020-06-22 11:29:42 -07:00
Durham Goode
d9be71caf7 py3: fix test-bookmarkstore.py
Summary: Easy fix

Reviewed By: quark-zju

Differential Revision: D22143857

fbshipit-source-id: c35e7121a2be4152da24d19615dc38d551011282
2020-06-22 11:29:41 -07:00
Durham Goode
96e6337e2a py3: fixes test-export-t.py
Summary: It now passes

Reviewed By: quark-zju

Differential Revision: D22146555

fbshipit-source-id: 97b82a9dcd564a287e590940f6191456ca059868
2020-06-22 11:27:52 -07:00
Carolyn Busch
69e652b380 demanedimportpy3: fix demandimport for ipdb
Summary:
Fix error "AttributeError: module 'concurrent.futures' has no attribute
'_base'" when loading asyncio.base_futures module. There very well may be a more appropriate fix, but this allows ipdb python3 debugging.

Reviewed By: quark-zju

Differential Revision: D22144225

fbshipit-source-id: eb6a96f79c97e3bd40c1efd9fc75660d6fc372ea
2020-06-22 08:59:14 -07:00
Xavier Deguillard
afc1a33c21 pyrevisionstore: aggressively release the GIL
Summary:
In the case where an expensive network operation is involved, holding the GIL
would mean that Mercurial cannot display progress bars, or simply cannot be
interrupted. This is a less than ideal user experience.

To fix this, let's release the GIL whenever we enter into the revisionstore
code.

Reviewed By: DurhamG

Differential Revision: D22140399

fbshipit-source-id: 131c8cf81e39128810e0f20d1922b5681a33d95a
2020-06-19 19:54:21 -07:00
Xavier Deguillard
275de2a00e revisionstore: add tracing spans to lfs code
Summary: This will help in debugging potential performance issues.

Reviewed By: DurhamG

Differential Revision: D22140035

fbshipit-source-id: d7403897fbb843a4eca874c1da3788190d181bc0
2020-06-19 19:54:21 -07:00
Xavier Deguillard
b8744c42cc revisionstore: add a timeout when sending lfs requests
Summary:
We've seen a handful of hangs in the LFS code, adding a timeout on the
connection request would help in surfacing issues when the client for some
reason doesn't get a reply from the server.

We unfortunately can't add a general timeout, as a user's connection speed
would need to be taken into account.

Reviewed By: krallin

Differential Revision: D22139560

fbshipit-source-id: 0118fb8a38af488e2f40bed0a09677bc68d666a8
2020-06-19 19:54:21 -07:00
Xavier Deguillard
c87a18ebae revisionstore: enable all tokio's features
Summary:
At least one mac user had a confirmed hang in the new LFS code that caused us
to rollback LFS for fbsource. One of the thing that was weird is that both
Sandcastle and devservers have several orders of magnitude higher request to
the LFS server and thus we would expect this issue to be widespread there. We
haven't seen this.

One of the difference between the package on the devservers/sandcastle and on
macs is how they are compiled. The former is with buck, while the later is with
cargo, and the package built with buck has all the tokio features enabled,
while cargo has no features enabled. What interest us here is the kind of
scheduler that is in use: on mac the basic scheduler, on devserver/sandcastle,
the threaded scheduler.

While I'm not entirely convinced that the difference in the scheduler is what
causes the hang, it's a good idea to make sure that both of our packages are
compiled the same way.

Reviewed By: krallin

Differential Revision: D22138593

fbshipit-source-id: ce9e64a6a930d2b0cccb634a1af9c3b5b8816a21
2020-06-19 19:54:21 -07:00
Xavier Deguillard
b3a13a6fd8 debugedenimporthelper: make it python3 compatible
Summary:
While the code contained type information, some of them were not entirely
correct, path for instance should be str, command arguments are also passed in
as str, not bytes.

Reviewed By: ikostia

Differential Revision: D22104689

fbshipit-source-id: 50cbc9f81a3d9cc324f9105f0bbfbc71d9ca9e98
2020-06-19 16:52:30 -07:00
Arun Kulshreshtha
88ecb984c5 tests: rename environment variables
Summary: Per our ongoing effort to reduce the usage of potentially problematic terminology, rename the environment variables used to include and exclude tests.

Reviewed By: singhsrb

Differential Revision: D22143371

fbshipit-source-id: 97a0f73b21183f94d34af929e75cd531e4e24196
2020-06-19 15:33:18 -07:00
Durham Goode
74da65a38f py3: reupgrade mysql-connector-python to yummy version
Summary:
This is required for migrating to python 3. Originally this broke
builds on non-fbcode centos7 platforms. Since we don't need hgsql in non-fbcode
platforms, I've just tweaked it to skip the hgsql tests for non-fbcode centos7.

Reviewed By: quark-zju

Differential Revision: D22140187

fbshipit-source-id: 01676db9d006375bd3b5ae9e8f13f5592e36b074
2020-06-19 15:25:26 -07:00
Stefan Filip
a2cbbf7f89 python3: fix test-eol.t
Summary: In Python3, b'a\n'[-1] is 10 whereas in Python2 it is "\n".

Reviewed By: quark-zju

Differential Revision: D22128582

fbshipit-source-id: 3b13a14efd81ea2de4fd7125597e3c7ec6371492
2020-06-19 15:22:32 -07:00
Stefan Filip
d0987cd948 python3: fix test-atomictestfile.py
Summary: Python3

Reviewed By: xavierd

Differential Revision: D22125298

fbshipit-source-id: 2eb63a697be59bd33c9328fba5ef96a4cae66f43
2020-06-19 15:15:26 -07:00
Stefan Filip
690ccca46d python3: convert test-url to python3
Summary: Python 3

Reviewed By: quark-zju

Differential Revision: D22124540

fbshipit-source-id: 6ede3929bce8aed55c6203e305d08cfb312737e7
2020-06-19 15:11:55 -07:00
Durham Goode
d02d5cdbfe py3: fix test-fsmonitor*
Summary: These now pass

Reviewed By: quark-zju

Differential Revision: D22127383

fbshipit-source-id: bcaad400d9f849251e396b68ad1b4d04c8831314
2020-06-19 13:40:18 -07:00
Durham Goode
2138a84cee py3: fix test-fb-hgext-fastannotate-*
Summary: They now pass

Reviewed By: quark-zju

Differential Revision: D22126938

fbshipit-source-id: 60655e470d56187f50220b56a4628af73833066c
2020-06-19 13:40:18 -07:00
Durham Goode
fe720eb8cf py3: fix test-commit.t
Summary: It had some in-test python that needed to be updated.

Reviewed By: quark-zju

Differential Revision: D22097852

fbshipit-source-id: ebe4ab19a2e4bed73badc1d34d6fcf2db6072559
2020-06-19 13:40:17 -07:00
Durham Goode
4bfa413ecc py3: fix test-fb-hgext-errorredirect.t
Summary: It now passes

Reviewed By: quark-zju

Differential Revision: D22105461

fbshipit-source-id: 0f19faaf7fe3b365e2c825625838a74eea3ee9eb
2020-06-19 13:40:17 -07:00
Durham Goode
45b9cabfb3 py3: fix test-profile.t
Summary: Now it passes

Reviewed By: xavierd

Differential Revision: D22104180

fbshipit-source-id: 7d5f512d4294ced12d60e5ea7b2e9121447247c0
2020-06-19 13:40:17 -07:00
Durham Goode
24e2c44860 py3: fix test-dispatch.t and statprof
Summary: Fixes test-dispatch.t and fixes statprof while we're at it.

Reviewed By: xavierd

Differential Revision: D22103518

fbshipit-source-id: 7d795c6f9e3e2c8958746c10e39f55922a923dc5
2020-06-19 13:40:17 -07:00
Durham Goode
6dd5d70b1e py3: fix test-ssh.t
Summary: It now passes

Reviewed By: xavierd

Differential Revision: D22102239

fbshipit-source-id: 78a680eb06ad1ab1be94279c7c4668be9a8673be
2020-06-19 13:40:17 -07:00
Durham Goode
4409ebb103 py3: fix test-context.py
Summary:
It now works with python 3.  I dropped some test output.  In one case
it was confirming that various path encoding work, but we only support utf8 now.
I also dropped some bit that enabled debug output, since the output order was
not the same between python 2 and 3 and it seemed non-trivial to fix.

Reviewed By: xavierd

Differential Revision: D22101132

fbshipit-source-id: 682e7c61f1dd18cce34bdc014c85d560f883bd18
2020-06-19 13:40:17 -07:00
Durham Goode
7f1588131b py3: set LANG="en_US.UTF-8" for most tests
Summary:
We support unicode file paths, and in python 3 those get passed to
python libraries as unicode strings. The tests set LANG=C which mean the python
library tries to convert the path to ascii, but fails for any non-ascii
characters. Let's switch to LANG="en_US.UTF-8" to match our production
behavior and make tests about unicode paths work.

Reviewed By: xavierd

Differential Revision: D22098359

fbshipit-source-id: c3057edc66e6e32f7b8b49374e622d02bd05711f
2020-06-19 13:40:17 -07:00
Durham Goode
8a15d29e7f py3: fix test-visibility.t
Summary:
This module was using binascii.hex directly instead of using Mercurial hex
function.

Reviewed By: xavierd

Differential Revision: D22096490

fbshipit-source-id: 32c912c16415ffd94371ad945c4df2f5a82b92e5
2020-06-19 13:40:17 -07:00
Meyer Jacobs
49d5ada3f4 status: remove pickle formatter, fix test
Summary:
Remove pickle formatter, as part of python3 migration.

Fix test-status.t for python3 compatibility.

Remove test-status.t python2 requirement.

Reviewed By: xavierd

Differential Revision: D22121912

fbshipit-source-id: 1cfdd18880198ef16973463ed24cf9afb28a7afb
2020-06-19 13:31:25 -07:00
Arun Kulshreshtha
da38165c2b edenapi_types: update terminology in comment
Summary: Replace the term 'blacklisted' with 'redacted'.

Reviewed By: quark-zju

Differential Revision: D22142842

fbshipit-source-id: 461faa09a5d3958a4575c48f03e2286eec917681
2020-06-19 13:29:03 -07:00
Arun Kulshreshtha
6926c80fe8 edenapi_types: add doc comment
Summary: Add a crate-level doc comment clarifying the purpose of this crate. In particular, the motivation behind moving some of EdenAPI's types into this crate was to make it easier to share types between the server and client. As such, types that are not shared (which may pull in more complex dependencies and therefore cause build issues for either the server or client) should not be put in this crate.

Reviewed By: quark-zju

Differential Revision: D22142180

fbshipit-source-id: 7258ef33b73a87acf72d4f6bcbe8b27cbc361735
2020-06-19 12:55:49 -07:00
Meyer Jacobs
0a676501ac rage: open subprocesses in text mode
Summary: For python3 compatibility, explicitly open subprocesses in text mode (universal_newlines=True instead of text=True for backwards compatibility), and do not explicitly .decode("utf-8"), as all strings are already utf-8.

Reviewed By: xavierd

Differential Revision: D22123138

fbshipit-source-id: d91cee7909f4e87b4a04b85fa2a2929aec052da3
2020-06-19 10:19:21 -07:00
Stanislau Hlebik
2f71a99850 hgsql: add --syncfromreplica option
Summary:
Context: while syncing ovrsource commits into fbsource as a preparation for
megarepo we noticed that there are some commits that are particularly large
(e.g. up to 4Gb). Syncing them causes hgsql to become unavailable for 10-20
mins until all hg servers catch up - during that time hg log -r tip --forcesync
would just throw mysql unavailable errors.

As a mitigation for this we tried to make hgsql read from replicas instead of
master and it worked! (see D22094976 for more details). However the approach we
chose was quite hacky.

This diff tries to make it less hacky. It add --syncfromreplica option which
will be used by remote_backup.sh script on hg servers. if we don't have a lot
of read traffic on hg servers (and it should be the case for repos that are
hosted on Mononoke) then hg servers should try to read mostly from replica.

One important note here - the repository's state *might* go back in time with --syncfromreplica. I.e. consider the case where we move a bookmark without adding a new commit. Now, let's say local repository got the latest state from mysql leader. Then when we try to sync from replica if this replica is behind the local state of repository then we'd fetch the bookmarks from replica even though they are older.
With our current setup where we have a lot of different repos on different hg servers in completely different state this problem should be acceptable.

Reviewed By: ikostia

Differential Revision: D22118491

fbshipit-source-id: 4bfa869b697326441de6c004cd548df483049b9d
2020-06-19 10:16:44 -07:00
Xavier Deguillard
7943c9a7fd tests: fix test-lfs.t in python3
Summary:
The write method returns the number of bytes written, and python3 print these
if not captured.

Reviewed By: quark-zju

Differential Revision: D22096665

fbshipit-source-id: 2b1abd994df4c705515a6dc3d01c720f056f0411
2020-06-18 18:52:05 -07:00
Xavier Deguillard
a4c433988e progress: use bytes when writing to the progress
Summary:
The ui.ferr expects bytes data, and we were passing a str, causing the progress
bar to crash.

Reviewed By: quark-zju

Differential Revision: D22094687

fbshipit-source-id: fddbfdb4314661554ae90dc0dd8bb16ce080cbfd
2020-06-18 18:49:31 -07:00
Xavier Deguillard
592d84dffb tests: fix test-fb-hgext-remotefilelog-prefetch.t in python3
Summary:
The expected message are printed via repo.ui.debug, which may not be the same
device as print uses, and thus the output may be interleaved in a different
way. By using the same way of printing, this issue is avoided.

Reviewed By: ikostia

Differential Revision: D22097487

fbshipit-source-id: 6e49f44987f5660a00e72c082f0a5a483dded9ae
2020-06-18 15:17:04 -07:00
Stefan Filip
12fea6ed1b python3: remove line buffering from binary file open
Summary:
Python 3.8 gives a warning when asking for line buffering on a binary file:
```
line buffering (buffering=1) isn't supported in binary mode,
the default buffer size will be used
```

Reviewed By: xavierd

Differential Revision: D22120968

fbshipit-source-id: 9b1f98f5bfa8ac9ed4f0b4e62389051f665f5d4f
2020-06-18 14:21:20 -07:00
Mark Thomas
b0b6425f63 visibility: add hg debugvisibility status
Summary: Add a command to print out the current status of visibility tracking.

Reviewed By: quark-zju

Differential Revision: D22089413

fbshipit-source-id: 729e9f36fbc13ba90518dcd428a44c02ce358167
2020-06-18 12:15:00 -07:00
Mark Thomas
2eb20def5a commitcloud: require visibleheads for sync
Summary: Commit cloud sync works best when visibleheads are enabled.  Default to requiring it.

Reviewed By: quark-zju

Differential Revision: D22089414

fbshipit-source-id: b786103d5c5f65a7908eb97a973af9eca5990b22
2020-06-18 12:15:00 -07:00
Mark Thomas
a06ea2f1a6 thrift-types: update thrift types
Reviewed By: farnz

Differential Revision: D22089415

fbshipit-source-id: 44596865ef65579d7910f1677735c1820ad69f58
2020-06-18 12:15:00 -07:00
Xavier Deguillard
67db664778 dynamicconfig: read file as bytes
Summary:
Somehow reading the file with `open("r")` will try to decode it as ascii, but
that file may contain utf-8 characters, so open it as bytes, and then decode
it.

Reviewed By: DurhamG

Differential Revision: D22105188

fbshipit-source-id: 0cfbd8c5417b637dd76391f86226e24ee663baf7
2020-06-18 10:44:57 -07:00
Jeremy Fitzhardinge
1b4edb5567 eden: remove unused Rust dependencies
Summary:
Remove unused dependencies for Rust targets.

This failed to remove the dependencies in eden/scm/edenscmnative/bindings
because of the extra macro layer.

Manual edits (named_deps) and misc output in P133451794

Reviewed By: dtolnay

Differential Revision: D22083498

fbshipit-source-id: 170bbaf3c6d767e52e86152d0f34bf6daa198283
2020-06-17 17:55:03 -07:00
Mark Thomas
d9702a314a sampling: log repo root and repo shared root
Summary:
Add logging of the repo root and repo shared root to the sampling extension.

Reduce the number of different strings that are logged by replacing any path
component that equals the user's username (e.g. their home directory) with
`$USER`.

Reviewed By: farnz

Differential Revision: D22066053

fbshipit-source-id: 39221e5182b3d4df51afa386497003e637a50b13
2020-06-16 10:25:03 -07:00
Xavier Deguillard
adcd787f1b remotefilelog: do not import the builtins module
Summary:
From a simple `hg trace log -r .`, it appears that importing the module takes
16ms, which dominates the time it takes to load the treemanifest extension.
Since the module isn't necessary, don't import it.

Reviewed By: farnz

Differential Revision: D22048075

fbshipit-source-id: ccaf2d53eb006faa36d97df452b0db10f4983c23
2020-06-15 17:30:44 -07:00
Jeremy Fitzhardinge
c530d32056 rust: clean up some warnings
Summary: Prep for 1.44 but also general cleanups.

Reviewed By: dtolnay

Differential Revision: D22024428

fbshipit-source-id: 8e1d39a1e78289129b38554674d3dbf80681f4c3
2020-06-15 16:50:40 -07:00
Carolyn Busch
89f238b8dd Replace whitelist/blacklist term
Summary: Replaces usages of whitelist/blacklist with include/exclude/allow. These terms are more descriptive and less likely to contribute to racial stereotyping. More context: https://fb.workplace.com/groups/sourcecontrolteam/permalink/2926049127516414/

Reviewed By: farnz

Differential Revision: D22039299

fbshipit-source-id: d5b4cdeca681e1f4c992f7ef0b9f772b2ae1abd3
2020-06-15 15:01:19 -07:00
Jun Wu
6584ad18f6 run-tests: add a way to record $TESTTMP changes in source control
Summary:
Add a `--record` flag, which uses `git` to track changes in `$TESTTMP`.
I use it to track changes with C revlog vs the Rust revlog.

Reviewed By: farnz

Differential Revision: D22007501

fbshipit-source-id: a8027aa4b2b3b97c3cf5f642434451826fcbded9
2020-06-15 14:41:52 -07:00
Mark Thomas
973d9806e7 commitcloud: use correct field in interactive smartlog history
Summary:
Interactive smartlog history attempts to access `sltimestamp` as a field of
`slinfo`.  The field is actually called `timestamp`.

Reviewed By: quark-zju

Differential Revision: D22042316

fbshipit-source-id: 7c1d53dfc1c8d661a248d8412f7d780c83723721
2020-06-15 14:06:30 -07:00
Arun Kulshreshtha
977c3c73e3 edenapi_server: rename the subtree endpoint to complete_trees
Summary:
Rename the `subtree` endpoint on the EdenAPI server to `complete_trees` to better express what it does (namely, fetching complete trees, in contrast to the lighter weight `/trees` endpoint that serves individual tree nodes). This endpoint is not used by anything yet, so there isn't much risk in renaming it at this stage.

In addition to renaming the endpoint, the relevant request struct has been renamed to `CompleteTreeRequest` to better evoke its purpose, and the relevant client and test code has been updated accordingly. Notably, now that the API server is gone, we can remove the usage of this type from Mononoke's `hgproto` crate, thereby cleaning up our dependency graph a bit.

Reviewed By: krallin

Differential Revision: D22033356

fbshipit-source-id: 87bf6afbeb5e0054896a39577bf701f67a3edfec
2020-06-15 13:40:44 -07:00
Carolyn Busch
2c7f30d0c4 configparser: replace whitelist/blacklist term
Summary: Replace usages of whitelist/blacklist with include/exclude/filter/allow. These terms are more descriptive and less likely to contribute to racial stereotyping. More context: https://fb.workplace.com/groups/sourcecontrolteam/permalink/2926049127516414/

Reviewed By: kulshrax

Differential Revision: D22039298

fbshipit-source-id: 255c7389ee5ce5e54bbccdfb05ffa4cafc6958e5
2020-06-15 12:47:08 -07:00
Carolyn Busch
990926cbc6 edenscm/mercurial: Replace whitelist/blacklist term
Summary: Replaces usages of whitelist/blacklist with include/exclude/allowed. These terms are more descriptive and less likely to contribute to racial stereotyping. More context: https://fb.workplace.com/groups/sourcecontrolteam/permalink/2926049127516414/

Reviewed By: kulshrax

Differential Revision: D22039297

fbshipit-source-id: ab6e55889e6cf42aed35c856475b2ff92f4cb802
2020-06-15 12:47:08 -07:00
Paul Davis
e462d84681 Enable abort and continue use cases in zsh hg histedit autocompletion
Summary: Enable the most common autocomplete use cases in zsh hg histedit autocomplete

Reviewed By: fanzeyi

Differential Revision: D22032612

fbshipit-source-id: 1fd47d30564c51a010785d7d0553e3a5d16f163a
2020-06-15 12:16:53 -07:00
Carolyn Busch
ca4bed9633 hgext: replace whitelist/blacklist term
Summary: Replaces usages of whitelist/blacklist with includelist/excludelist/incompatiblelist/. These terms are more descriptive and less likely to contribute to racial stereotyping. More context: https://fb.workplace.com/groups/sourcecontrolteam/permalink/2926049127516414/

Reviewed By: kulshrax

Differential Revision: D22039296

fbshipit-source-id: d4c1fd09e40d5ebeaab99515ed19aa5df6c2ecc4
2020-06-15 11:47:28 -07:00