Commit Graph

52099 Commits

Author SHA1 Message Date
svcscm
91f04167c8 Updating submodules
Summary:
GitHub commits:

c593f8cc05
3ca284a942
9ffda0d29c
275edda5be

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: d2a99f12ca277101671a2c8c11a5b48f8fb20c39
2020-01-29 18:50:15 -08:00
Mateusz Kwapich
e4ee93b38b py: fixes for cloud sync
Summary: "hg cloud sync" succeeds when there's nothing to do

Reviewed By: quark-zju

Differential Revision: D19630431

fbshipit-source-id: e2c9859c7660e6283e6d319c634f1cd9053f8b3f
2020-01-29 18:25:41 -08:00
Mateusz Kwapich
892dcb3189 py3: make "hg cloud sl" work in py3
Summary: Some strings had to stay as unicode

Reviewed By: quark-zju

Differential Revision: D19628661

fbshipit-source-id: 6ea191c60a4ef2ed98b2e2d3ab90c875e6eea248
2020-01-29 18:25:41 -08:00
Adam Simpkins
b9790d38d6 py3: explicitly set the language_level to 3str
Summary:
This causes the code to always treat unprefixed string literals as the `str`:
i.e., bytes in Python 2 and Unicode in Python 3.  Without this setting our
unprefixed string literals were always being treated as unicode.

Reviewed By: lisroach

Differential Revision: D19634266

fbshipit-source-id: 770d7d03a96aa92a4e183819d34c72281c6c794b
2020-01-29 17:46:30 -08:00
svcscm
1da454af80 Updating submodules
Summary:
GitHub commits:

84bdd4a023
ce3b76724a
4e500a8508
4273a65c34
a72ca3216c
a65b08ff49
9e3ace42a4
5fe2fdd625
3d50460170
591f27c6f1

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 7a721a1bafa7d9d8e630e42cf507ee7bed282c86
2020-01-29 17:42:55 -08:00
Adam Simpkins
b0340dce4e hide duplicate hg error messages in eden doctor output
Summary:
If the hg data in a checkout is corrupt running `hg` commands may cause
Mercurial to crash and print backtrace information.  Hide this error output
when performing our `check_filesystems` checks.

The `check_hg` logic will already detect and handle corrupt repositories.  If
the hg error messages are displayed directly to stderr when running the
`check_filesystems` checks earlier this just makes the output more confusing
to the user.

Reviewed By: genevievehelsel

Differential Revision: D19629960

fbshipit-source-id: 774287f37b216216be3eda2247307416d7ae4034
2020-01-29 17:39:48 -08:00
Zeyi (Rice) Fan
b58fe35549 make run-tests.py py3 compatible
Summary: This diff makes `run-test.py` compatible with Python 3, so we can run this tests both in Python 3 and 2.

Differential Revision: D19611680

fbshipit-source-id: 97571cca7e1310e482ac8c03af73eb345ab825c1
2020-01-29 17:07:33 -08:00
Zeyi (Rice) Fan
e214ad8df9 testing utilities py3 compatibility
Summary:
We temporarily pin these test tools to run with Python 2 so the tests can pass no matter if it is run with 3 or 2.

This diff also makes the fake biggrep client to be Python 3 compatible.

Reviewed By: farnz

Differential Revision: D19611681

fbshipit-source-id: 0c980165934899902b152e27a0a444d6a6c9eb2f
2020-01-29 17:07:32 -08:00
Zeyi (Rice) Fan
05d306bfc3 make test-extension.t py3 compatible
Summary: because of the test `type(b"") != type("")` we actually have different behavior in Python 3 and Python 2. So we remove this test temporarily and we can add it back later.

Reviewed By: sfilipco

Differential Revision: D19611682

fbshipit-source-id: 7bca979f8ef871672ac9666286c8d5e54747e8b3
2020-01-29 17:07:32 -08:00
Zeyi (Rice) Fan
f0e50448b4 make the rest of the tests py3 compatible
Summary: This diff converts the rest of our tests to be compatible with Python 3. There are still a few tests are not fully compatible with Python 3 yet and I'll address these individually as they require major modifications.

Reviewed By: markbt

Differential Revision: D19608299

fbshipit-source-id: 3779dd0d4641ce8470598fa4909306317cf777d8
2020-01-29 17:07:32 -08:00
Stefan Filip
56c0adbc46 py3/match: convert filter result to list
Summary:
In Python3 the result of filter is a class that does not have len
implemented. In Python2 the result of filter is a list.

Reviewed By: quark-zju

Differential Revision: D19629139

fbshipit-source-id: a7a1d9d831d72b2aab8b7a920bf82295c4673603
2020-01-29 17:03:05 -08:00
Stefan Filip
49e90ce242 py3/pypathmatcher: return Str instead of Bytes
Summary:
Globs and patterns generally speaking. They should be typed as Str in
Python3 following how paths are typed.

Reviewed By: quark-zju

Differential Revision: D19628654

fbshipit-source-id: eeaede72f41258d6fe0f3cde26c434fe0b908b8b
2020-01-29 17:03:04 -08:00
Stefan Filip
f80b7bd6c4 py3/sparse: decode sparse profile as utf-8
Summary: File contents are read as bytes but content should be interpreted as utf-8.

Reviewed By: quark-zju

Differential Revision: D19628315

fbshipit-source-id: 523a201ddf57a2aabcd135156e71034c52b59adb
2020-01-29 17:03:04 -08:00
Stefan Filip
ac4aaab5a2 py3/util: treat authentication url as str
Summary: Python3 socke address is str.

Reviewed By: quark-zju

Differential Revision: D19628130

fbshipit-source-id: d6ce93d28588a9ab8829f5b95db30ecee040a160
2020-01-29 17:03:04 -08:00
Mateusz Kwapich
3cfb8a6a7c py3: node: get rid of extra encoding
Summary:
The extra call to encode makes everything a big slower, fortunately python
standard library provides functions that do the right thing.

Reviewed By: xavierd

Differential Revision: D19634034

fbshipit-source-id: 6bb0de26300c41667824422c016e8d4f0aee70d3
2020-01-29 16:48:41 -08:00
Xavier Deguillard
467b3095c1 eden_dirstate_map: encode the path
Summary: This enables `hg add` on EdenFS

Reviewed By: quark-zju

Differential Revision: D19631538

fbshipit-source-id: 1621ab77fef977c9364052bc522df18729face48
2020-01-29 16:45:46 -08:00
Durham Goode
13b96565e5 py3: convert parts of undo.py to specify utf-8
Summary: This makes hg pull make more progress.

Reviewed By: mitrandir77

Differential Revision: D19630124

fbshipit-source-id: 6e8d6bd441353ffbf87076addd2774d5e09dd24a
2020-01-29 16:41:54 -08:00
Jun Wu
c642e72b3e test-rebase-moved: fix up the test
Summary: I think my editor eat the spaces incorrectly. Fix it.

Reviewed By: xavierd

Differential Revision: D19630482

fbshipit-source-id: 3a8b94cdb269b045f678e07d0f21975effbaf7f9
2020-01-29 16:25:02 -08:00
Durham Goode
654ed5e4b1 remotenames: prefer picking default paths
Summary:
S194477 was caused by a config change adding a custom path to
repositories, where the path had the same url as default. This caused all the
remotebookmarks to be associated with the new path instead of default.

This is subtle and undesirable. Let's make it so that the default path takes
precedence.

I also deleted a hggit test because it was causing the entire test to be skipped
when dulwich wasn't available.

Reviewed By: quark-zju

Differential Revision: D19627711

fbshipit-source-id: 55b3ce94f18a26ccb9471c8e96a584d3087dbb82
2020-01-29 15:31:16 -08:00
Simon Farnsworth
c87bac85e1 py3: streamclone: make wireprotocol bytes
Summary: The wireprotocol for streaming clones should be explicitly bytes, encoding filenames as UTF-8 when needed. Make it so

Reviewed By: quark-zju, xavierd

Differential Revision: D19616097

fbshipit-source-id: 3513c801035c8d7ba950777aa119e1d1480013a5
2020-01-29 15:20:56 -08:00
Xavier Deguillard
73d424dd90 pyedenapi: use PyPath and String instead of PyBytes
Summary: This allows edenapi to be able to fetch trees on Python3.

Reviewed By: quark-zju

Differential Revision: D19629411

fbshipit-source-id: f6abd585d8d672854f7219ef8e3ab86d2f659118
2020-01-29 14:51:43 -08:00
Jun Wu
07a1c0a776 py3: connectionpool: fix some Python 3 issues
Summary: `im_self` is gone. Use `__self__` instead.

Reviewed By: xavierd

Differential Revision: D19630121

fbshipit-source-id: aa1af51e89cdffcfc63f3c18eeaf04d35425160e
2020-01-29 14:27:12 -08:00
Jun Wu
552c1dfabd py3: sshpeer: fix some encoding issues
Reviewed By: mitrandir77

Differential Revision: D19630030

fbshipit-source-id: b700187aeb412ac85e81532a525601454c45c426
2020-01-29 14:27:12 -08:00
Jun Wu
b01245ecc1 py3: commitcloud: fix some encoding issues
Reviewed By: mitrandir77, xavierd

Differential Revision: D19630028

fbshipit-source-id: 825bffa5c591f442ddecac4b9b8485dfe273b667
2020-01-29 14:27:12 -08:00
Jun Wu
50f80dff96 py3: clienttelemetry: fix some encoding issues
Reviewed By: xavierd

Differential Revision: D19630029

fbshipit-source-id: e9a9060a1e0cc2745dcb8588a083e8752384cf9f
2020-01-29 14:27:11 -08:00
Jun Wu
77a51f0e3b merge: allow specifying a customized rename script
Summary:
Provide an option to run an external script that calculates the rename
destination. This is especially helpful for cases where development happened in
another branch and *directory* and want to merge changes back.

For example, we recently had an experimental `scm3` branch that copies files
from `scm` to `scm3` to try out changes:

  o master <-- rebase destination
  |
  o (changes in scm/)
  :
  | o (changes that need to backport to scm/) <-- rebase source
  | |
  | o (changes in scm3/ that got implemented differently in scm/)
  | :
  | o (copy scm/ to scm3/ for experiments)
  |/
  o

This allows `--config experimental.rename-cmd='sed "s#scm3/#scm/#"'` to be
used for the above case.

While working on this feature, I noticed a bug that if the "copy" information
is recorded, rebase might lose changes. I added a test to track that bug.

Reviewed By: mitrandir77

Differential Revision: D19609868

fbshipit-source-id: 94462889d3ce9214b48fac793852d16aeacecc77
2020-01-29 14:27:11 -08:00
Jun Wu
0ba90481ab pycompat: add basestring, drop dep on "past"
Summary:
This removes the dependency of `future` (used by `import past`) which is not
available in our Windows tests.

Reviewed By: farnz

Differential Revision: D19626387

fbshipit-source-id: 2b13f08a9dafe77d1e7f6fc1a3cc48b3581681ca
2020-01-29 13:46:04 -08:00
Jun Wu
c18818de39 py3: pyindexes: use str for hex prefix matching
Summary: The hex prefix should be in str, not bytes.

Reviewed By: mitrandir77

Differential Revision: D19627762

fbshipit-source-id: dc9b054198dc61614518fec9bba69f789326ff8b
2020-01-29 13:43:09 -08:00
Jun Wu
282aaf155d py3: remotenames: fix compatibility issues
Reviewed By: mitrandir77

Differential Revision: D19627763

fbshipit-source-id: 3e1396a0686de81e3ed97ea5d3fb14c695bb3b8d
2020-01-29 13:43:09 -08:00
Xavier Deguillard
f2733fb294 pyrevisionstore: use PyPath for key name
Summary:
The names are really RepoPath, and thus let's use PyPath as a way to pass these
in.

Reviewed By: quark-zju, sfilipco

Differential Revision: D19625372

fbshipit-source-id: 4802030b91e6a065d3cb1905c770cad8a86da510
2020-01-29 13:32:46 -08:00
Xavier Deguillard
7c0c6feea1 commitcloud: fix max(None, None) in Python3
Summary:
In Python2, max allows None to be passed in, not in Python3, let's mimic the
Python2 behavior.

Reviewed By: sfilipco

Differential Revision: D19626654

fbshipit-source-id: f4fcaaa0516d898bc747d21735d2c30a4a9b41f4
2020-01-29 13:32:46 -08:00
Mateusz Kwapich
30c0e6482c proper bytes handling for remotefilelog
Summary:
I've inspected how the data flows from struct.unpack through the remotefilelog
and annotated few functions.

In one place I've used encodeutf8 function

Reviewed By: quark-zju

Differential Revision: D19626711

fbshipit-source-id: 77499c567b0cddab17d21b4f11b06f58bf3fcaef
2020-01-29 12:59:44 -08:00
Mateusz Kwapich
c1335eac46 add types module
Summary: Let's have a module that defines types ussed commonly in HG

Reviewed By: quark-zju

Differential Revision: D19625872

fbshipit-source-id: 817535d87acee6cb5647bc8ad25df21a95bec09c
2020-01-29 12:59:44 -08:00
Mateusz Kwapich
13aee5fa2a make all config function params strings
Summary: We want unicode configs.

Reviewed By: quark-zju

Differential Revision: D19612400

fbshipit-source-id: ec9f863c3203be7c956dcd97c735d74a11adce35
2020-01-29 12:09:37 -08:00
Stefan Filip
2dacfad0fc py3/make: rename hg3 to local3 and clean up fix
Summary:
Fixing up cleanup for hg3.
Seems to have a positive impact on regenerating the artifact after doing a rebase.

Reviewed By: quark-zju

Differential Revision: D19626379

fbshipit-source-id: 11caf0826ecb47440bcc532bfb7495771dc9159c
2020-01-29 11:56:38 -08:00
Genevieve Helsel
946a517887 allow getScmStatus to be cancelled if it calls into source control tree differ
Summary: the request will be passed with the context, so simply check the context at all three "looping" points to see if the request was cancelled. I split this into its own diff due to its unique test plan.

Reviewed By: chadaustin

Differential Revision: D18647091

fbshipit-source-id: ccb7ac765f8f3b0a60e936779cc27b658b9fd8b9
2020-01-29 11:17:57 -08:00
Genevieve Helsel
edb2b31bfd introduce RemovedScmEntry in TreeInode differ
Summary:
In any case in which our Inode is not materialized and we would like to continue to diff, we can take the hashes of both the Inode and the ScmEntry and start using the source control tree Differ.

Also, this allows us to remove the RemoveDiffEntry since that only looked at the scmEntry, so that work can also be deferred to the source control tree differ easily.

This avoids loading inodes when we don't need to. In the case of a clean checkout with two commits 30000 commits away, we reduced Inodes loaded by 98.6%.

Reviewed By: chadaustin

Differential Revision: D19292528

fbshipit-source-id: 7b5ec161f7bd65962ae30c49fdad6dbc73954c2a
2020-01-29 11:17:56 -08:00
Genevieve Helsel
8b18b91187 introduce AddedScmEntry in TreeInode differ
Summary:
In any case in which our Inode is not materialized and we would like to continue to diff, we can take the hashes of both the Inode and the ScmEntry and start using the source control tree Differ.

This reduces the number of inodes loaded by avoiding to load them if we don't need to. In the case of a clean checkout with two commits 30000 commits away, we reduced Inodes loaded by 98.6%.

Reviewed By: chadaustin

Differential Revision: D19292527

fbshipit-source-id: 2dbf6c4130214f581b6cc09e663f7567abab6ef3
2020-01-29 11:17:56 -08:00
Genevieve Helsel
76e1e89984 introduce ModifiedScmEntry in TreeInode differ
Summary:
In any case in which an inode is not materialized and we are computing a diff, we can take the hashes of both the Inode and the ScmEntry and start using the source control tree Differ.

This avoids loading inodes when not necessary. In the case of a clean checkout with two commits 30000 commits away, we reduced Inodes loaded by 98.6%.

Reviewed By: chadaustin

Differential Revision: D18647087

fbshipit-source-id: 74632de777f04e2468d10977cc757b8993d439e9
2020-01-29 11:17:55 -08:00
Genevieve Helsel
4dc48ec7fa use gitignore in tree differ
Summary: Pass a GitIgnoreStack* and isIgnored flag through the diff operation. It is used later in the stack when we go down this code path in the TreeInode diffing code. When context->loadFileContentsFromPath() is null, the gitignore loading code will be ignored, used when we do not want to honor a gitignore file. For example, during `getScmStatusBetweenRevisions()`.

Reviewed By: chadaustin

Differential Revision: D18647089

fbshipit-source-id: 20d2abd2ef61669465e134165da5a0ac5e987cca
2020-01-29 11:17:55 -08:00
Xavier Deguillard
a80bcd779b phabstatus: make PeekaheadRevsetIter an Iterator
Summary:
Python2 and Python3 have different method names for an iterator, let's inherit
from Iterator so Python (both version) tells us what needs to be implemented.

Reviewed By: mitrandir77

Differential Revision: D19624294

fbshipit-source-id: b9c3d5ae796216b4bcd330c8be6f061e369e2614
2020-01-29 11:07:10 -08:00
Xavier Deguillard
20459835bb clindex: use str as input to vfs
Reviewed By: farnz

Differential Revision: D19624129

fbshipit-source-id: cbee989334d5cf114ef7b74c9143a992cee70370
2020-01-29 11:07:09 -08:00
Xavier Deguillard
776f0fabac pyedenapi: use String for the client constructor
Summary:
Both the repo name and the url come from the config, and thus Unicode values
are passed in in Python3. The String type handles the Python2/Python3
difference, so let's use it instead of PyBytes.

Reviewed By: DurhamG

Differential Revision: D19623202

fbshipit-source-id: 72c72f8338fbb6a2f3e88395f3587a5b59389711
2020-01-29 11:07:09 -08:00
Stefan Filip
11b85a8a33 py3/remotenames: convert to str after reading data
Summary: In Python3, nodes and bookmarks are str.

Reviewed By: DurhamG

Differential Revision: D19624130

fbshipit-source-id: edbb115c7e6fa1232c92ce76e8ee5aa46b3f23db
2020-01-29 11:00:26 -08:00
svcscm
0e86bd24aa Updating submodules
Summary:
GitHub commits:

fada02ad90
a07a9dc904
fbb77357c4
3b3e46f2b3

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 0cc55e3757528f2f9db4c32dbaef32174c808706
2020-01-29 10:50:03 -08:00
Genevieve Helsel
7c8128744c remove unsued urllib import
Summary: as title, removes unused import that had python 2/3 compat issues.

Reviewed By: sfilipco

Differential Revision: D19588354

fbshipit-source-id: 05d185d0b1a8fdd1bdb7eef0557362e95d85beb4
2020-01-29 10:45:57 -08:00
Jun Wu
4e7edef4b7 py3: use edenscmdeps3.zip for Python 3 deps
Summary:
Python 2 pyc files are incompatible with Python 3.  Use a different zip file.

This also makes it possible for Python 2 and 3 setup.py build to co-exist
(discovered by markbt).

Reviewed By: markbt

Differential Revision: D19617513

fbshipit-source-id: 47b2a01e905b0cb1ec68e7a7eec40868f09a2167
2020-01-29 10:40:16 -08:00
Durham Goode
38756127f2 hgevents: disable events during status
Summary:
There are times when status updates the dirstate to mark files as
clean or to resolve lookup files. In doing so it takes the wlock, which triggers
a state-enter event which causes external watchers to then run hg status, which
can then trigger another wlock event from status. This causes an infinite loop.

It's not clear why status is taking the wlock every time. It should be a
one-time thing. So more investigation is needed. For now though, we can prevent
this from happening by disabling hgevent signals while status has the wlock.

Reviewed By: quark-zju

Differential Revision: D19602370

fbshipit-source-id: 609316de1441d40be4f81236b8d00ce7dc30a130
2020-01-29 10:30:22 -08:00
Durham Goode
a4453150d0 py3: migrate unittestify to python3
Summary: Fixes some minor issues with unittestify to make it work in python 3.

Reviewed By: quark-zju

Differential Revision: D19613469

fbshipit-source-id: 00ae212d606fbef298eb5467e225341512db1290
2020-01-29 10:11:25 -08:00
Durham Goode
0913d16fb1 py3: support python3 for the builtin interpretter
Summary:
The builtin interpreter currently only responds to "python" as the
input arg. Let's also support python3.

Reviewed By: farnz

Differential Revision: D19613372

fbshipit-source-id: 5d2eed85c2d9546808c1661f12681b03f1edc40f
2020-01-29 10:11:24 -08:00