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
Summary: The hex prefix should be in str, not bytes.
Reviewed By: mitrandir77
Differential Revision: D19627762
fbshipit-source-id: dc9b054198dc61614518fec9bba69f789326ff8b
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
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
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
Summary: Let's have a module that defines types ussed commonly in HG
Reviewed By: quark-zju
Differential Revision: D19625872
fbshipit-source-id: 817535d87acee6cb5647bc8ad25df21a95bec09c
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
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
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
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
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
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
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
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
Summary: In Python3, nodes and bookmarks are str.
Reviewed By: DurhamG
Differential Revision: D19624130
fbshipit-source-id: edbb115c7e6fa1232c92ce76e8ee5aa46b3f23db
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
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
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
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
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
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
Summary: The template language is in unicode.
Reviewed By: markbt
Differential Revision: D19615823
fbshipit-source-id: 30c6b295b4e4c999480c46aba8b4e8ffed5a4d64
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
Summary: Some assertions were added to make sure paths are unicode.
Reviewed By: farnz
Differential Revision: D19615813
fbshipit-source-id: 7d2135c0ac424fc46edd9d660b072a2a95be7f82
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
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
Summary: The layer interacting with raw manifest text should use bytes.
Reviewed By: farnz
Differential Revision: D19613694
fbshipit-source-id: c5a12235eb50acd90e409c1059a3f9f11665f9f3
Summary: Use native unicode hostname without converting it to bytes.
Reviewed By: farnz
Differential Revision: D19613692
fbshipit-source-id: 0bd7e37890b96566143fb0501c3fa310270844d3
Summary:
Like revlog, the changelog layer should use bytes for parsing its raw content.
`str` is still used for users, messages, etc.
Reviewed By: markbt
Differential Revision: D19613695
fbshipit-source-id: 4f6758f9fca0788bc89ad5c14d9103f66d19b7f2
Summary:
Bookmarks use unicode by default. Only need to use bytes when interacting with
vfs.
Reviewed By: farnz
Differential Revision: D19613689
fbshipit-source-id: bbe80e552cf17a023e5905f849a273b4b4299dc5
Summary: The patchtext is about a binary patch. It should use bytes.
Reviewed By: farnz
Differential Revision: D19613688
fbshipit-source-id: 20bddeb17f520f625396b23b5dcead7c7bbd3ede
Summary:
Make sure file content and wireproto buffers are using bytes.
Added a utf8 helper function.
Reviewed By: farnz
Differential Revision: D19613686
fbshipit-source-id: 5d67ce48246dc8c3cc47041f461e454c46bc67f9
Summary:
We want to assume almost all paths are unicode and drop support for non-unicode
paths. `os.fsencode` returns bytes that breaks the assumption.
Change fsencode and fsdecode to do nothing so path types remain unicode.
Most use-cases are related to `__file__`, which is already unicode on Python 3.
`posix._checklink` uses it. But it seems making it no-op is okay.
Reviewed By: farnz
Differential Revision: D19613693
fbshipit-source-id: 587dbeef68b23beeaf6bc8861c71ea27b3c512d7
Summary: Those will simplify some use-cases.
Reviewed By: farnz
Differential Revision: D19613121
fbshipit-source-id: 85ac4fa0c86afb84e0c9fb78950d3da2c93aa967
Summary: The raw blobs are in bytes, while paths and other things are in native string.
Reviewed By: markbt
Differential Revision: D19613122
fbshipit-source-id: e865168b5bc839e85ef843d771d8a6044e35a03a
Summary:
The commit message should be in native string. The raw file content is bytes.
Add translation for that.
Reviewed By: xavierd
Differential Revision: D19613117
fbshipit-source-id: 1b4145f0de75e48df3416cd7c52c09df1e6c4a07
Summary: Like filelog, the remotefilelog layer should use bytes.
Reviewed By: xavierd
Differential Revision: D19613119
fbshipit-source-id: c8221ac21dc255ad0a837b2bb30fa9966df95390
Summary: Like revlog, the filelog layer should use bytes.
Reviewed By: sfilipco
Differential Revision: D19613116
fbshipit-source-id: 6b07d05a6960c2d1c8b4ebe3001632fd8024c5af
Summary: The revlog layer should use bytes.
Reviewed By: sfilipco
Differential Revision: D19613120
fbshipit-source-id: 09f0028cbf810b52694643c79c91997d434cdaf5
Summary:
On Python 2 we want bytes.encode("utf-8") to be no-op, while on Python 3 we
want it to return a real `str`. This helper function does that.
Reviewed By: sfilipco
Differential Revision: D19613118
fbshipit-source-id: 1f0fc31bf8aee28cc20694da52b10b12dbdd9000
Summary:
Set up the `cpython-ext` and `hgcommands` libraries so that they can compile
against py2 and py3 versions of rust-cpython. Make py2 the default so
that cargo test still works.
Reviewed By: singhsrb
Differential Revision: D19615656
fbshipit-source-id: 3403e7077deb3c0a9dfe0e3b7d4f4ad1da73bba3
Summary: In both py2 and py3 stdout is text mode.
Reviewed By: simpkins
Differential Revision: D19613397
fbshipit-source-id: fe01363836cb5956c7e6d83a0f81488649c262a9
Summary:
The config functions takes Str (ie: bytes in Python2, Unicode in Python3), the
b is uncessary.
Reviewed By: sfilipco
Differential Revision: D19611274
fbshipit-source-id: 0807bd6aed1b5bd0baa0b78d3dfcbb9c46aeff35
Summary: All of these should just plain strings.
Reviewed By: sfilipco
Differential Revision: D19611275
fbshipit-source-id: 1d16c10df6f67cee9dadd7480c40950c0abae926
Summary:
Most of these tests use `file` instead of `open` for opening files, which is removed in Python 3. And when we open files in byte mode, Python disallows writing `str` into such files, so we add `b` prefix to write actual bytes instead.
There are some other minor problems like reading from `sys.stdin` gives you `str` while expecting `bytes`. The solution is to use `sys.stdin.buffer` instead. However, Python 2 does not have `sys.stdin.buffer` so we have to do a version check to provide compatibility.
Reviewed By: quark-zju
Differential Revision: D19606357
fbshipit-source-id: e9177134294f03af8b581230a57902c3435b319a
Summary:
We want all config values to always be `str` types, so remove this explicit
`encode()` call that was trying to convert the value to `bytes`.
Reviewed By: sfilipco
Differential Revision: D19610590
fbshipit-source-id: a72f0755cdb12cae13fb9d58f529433d508d46e9
Summary:
For empty repos, some versions of dulwich return a non-`None` `FetchPackResult`
where `bool(result)` throws an exception. Handle this by explicitly checking
for `result.refs` being `None`, too.
Reviewed By: sfilipco
Differential Revision: D19611221
fbshipit-source-id: 094e3ec667a484a150eb75596684a120528159e9
Summary: this pyre-ignore got lost in translation and caused pyre eden to fail
Reviewed By: sfilipco, mitrandir77, xavierd
Differential Revision: D19610997
fbshipit-source-id: b21faa36ee6b45585a774402d081bb7a3b8731b4
Summary:
Update the Rust hgcommands code to pass the command line arguments into the
Python logic as `Str` types, so that this will be Unicode `str` objects when
using Python 3.
Reviewed By: xavierd
Differential Revision: D19596739
fbshipit-source-id: 7cdfd44a1c4ce8b0f86d20b634d9b27eab822b2d
Summary:
Several of the debug commands explicitly defined their command names as bytes.
Remove the leading `b` prefix so that all command names are uniformly `str`
data types.
Reviewed By: DurhamG, sfilipco
Differential Revision: D19596738
fbshipit-source-id: 3851a32c38009968dfa338877b9ae03015dfca61
Summary: Use pycompat unicode instead of python 2 built in unicode to check type.
Reviewed By: mitrandir77
Differential Revision: D19589969
fbshipit-source-id: 3e3cf2c5cb6fd90cca9c8f803e7bd45f262f96e5
Summary: The input of minirst will be unicode, therefore, remove the b prefix.
Reviewed By: sfilipco
Differential Revision: D19610028
fbshipit-source-id: d3b1ebfeb1ba5a30afe250ce5713857dd9ebc359
Summary: The later is deprecated since python 2.6, and the former works in python3
Reviewed By: simpkins
Differential Revision: D19608560
fbshipit-source-id: c9e45bbc51f0e20416c2640dfc25e4cac4934152
Summary: The fallback filename handling can be utf8 under py3
Reviewed By: sfilipco
Differential Revision: D19610624
fbshipit-source-id: a86ed958edca70597ff5a7c67cbc746c1e325518
Summary: The module name was changed.
Reviewed By: sfilipco, xavierd
Differential Revision: D19609573
fbshipit-source-id: 7ac812c339b363dab52c942581ee10ca3e607061
Summary:
Adds from past.builtins import basestring if there is a basestring
libfuturize.fixes.fix_basestring
Reviewed By: quark-zju
Differential Revision: D19588358
fbshipit-source-id: ed2a48372bda3768183e09cd0758ad12471b0cf7
Summary:
Deal with a few more minor string/bytes issues in Python 3, and also drop a
reference to the `long` type, which no longer exists in Python 3.
Reviewed By: xavierd
Differential Revision: D19596744
fbshipit-source-id: d7dca9306934aa6bf8c17bada6f6c1a40130027f
Summary: Update this function to work on `str` data types in both Python 2 and 3.
Reviewed By: xavierd
Differential Revision: D19596742
fbshipit-source-id: 6140d2a7644dbf60c9a22c4e482757466648d5a1
Summary:
Drop the use of `re.LOCALE`. In Python 3.6+ this flag can only be used with
bytes patterns. None of these regexes actually use the \w, \W, \b, or \B
patterns that would be affected by this setting.
Reviewed By: xavierd
Differential Revision: D19596747
fbshipit-source-id: e26ed5ac6d0378e1830c67ae7c018ccb56b7609a
Summary: in python3, print becomes a function, import print_fuction to use in python 2.(ran fix_print_with_import)
Reviewed By: lisroach, quark-zju, sfilipco
Differential Revision: D19588356
fbshipit-source-id: b7cf519058ae3909ba7813618719bbd09800e73a
Summary: This is incorrectly removed due to a bad rebase / merge.
Reviewed By: DurhamG
Differential Revision: D19607801
fbshipit-source-id: a6ee7a3f184ff1882eb1f1513f7fed74a7108727
Summary:
See D17098991 for our encoding strategy.
This diff changes the i18n module to prefer unicode on Python 3.
Reviewed By: xavierd
Differential Revision: D19594826
fbshipit-source-id: 011110f3cad7aa89b729f5a86b66168fcd5a7e36
Summary:
This makes `make hg3` work. It requires cleaning up the `build` directory when
switching between py2 and py3 build, which will be fixed later.
Reviewed By: DurhamG
Differential Revision: D19604824
fbshipit-source-id: 060ff313420126a5dba935c4451b45dc9af45f13
Summary:
As of D17098991, all the data output data we write should be Unicode, so this
explicit call to `encode()` if we are running Python 3 should no longer be
used.
Reviewed By: xavierd
Differential Revision: D19596741
fbshipit-source-id: b05d94dcb9859c6ceff4bfae130550101ad3f47d
Summary: Produce a -Wdeprecated-declarations warning in code that uses the old SYNCHRONIZED macros.
Reviewed By: yfeldblum
Differential Revision: D19567088
fbshipit-source-id: b0637c06cbd125d09e1b39eec1e82a71ddca2324
Summary:
The `ui.setconfig()` code attempts to escape lists, and checks for them by
looking if the config value has an `__iter__` attribute. However, in Python 3
both `str` and `bytes` types have an `__iter__` method, so the setconfig
code incorrectly treated them as a list.
This re-orders the code so that `str` types are explicitly handled before the
check for iterable types.
Reviewed By: xavierd
Differential Revision: D19596740
fbshipit-source-id: 3c52d3e8d5b68fd2d561651bd1858889cdbe0ccb
Summary:
Update the pyconfigparser library so that it returns config values as
`unicode` in Python 3.
Most of the Python code already accesses config items with `str` keys,
but a few `.pyx` files were explicitly using bytes and needed to be updated to
use string keys.
Reviewed By: xavierd
Differential Revision: D19596746
fbshipit-source-id: fbeb363639b2256c57311bea996c4b371e068ae8
Summary:
Update the configparser APIs to return errors as a list of `Str` rather than
`Bytes`. The Python code already expects the errors as `str`, so this makes
the code do the right thing with Python 3.
Reviewed By: xavierd
Differential Revision: D19596745
fbshipit-source-id: 027c33d76b3a3b800de34366232285591841a900
Summary: Add methods to convert to a `Str` object from `String` and from `Vec[u8]`
Reviewed By: xavierd
Differential Revision: D19596743
fbshipit-source-id: 6499f7f1b8329f4d14ce8179a41ed46982a85c8e
Summary: This test tests Mercurial printing the correct encoding when the system is set to Japanese locale (CP932). The escape.py used in this test isn't Python 3 compatible due to byte-related operations. This diff makes it Python 3 compatible.
Reviewed By: quark-zju
Differential Revision: D19592535
fbshipit-source-id: 114dfcb004805045163be4a636ac703b4d24ea32
Summary: Apparently we tried to open an image file directly with `open()`. This does not work in Python 3 as it tries to read the file as string instead of bytes.
Reviewed By: farnz
Differential Revision: D19589327
fbshipit-source-id: 9c6388b704860f1f5dec199562741ac6e191d928
Summary: This makes the `dummyssh` script Python 3 compatible so we can run it with Python 3 in tests
Reviewed By: sfilipco
Differential Revision: D19587078
fbshipit-source-id: 134b01f4d5e968cd9600c9358c7230a56e11f163
Summary: Update to the new version of rust-cpython. This supports `list.append`, so make use of it.
Reviewed By: xavierd
Differential Revision: D19590905
fbshipit-source-id: 03609d4f698ae8e4380e82b8144caaa205b4c2d4
Summary:
This is optional for Python 3.6. But Python 3.8 shows a warning at runtime
without the fix.
Reviewed By: quark-zju
Differential Revision: D19581191
fbshipit-source-id: a47453f2fab92faeb6597900b9c38d1239d5ed79
Summary: most instances of this `__non_zero__` ->` __bool__` were already aliased upstream, just updates some cases in which it was not.
Reviewed By: lisroach, quark-zju, sfilipco
Differential Revision: D19591210
fbshipit-source-id: 624fcfbb35b463f2660a47ca50d28d3dcd9e2cb0
Summary: Use UTF8 paths and flags. Node, and the manifest text remain bytes.
Reviewed By: xavierd
Differential Revision: D19581190
fbshipit-source-id: f6f3c561bc5d3663f20513654bea65066a669d34
Summary:
`Py_BuildValue("s#")` returns str. Revlog uses it for nodes, which must be
bytes. Change "s#" to "y#" for bytes.
Reviewed By: xavierd
Differential Revision: D19581197
fbshipit-source-id: b925ea8f26abff49ec4feafe579f00f68cee330e
Summary:
Make `make hg3` run the python3 version of the build. There are some
Cargo.toml thing to fix. But this is a start.
Reviewed By: xavierd
Differential Revision: D19581181
fbshipit-source-id: 711a02ec0c8384f2ca3e61ead66db1e89a30837c
Summary:
Remove "b" prefix so strings become unicode.
The drawdag module was not affected by the upstream source code transformer [1]
so they added the b prefix. But drawdag is high-level enough that bytes
shouldn't be used.
[1]: https://www.mercurial-scm.org/repo/hg/rev/1c22400db72d
Reviewed By: simpkins
Differential Revision: D19581175
fbshipit-source-id: 7ae5f37af1d5145d8bac4ea82ac5ad856d83ae19
Summary:
See D17098991 for our encoding strategy.
This diff changes the urllibcompat module to prefer unicode on Python 3.
Reviewed By: farnz
Differential Revision: D19595738
fbshipit-source-id: 53ce76f8703fa0f4885f3042049d9c5fae4bc47c
Summary:
See D17098991 for our encoding strategy.
This diff changes the pycompat module to prefer unicode on Python 3.
Reviewed By: farnz
Differential Revision: D19594828
fbshipit-source-id: 3e6db24a2ebaed69deb68908f19e9b462f62c350
Summary:
See D17098991 for our encoding strategy. tl;dr, paths, argv, messages, terminal
(not pipes or files) stdout are utf-8. Non utf-8 paths are unsupported (as they
will have issues on Windows anyway).
This diff changes the encoding module to prefer unicode on Python 3.
Reviewed By: simpkins
Differential Revision: D19594827
fbshipit-source-id: c5c1319d840709bc752b96bed6ca80d10f49669e
Summary:
In Python 3 we'd like hex to return unicode strings. Provide APIs for them.
The old bytes version remain as `bbin` and `bhex`.
Reviewed By: markbt
Differential Revision: D19592521
fbshipit-source-id: 1a06ac82e3061c631c0da5d5124610656bdecaee
Summary:
The native implementation of "dirs" uses too much PyBytes internals that it's
not easy to migrate to unicode. For now let's disable the native path to
unblock Python 3 process.
Looking at the usage of dirs, it is unclear whether it is still a critical path
for performance, as scaning through all files in manifest even with the C dirs
is still too slow and we probably want time complexity fixes (ex. make it
lazy).
Reviewed By: markbt
Differential Revision: D19581192
fbshipit-source-id: 59bb2a187f675df01b4385bf4bce255f173a0aa3
Summary:
It is optional and has many encoding issues. So let's disable it for now to
unblock progress.
Reviewed By: markbt
Differential Revision: D19581182
fbshipit-source-id: 820da07dfe214a3abcd7cbf819b73dbe493c3bcc
Summary:
This removes a warning:
scm3/edenscm/mercurial/thirdparty/selectors2.py:39: DeprecationWarning: Using
or importing the ABCs from 'collections' instead of from 'collections.abc' is
deprecated since Python 3.3, and in 3.9 it will stop working
Reviewed By: markbt
Differential Revision: D19581179
fbshipit-source-id: d311b4df4cdb35527c8ab9d4a41ae306ddb2ab03
Summary:
D18213028 made amend and metaedit use a transaction around the
dirstate. This appears to have broken some auto-restack flows (T61073763). Let's
back it out for now then I'll debug later.
Reviewed By: quark-zju
Differential Revision: D19581912
fbshipit-source-id: cce32efdc91be9ca301da26a0e26b50aa6aa92d4
Summary:
Also, add a util::path::strip_unc function that is more clear than the
normalize_for_display
Reviewed By: DurhamG
Differential Revision: D19595961
fbshipit-source-id: 330bcb708bf64320a3562d79db685d6cb1e14f16
Summary:
For Python3 compatibility, let's use PyPath, it hides the logic of encoding for
Python2
Reviewed By: DurhamG
Differential Revision: D19590024
fbshipit-source-id: 7bed134a500b266837f3cab9b10604e1f34cc4a0
Summary:
In Python 3 this causes problems trying to mix bytes with str. This does not
appear to be used anywhere, so delete it.
Reviewed By: farnz
Differential Revision: D19591564
fbshipit-source-id: 42b8720e440e8e7c901b325aecb1343d5b79b7cc
Summary:
These call sites are hit during initialization. They all appear to be
small-ish dictionaries so the performance hit of having this iteration be
non-lazy in Python 2 should not matter much.
Reviewed By: farnz
Differential Revision: D19591565
fbshipit-source-id: 324844d64ba63f6e379aab270e453d44a02063e9
Summary:
Our plan for switching to Python 3 is to update many types to use Unicode
strings when appropriate. In particular, we should just go ahead and use
Unicode for environment variables, since this is the Python 3's default
behavior.
This drops the check-code.py check that warns developers against using
`os.environ` directly, and converts several call sites to use `os.environ`
directly instead of using `encoding.environ`
Reviewed By: markbt
Differential Revision: D19591566
fbshipit-source-id: e4ac44dcd5f19cd0bf65ac904fc85edad95a9aed
Summary:
We won't need it as we're going straight to dual-compatible code instead of
transforming it.
Reviewed By: quark-zju
Differential Revision: D19588132
fbshipit-source-id: 100f19b3e29874de9e8d48692c42cb2d5856bf5a
Summary:
This is optional, but it helps investigating Python errors chained with other
Rust errors.
For example:
error.RustError: failed fetching from store (, cc38739855a7f356b4a2aaac0a0a858fd646e6bf)
Caused by:
TypeError()
Traceback (most recent call last):
File "scm3/edenscm/hgext/remotefilelog/contentstore.py", line 53, in get
chain = self.getdeltachain(name, node)
File "scm3/edenscm/hgext/remotefilelog/contentstore.py", line 91, in getdeltachain
chain = self._getpartialchain(name, node)
File "scm3/edenscm/hgext/remotefilelog/contentstore.py", line 125, in _getpartialchain
return store.getdeltachain(name, node)
TypeError
Without this diff there is only "TypeError()" without the traceback.
This can be turned off by unsetting RUST_BACKTRACE.
Reviewed By: markbt
Differential Revision: D19581173
fbshipit-source-id: 74605b78146b6b1c9ddd5ad720dcd19ff73908a8
Summary:
In the case that the overlay was closed before the initial
createOverlayFile, prevent an invalid OverlayFile from being accessed,
causing the test to fail.
Reviewed By: genevievehelsel
Differential Revision: D19591636
fbshipit-source-id: 9d961f044c3b68b5c0b2dcd108ff85db6326276d
Summary: The format_err is used in shared code too, we need to import it.
Reviewed By: quark-zju
Differential Revision: D19592591
fbshipit-source-id: bd344bf3c295473f4647235a98432d11c9678bf9
Summary:
This will be used as an argument to the Rust bindings when using paths. This
type is either a PyBytes in Python2 and uses the various encoding function to
convert into a String, or a PyUnicode in Python3 with no encoding change.
Reviewed By: farnz
Differential Revision: D19587890
fbshipit-source-id: 58903426585693193754691fe3c756b9097b35f6
Summary:
Without this, Rust code using the feature (ex. lz4, used by lz4revlog) will
panic.
Reviewed By: sfilipco
Differential Revision: D19581188
fbshipit-source-id: b499449df4fede27fe66cf8e5af57e8347a0dd48
Summary: This converts to bytes on Python 2, but unicode on Python 3.
Reviewed By: markbt
Differential Revision: D19581180
fbshipit-source-id: 0de9056a01ae30810a72352387de5a940b37d7ab
Summary:
In a future diff, I have RepoPath in Rust and want to send unicode path to
Python.
Reviewed By: sfilipco
Differential Revision: D19581184
fbshipit-source-id: 73a03707a6bdae4a497a8ee2c14314aa4ffefb6d
Summary: The docs promise that both `<` and `>` bounds are inclusive, so let's fix that.
Reviewed By: markbt
Differential Revision: D19580840
fbshipit-source-id: 13770a8e9351fe62f58e9a701b526a167752543a
Summary: I reproduced the KeySpace.cpp ICE on my Windows 10 VM, so bump the MSVC version check. I have not confirmed it does not ICE on MSVC 2019.
Reviewed By: pkaush
Differential Revision: D19562325
fbshipit-source-id: 03cf84e95c709bb2ebe7c3e0055a4f290eb17f8a
Summary: This code is no longer used now that `eden redirect` exists.
Reviewed By: wez
Differential Revision: D19565010
fbshipit-source-id: 4703bc39a024c4c491a83ef5a6e85711a8f7e4d8
Summary:
Separate Segment and IdDag in two individual files. This is preparation for
refactoring IdDag to be more flexible in terms of storage. That will probably
involve moving stuff out of IdDag into a new file that deals with the storage
abstractions.
Reviewed By: quark-zju
Differential Revision: D19559127
fbshipit-source-id: b3b9b18e2653157e69148b1f29292a57b30016ec
Summary:
Add `test-rebase-mutation.t`, based on `test-rebase-obsolete.t`, but instead
testing specifically for mutation and visibility behaviour.
Reviewed By: xavierd
Differential Revision: D19549473
fbshipit-source-id: c993686eab47985737eef17ab0f52f31d0929159
Summary:
Enable mutation and visibility for the existing tests that use evolution.
Excludes `test-rebase-obsolete.t` which specifically targets obsmarkers - this
will be converted to a new test in D19549473.
Reviewed By: quark-zju
Differential Revision: D19502220
fbshipit-source-id: 70b2828b60220c6887a6210e91bed01c2809cc51
Summary:
Disallowing instabilities is a feature of evolution. For mutation tracking
there is no problem with instabilities.
Reviewed By: quark-zju
Differential Revision: D19502221
fbshipit-source-id: c21a5021bf1a8b29abb6635928da50895e2cec33
Summary:
Rebase with `--collapse` should behave like `fold` and set all the rebased
commits as predecessors of the new commit.
Reviewed By: quark-zju
Differential Revision: D19502223
fbshipit-source-id: a903ee5647bb4ee947a6cc68d8ca791fe0f1299d
Summary:
When cloning a repo, ensure the store requirements and visibleheads files are
included in the clone.
Reviewed By: quark-zju
Differential Revision: D19502224
fbshipit-source-id: e3ead586fb1fe10def02d55e33810643c0c78bc8
Summary:
`hg clone` can hardlink store files if the repos are on the same device. This
means we need to write out the legacy files using an atomic temp file, so that
the hardlink is broken. This also makes sure anyone watching the file sees the
change atomically.
Reviewed By: quark-zju
Differential Revision: D19502222
fbshipit-source-id: 3e9fb35846111c9d924de3c6b6861ce5e295e035
Summary:
The visibleheads file should be journaled like the other state files, so that
it is rolled back if a transaction aborts.
Reviewed By: quark-zju
Differential Revision: D19502226
fbshipit-source-id: c2b8d926ce97211411ca01f05e83e62cb77625b9
Summary:
The `incoming` command works by creating a bundlerepo and then updating the
commits as if a pull occurred. This means the visibleheads can get updated,
which was previously assumed impossible.
We can just accept the new set of visibleheads as-is. There may be some
unnecessary heads that are covered by other heads, but since the bundlerepo
is short-lived, this isn't a problem.
Reviewed By: quark-zju
Differential Revision: D19502219
fbshipit-source-id: ce9e98c6a40f96f5305bc7580efb476d5264fc88
Summary: It's possible for the workingctx to be queried for obsolescence. Make sure it is not considered to be obsolete.
Reviewed By: quark-zju
Differential Revision: D19502225
fbshipit-source-id: a1a37afd39a0fc16f95b4eb917372f193ac3fe82
Summary:
It's not often obvious to people where edenfs.log is located on the
filesystem, so redirect people to `eden debug log` instead.
Reviewed By: simpkins
Differential Revision: D19560709
fbshipit-source-id: 6b031c80bab2c21dfddba4d7ec37d4e70218ea08
Summary: 90% of the time, it's more useful to see the end of the log than the beginning.
Reviewed By: simpkins
Differential Revision: D19560473
fbshipit-source-id: f9b5a922d284053d6afc8ea889586826e3c58582
Summary: The fbcode/linttool has been updated to support lua and sql here D19467627, so updating arc rules to cover the new extensions
Reviewed By: zertosh
Differential Revision: D19534326
fbshipit-source-id: 4e615653acedcdf2da88e7dc4b443ad22af1324f
Summary:
I wrote it to understand how renderdag draws the same graph with different
orders. It seems useful for future optimization that tries to reduce the number
of columns. So let's check it in.
Reviewed By: xavierd
Differential Revision: D19440713
fbshipit-source-id: 8bc580799f6b24c87886d5ac306020f50bb694e5
Summary: This gives us some confidence about octopus merge handling.
Reviewed By: DurhamG
Differential Revision: D19540726
fbshipit-source-id: e84de74aecae54429483edd185d39fd1bd858f87
Summary:
TestContext uses ParentRevs. That limits parents to at most 2.
Use a type parameter so we can opt-in Vec<usize> for octopus merge support,
at the cost of worse cache efficiency.
Reviewed By: DurhamG
Differential Revision: D19540727
fbshipit-source-id: f9e8de151b7b296fd6f0fd89be9de2b8996634c7
Summary:
Our new algorithms support octopus merges. However there were no tests using
octopus merges. This diff adds a simple one.
Reviewed By: DurhamG
Differential Revision: D19540728
fbshipit-source-id: 8411024f0b7e27c2ebfabbe1935496124c25df7b
Summary:
The test runs the old and new algorithm and compares their result. This is more
interesting than using random numbers, since the fuzzing framework will try to
explore new code paths.
Reviewed By: sfilipco
Differential Revision: D19511576
fbshipit-source-id: e9a2066769b54a60bb92643e5715f91a6fccbcb5
Summary:
The ported algorithm will work as a comparison to verify dag's range
implementation.
Reviewed By: sfilipco
Differential Revision: D19511574
fbshipit-source-id: 589353d6e6c91b8d6707c977eeb8558ac733b525
Summary:
Now that loading too many blobs only GCs the blob cache, treat cached
trees as ephemeral again.
Reviewed By: simpkins
Differential Revision: D19358375
fbshipit-source-id: 191427f46276f0f5d024b5bc923a68f7a42044da
Summary:
The Rust Manifest is deployed practically everywhere.
Removing the C++ code from being compiled in Mercurial along with all of the cstore extension.
Reviewed By: quark-zju
Differential Revision: D19543248
fbshipit-source-id: d632e171175e6866563c1aa0808a099b67bd937d
Summary: Revision numbers are deprecated, let's not print them in the bisect output.
Reviewed By: DurhamG
Differential Revision: D19539678
fbshipit-source-id: 29bca3ee38cb390bdef8dd88cb912aa3dc452065
Summary: Revision number are deprecated, remove it from the user output.
Reviewed By: DurhamG
Differential Revision: D19539679
fbshipit-source-id: 7fc618e832e0e5bb3464d2ed04967b062b6f182a
Summary: The converter has many anonymous tuples being passed around, and it leads to typing error and pain figuring out which field has which data. This diff uses named tuples to implement an important tuple in the code that we use to merge repo history into a single unified history.
Reviewed By: tchebb
Differential Revision: D19377226
fbshipit-source-id: cb7d49227752fd7bc98233f6c0d1b2913cb24b05
Summary:
We don't need to it for the initial phases of the conversion. I've seen cases
were exceptions while importing were also hidden and caused weird behavior down
the line.
Reviewed By: DurhamG
Differential Revision: D19539064
fbshipit-source-id: 7415d88ef8fb69c949ed557ab0df7e6f7b39bf86
Summary:
Sadly, we didn't derive as much value from these as we would
have liked, and now they are a source of flakeyness in our tests.
Reviewed By: genevievehelsel
Differential Revision: D19460792
fbshipit-source-id: 48c82cc2d1fdbd81bece4057e93799fbcc4f4725
Summary:
The memcache code assumes it's initialized, let's actually do it.
The test change is required due to fbinit installing its own SIGTERM handler
that shows a backtrace. Installing our own SIGTERM handler makes it closer to
what Mercurial does already.
Reviewed By: quark-zju
Differential Revision: D19518698
fbshipit-source-id: bc8c2311e65c9c00678756abae3979ccda4453ea
Summary: This can prevent potential moves and clones on the caller of prefetch.
Reviewed By: quark-zju
Differential Revision: D19518697
fbshipit-source-id: 63839fc3f4bb9ca420e290eabaffb481a3584f7b
Summary:
The test runs the old and new algorithm and compares their result. This is more
interesting than using random numbers, since the fuzzing framework will try to
explore new code paths.
This cannot run on stable Rust yet. I added a README for how to run it.
Reviewed By: sfilipco
Differential Revision: D19504096
fbshipit-source-id: 621da02c50a771dee9932f9d7a407cb1f412a543
Summary: Sometimes the graph is too large. Provide a way to slice it.
Reviewed By: sfilipco
Differential Revision: D19511575
fbshipit-source-id: 504317d6894764043b23ea49dcf09c8cdea96961
Summary:
As we plan to test the dag crate with some other DAG implementation,
add a convenient structure that setups both DAG implementations.
Reviewed By: sfilipco
Differential Revision: D19503371
fbshipit-source-id: 3e9933ad37301bfac36eb1af6d82b4298af778b6
Summary:
The ported algorithm will work as a comparison to verify dag's gca
implementation.
Reviewed By: sfilipco
Differential Revision: D19503373
fbshipit-source-id: f5253db89fbcdc2fd02f3fdaa0796e24338b1fba
Summary:
This is similar to D17581248. It will make the old linear-scan algorithm (which
will be added later) about 5x faster.
Reviewed By: sfilipco
Differential Revision: D19503372
fbshipit-source-id: c65d7217e7b144603dadd57f54a5e70f513c8e51
Summary: This allows bindag to be used outside benches.
Reviewed By: sfilipco
Differential Revision: D19503374
fbshipit-source-id: 131061f7d1d28125875a86afc330dbb9634249cf
Summary:
Previously we had infinitepush path which was preferred over a default path when a
specific revision was pulled or updated to (i.e. "hg pull" would use
paths.default, but "hg pull -r HASH" would use paths.infinitepush if this path
is set in the config).
I'd like to have infinitepushbookmark path which will be preferred for all
cases except for a single commit pulls.
Reviewed By: mitrandir77
Differential Revision: D19513490
fbshipit-source-id: 7f8b809f937aa2e082c2e9cd382709c6db619a4f
Summary:
Reading all the sparse profiles can be very expensive.
This changes the format we log to the cloud. It seems nobody is depending on the old format.
Reviewed By: wlis
Differential Revision: D19517306
fbshipit-source-id: 256e78acd4c24aceb533aa4d66b90ecf885fcbcd
Summary:
Recently, the Rust extensions went away (D19340538) but that had the negative
side effect of no longer installing all Rust binaries. Make sure the
{build,install}_rust_ext steps are run properly when Rust binaries are present.
Reviewed By: quark-zju
Differential Revision: D19509526
fbshipit-source-id: 03f62f41595931dd7d5f32544a35d31e20fa3f0c