Commit Graph

3189 Commits

Author SHA1 Message Date
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
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
Jun Wu
8699e769e8 py3: minirst: fix some encoding issues
Summary: This makes `hg3 help` work.

Reviewed By: xavierd

Differential Revision: D19617512

fbshipit-source-id: 6f7621cff36e8f711fb5c7c21c805a1f82f80dfd
2020-01-29 09:00:19 -08:00
Xavier Deguillard
9db47445cd remotefilelog: switch some wireprotocol to use bytes
Summary:
String literals are unicode in Python3, which is not the intention for
over-the-wire streams. I've also added type-checking to get help from pyre to
do the right thing.

Reviewed By: quark-zju

Differential Revision: D19614060

fbshipit-source-id: 33f2b603012481159593426dbb3c18b1614b19f6
2020-01-29 08:50:03 -08:00
Jun Wu
7d8003f36e py3: manifest: drop pure lazymanifest
Summary:
The pure implementation has many encoding issues. Since our code does not build
in the pure Python mode, just drop the pure lazymanifest implementation for
simplicity.

Reviewed By: farnz

Differential Revision: D19613691

fbshipit-source-id: f3f95717bc77a75d4aa7b597a33f8eec745df134
2020-01-29 07:45:23 -08:00
Jun Wu
df746ae467 py3: wireproto: fix some encoding issue
Reviewed By: markbt

Differential Revision: D19615830

fbshipit-source-id: c16efaba5fca65898b24192910b2afd81f77a0b9
2020-01-29 07:45:23 -08:00
Jun Wu
fa999c515f py3: visibility: fix some encoding issue
Reviewed By: farnz

Differential Revision: D19615841

fbshipit-source-id: a88a2f9328dcef77a603d67f29435c6da4956d60
2020-01-29 07:45:23 -08:00
Jun Wu
c048b191ba py3: config: fix a minor encoding issue
Reviewed By: markbt

Differential Revision: D19615812

fbshipit-source-id: 997f4c4111dfecd1c157cd428b5044efb49883f8
2020-01-29 07:45:22 -08:00
Jun Wu
4da8312956 py3: transaction: fix some encoding issues
Summary: Use bytes to write files.

Reviewed By: markbt

Differential Revision: D19615839

fbshipit-source-id: 7881a7078fcfde154ba4b6e58c706064fd8e26b9
2020-01-29 07:45:22 -08:00
Jun Wu
dc01df5bb4 py3: templater: fix some encoding issues
Summary: The template language is in unicode.

Reviewed By: markbt

Differential Revision: D19615823

fbshipit-source-id: 30c6b295b4e4c999480c46aba8b4e8ffed5a4d64
2020-01-29 07:45:21 -08:00
Jun Wu
98a90ec4a0 py3: store: fix some encoding issues
Reviewed By: markbt

Differential Revision: D19615828

fbshipit-source-id: 8adf9b8d5fda818efd7d02d1ce05cb47c56a26da
2020-01-29 07:45:21 -08:00
Jun Wu
4b64b6ce9e py3: scmutil: fix some encoding issues
Reviewed By: farnz

Differential Revision: D19615819

fbshipit-source-id: e0137e15d14cf7fd84fdd015fe1c63dc35195459
2020-01-29 07:45:21 -08:00
Jun Wu
cc6dee9815 py3: revsetlang: fix some encoding issues
Summary: Use unicode in revset expressions.

Reviewed By: farnz

Differential Revision: D19615816

fbshipit-source-id: fc0251ca7108cf3baacd9ec154bc2760657754e0
2020-01-29 07:45:20 -08:00
Jun Wu
1e9cec215e py3: profiling: fix some encoding issues
Summary: Write bytes to files.

Reviewed By: farnz

Differential Revision: D19615833

fbshipit-source-id: 0f5a0df493715fad5723b98f4b4246fc1dec53be
2020-01-29 07:45:20 -08:00
Jun Wu
9cafa05c43 py3: phases: fix some encoding issues
Reviewed By: farnz

Differential Revision: D19615840

fbshipit-source-id: ad9694e736b24254172f732f988230b987597e0e
2020-01-29 07:45:19 -08:00
Jun Wu
573b64085c py3: peer: fix a minor encoding issues
Summary: The "function name" is unicode in Python 3. Put unicode as the dict keys.

Reviewed By: farnz

Differential Revision: D19615814

fbshipit-source-id: 3508f59d11e4f8ab6345c80c6bdfaff150a63d76
2020-01-29 07:45:19 -08:00
Jun Wu
47d36736ae py3: obsolete: fix some encoding issues
Summary: Use bytes to write files.

Reviewed By: farnz

Differential Revision: D19615831

fbshipit-source-id: 0868b9272f3570547326f63e34b9b6a489788464
2020-01-29 07:45:19 -08:00
Jun Wu
330306cfde py3: blackbox: fix some encoding issues
Summary: Use bytes to write files.

Reviewed By: farnz

Differential Revision: D19615824

fbshipit-source-id: fa7b87dea80960dcc7b6586b3d50baef6228db3a
2020-01-29 07:45:18 -08:00
Jun Wu
bfa9485f90 py3: merge: fix some encoding issues
Summary: This affects mergestate and updatestate.

Reviewed By: farnz

Differential Revision: D19615836

fbshipit-source-id: bc549c71a5ba5ba9d2069deb1e77cb580f210ba2
2020-01-29 07:45:18 -08:00
Jun Wu
751d53d4e6 py3: localrepo: fix some encoding issues
Reviewed By: farnz

Differential Revision: D19615825

fbshipit-source-id: 1801652ed93ac9218a66af7f23f5bce9eab3ab10
2020-01-29 07:45:17 -08:00
Jun Wu
456a0ad5e1 py3: json: fix some encoding issues
Reviewed By: farnz

Differential Revision: D19615829

fbshipit-source-id: 3d251b8febedbdfbefe5b1e59ea026de54503663
2020-01-29 07:45:17 -08:00
Jun Wu
29711c1cf0 py3: hg: fix some encoding issues
Reviewed By: farnz

Differential Revision: D19615834

fbshipit-source-id: 8c8aaaf6bca688476662f29375b8c5484ff0765a
2020-01-29 07:45:17 -08:00
Jun Wu
3dea327fba py3: eden_dirstate: use unicode paths on Python 3
Reviewed By: farnz

Differential Revision: D19615837

fbshipit-source-id: 97e514fbc5ab3b077fd9b6c56cd8b5d7b6bc7856
2020-01-29 07:45:16 -08:00
Jun Wu
60733ef7b2 py3: dirstate: fix some encoding issues
Summary: Some assertions were added to make sure paths are unicode.

Reviewed By: farnz

Differential Revision: D19615813

fbshipit-source-id: 7d2135c0ac424fc46edd9d660b072a2a95be7f82
2020-01-29 07:45:16 -08:00
Jun Wu
a3d23bb8d7 py3: context: fix some encoding issues
Reviewed By: farnz

Differential Revision: D19615827

fbshipit-source-id: 79cfab528eeb00048b00be75fa776737b49a53d7
2020-01-29 07:45:15 -08:00
Jun Wu
0ad9daf67f py3: config: fix some encoding issues
Reviewed By: farnz

Differential Revision: D19615815

fbshipit-source-id: 2ae650dc321c776b50f49070b1c8f18dd5a2149f
2020-01-29 07:45:15 -08:00
Jun Wu
b084775bd8 py3: changegroup: fix some encoding issues
Summary:
Changegroup should be using bytes mostly except when it tries to access
files via `repo.file(path)`. The `path` should be unicode on Python 3.
Make it happen. Some assertions are added to help capture issues.

Reviewed By: farnz

Differential Revision: D19615835

fbshipit-source-id: b35d13152ecb835092c7870e88383f484dc5f868
2020-01-29 07:45:15 -08:00
Jun Wu
ef1dd7f142 py3: bundle2: use some bytes
Summary:
The bundle2 layer uses bytes since it's part of the wireprotocol.
Some assertions were added to help detecting issues.

Reviewed By: farnz

Differential Revision: D19615832

fbshipit-source-id: 73ea657b501c7539b17862165c7a5781884013a2
2020-01-29 07:45:14 -08:00
Jun Wu
19c31c1690 py3: remotefilelog: add some type assertions
Summary: This helps detecting type errors at runtime.

Reviewed By: farnz

Differential Revision: D19615821

fbshipit-source-id: 0f45e1271aff50c29858c823366a0a54c89a3903
2020-01-29 07:45:14 -08:00
Jun Wu
e2b48e1122 py3: manifest: use bytes
Summary: The layer interacting with raw manifest text should use bytes.

Reviewed By: farnz

Differential Revision: D19613694

fbshipit-source-id: c5a12235eb50acd90e409c1059a3f9f11665f9f3
2020-01-29 07:45:14 -08:00