Commit Graph

3065 Commits

Author SHA1 Message Date
Jun Wu
e70c21af9c py3: use pure util.dirs on Python 3
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
2020-01-28 10:29:12 -08:00
Jun Wu
234cbf213a py3: disable statprof on Python 3
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
2020-01-28 10:29:12 -08:00
Jun Wu
b93ad9436d py3: use native selectors on Python 3
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
2020-01-28 10:29:12 -08:00
Stefan Filip
5720b9a2a1 py3/pymanifest: convert path types from PyBytes to PyPath
Reviewed By: xavierd

Differential Revision: D19594134

fbshipit-source-id: e8532a125aa2ed4b7740e669ad572fcbb327692f
2020-01-28 10:29:11 -08:00
Durham Goode
23562ea499 amend: backout transaction change
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
2020-01-28 10:22:25 -08:00
Xavier Deguillard
283b120bb6 pyconfigparser: use PyPath instead of PyByte
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
2020-01-28 10:14:14 -08:00
Xavier Deguillard
f3b73fe8bf pymetalog: remove unecessary encoding deps
Summary: The crate doesn't depend on it, let's remove the dependency

Reviewed By: quark-zju

Differential Revision: D19593138

fbshipit-source-id: ad1e9fc68f8d126b6402efd5b1be4633fc7e5887
2020-01-28 10:01:52 -08:00
Xavier Deguillard
b45d97f7df pybookmarkstore: use PyPath instead of PyByte
Reviewed By: DurhamG

Differential Revision: D19593033

fbshipit-source-id: 5e2d5b9e72c336e6290c8359071d086a15bd05f6
2020-01-28 10:01:52 -08:00
Xavier Deguillard
1ae9196972 pyblackbox: use PyPath instead of PyByte
Reviewed By: DurhamG

Differential Revision: D19592901

fbshipit-source-id: ff875ec30bee5ac160ac701091835adbf3013b90
2020-01-28 10:01:52 -08:00
Xavier Deguillard
2d2d63544d pymutationstore: use PyPath instead of PyByte
Reviewed By: DurhamG

Differential Revision: D19592467

fbshipit-source-id: 2d7df3457a9dd02e839cffb642401575712f0f2c
2020-01-28 10:01:51 -08:00
Xavier Deguillard
962fce975d pytreestate: use PyPath instead of PyBytes
Reviewed By: DurhamG

Differential Revision: D19591844

fbshipit-source-id: be2fcdc872f57307e20e24f714b05a6f461e0594
2020-01-28 10:01:51 -08:00
Xavier Deguillard
3e27c70d42 pynodemap: use PyPath instead of PyBytes
Reviewed By: DurhamG

Differential Revision: D19591313

fbshipit-source-id: bd3a8b04b83c226f23ad6d0e1b9509bf65db2f69
2020-01-28 10:01:51 -08:00
Xavier Deguillard
8d20878c1a pydag: use PyPath instead of PyBytes
Reviewed By: quark-zju

Differential Revision: D19591260

fbshipit-source-id: 72ea5be6f79d02cce22c7a5f389cf13a9c69f969
2020-01-28 10:01:50 -08:00
Xavier Deguillard
a0d934ecc2 pyedenapi: use PyPath instead of PyBytes
Reviewed By: quark-zju

Differential Revision: D19591173

fbshipit-source-id: 1a5362c99c37f342b1aeb2d95573e4d09c8440c5
2020-01-28 10:01:50 -08:00
Xavier Deguillard
61aaf894c3 pyrevisionstore: use PyPath instead of PyBytes
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
2020-01-28 10:01:50 -08:00
Adam Simpkins
de66c7494d py3: delete an unused variable that causing Python 3 compatibility problems
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
2020-01-27 21:23:19 -08:00
Adam Simpkins
c049799e91 py3: convert some dict.iteritems() calls to items()
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
2020-01-27 21:23:19 -08:00
Adam Simpkins
3a71160859 py3: convert some encoding.environ uses to os.environ
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
2020-01-27 21:23:19 -08:00
Jun Wu
a0bd794d55 run-tests: make --debug add debugger settings
Summary: This makes --debug more useful - crashes in tests trigger ipdb sessions.

Reviewed By: mitrandir77

Differential Revision: D19581174

fbshipit-source-id: 770c7b054dfce88082b67a9347ecaeb24d8583bc
2020-01-27 19:37:21 -08:00
Mateusz Kwapich
2f68d4b0d2 remove py3 code transform
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
2020-01-27 19:00:14 -08:00
Jun Wu
373073df47 py3/rust: cpython-ext: optionally show Python error traceback
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
2020-01-27 18:56:10 -08:00
Chad Austin
b708ee6953 fix flakiness in RawOverlayTest.closed_overlay_stress_test
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
2020-01-27 18:17:01 -08:00
Xavier Deguillard
24ae9f9592 cpython-ext: fix python3 compile error
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
2020-01-27 16:58:42 -08:00
Xavier Deguillard
33ea1763ce cpython-ext: add a PyPath type
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
2020-01-27 16:50:14 -08:00
Xavier Deguillard
e512c370fd py3/rust: cpython-ext: set ob_size on raw PyObject
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
2020-01-27 16:50:14 -08:00
Xavier Deguillard
f16bb04977 py3/rust: cpython-ext: support memoryview as PySimpleBuf
Summary: Otherwise we got RustPanic when clindex or dagindex reads mmapped changelog.i.

Reviewed By: sfilipco

Differential Revision: D19581189

fbshipit-source-id: 3ee74a1bd000d58272551ae404dcfe7f957bb2c0
2020-01-27 16:50:13 -08:00
Xavier Deguillard
ad58839ca1 py3/rust: use Str type in cliparser and hgcommands
Reviewed By: sfilipco

Differential Revision: D19581176

fbshipit-source-id: e92e5c2538537ec16da25a9819c9a097a24a4d6e
2020-01-27 16:50:13 -08:00
Xavier Deguillard
1c697dbc49 py3/rust: cpython-ext: add Str type
Summary: This converts to bytes on Python 2, but unicode on Python 3.

Reviewed By: markbt

Differential Revision: D19581180

fbshipit-source-id: 0de9056a01ae30810a72352387de5a940b37d7ab
2020-01-27 16:50:13 -08:00
Xavier Deguillard
789d2b5fbb py3/rust: types: add AsRef<str> for RepoPath
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
2020-01-27 16:50:12 -08:00
Karthikeyan Singaravelan
41cd693b98 Import ABC from collections.abc instead of collections for Python 3.9 compatibility. (#780)
Summary:
Fixes https://github.com/facebook/watchman/issues/778
Pull Request resolved: https://github.com/facebook/watchman/pull/780

Test Plan: sandcastle

Reviewed By: chadaustin

Differential Revision: D19543389

Pulled By: wez

fbshipit-source-id: d9725d2f4325da2152e3c19100a25df0fe6f5dec
2020-01-27 16:35:57 -08:00
Kostia Balytskyi
6bf47a9f5a hgtime: fix corner case of date range parsing
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
2020-01-27 09:37:00 -08:00
Chad Austin
600da9aef0 bump the assertKeySpaceInvariants to a newer MSVC
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
2020-01-24 22:34:24 -08:00
Chad Austin
3199c553fa remove the legacy bind mount code from CheckoutConfig
Summary: This code is no longer used now that `eden redirect` exists.

Reviewed By: wez

Differential Revision: D19565010

fbshipit-source-id: 4703bc39a024c4c491a83ef5a6e85711a8f7e4d8
2020-01-24 18:11:36 -08:00
Stefan Filip
d78982a6e8 dag: move iddag to own file
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
2020-01-24 15:49:54 -08:00
Mark Thomas
d35692711e tests: convert test-rebase-obsolete to mutation
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
2020-01-24 14:47:39 -08:00
Mark Thomas
c0e72db0ad tests: enable mutation and visibility in some rebase tests
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
2020-01-24 14:47:39 -08:00
Mark Thomas
f2d5739705 mutation: allow instabilities if mutation is enabled
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
2020-01-24 14:47:38 -08:00
Mark Thomas
980829029a mutation: include all commits as predecessors in rebase --collapse
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
2020-01-24 14:47:38 -08:00
Mark Thomas
398e175762 visibility: ensure visibleheads and store requirements are copied on clone
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
2020-01-24 14:47:38 -08:00
Mark Thomas
845e35ea5f metalog: ensure legacy files are written out atomically
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
2020-01-24 14:47:37 -08:00
Mark Thomas
39f8b3109f visibility: add visibleheads to journaled files
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
2020-01-24 14:47:37 -08:00
Mark Thomas
4bc06df032 visibility: allow bundlerepo visibleheads to be updated
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
2020-01-24 14:47:37 -08:00
Mark Thomas
2859b55829 mutation: the workingctx is not obsolete
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
2020-01-24 14:47:36 -08:00
Chad Austin
83bdc4120b when the import helper fails to start, indicate how to view the log
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
2020-01-24 13:22:18 -08:00
Chad Austin
9db11e9454 have eden debug log show the end of the log file by default
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
2020-01-24 13:22:18 -08:00
Jia Chen
c717ef0d7d Update pyre version for eden
Summary: Automatic upgrade to remove `version` override and silence errors.

Differential Revision: D19548623

fbshipit-source-id: 12d5e8ec6450de42107d07b230e4b2d0824f7c9d
2020-01-24 12:32:43 -08:00
Lukas Piatkowski
8c7de41d8c arc/licenselint: add license linting for lua and sql
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
2020-01-24 06:13:28 -08:00
Jun Wu
52af332c28 renderdag: add tests showing how orders affect rendering
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
2020-01-23 20:50:56 -08:00
Victor Zverovich
09618791bd Update fmt to version 6
Summary: As title

Reviewed By: yfeldblum

Differential Revision: D17741047

fbshipit-source-id: e921a2fef99a9b6f11e09758e69d99a54815054a
2020-01-23 19:33:14 -08:00
Jun Wu
29c749ef7d dag: add fuzz tests on the octopus DAG
Summary: This gives us some confidence about octopus merge handling.

Reviewed By: DurhamG

Differential Revision: D19540726

fbshipit-source-id: e84de74aecae54429483edd185d39fd1bd858f87
2020-01-23 17:58:51 -08:00