Summary:
Multiple times I've gotten mixed up by the different casing of the
LogEvent fields versus the names in the structured log. Change the
field names to match the log names.
Reviewed By: genevievehelsel
Differential Revision: D19585307
fbshipit-source-id: 3ccbb9ec5e18155367bc85e9db00bc8d556812c4
Summary:
I have a suspicion that most edenfs starts are unclean. To test that
hypothesis, add a "mount" structured event type that records whether
the mount was cleanly shut down, how long mounting took, and whether
it's a graceful restart.
Reviewed By: genevievehelsel
Differential Revision: D19585161
fbshipit-source-id: 16eedfeb6181742e64b45bca1ed3cce3edb663cb
Summary:
This has been a minor nit reported by our macOS users for a little
while.
* Skip the code that collects the process tree, as there is no
out of the box function for this on macOS. (We still run it
on Linux)
* Adjust the `ps` command arguments for macOS when running on macOS
Reviewed By: chadaustin
Differential Revision: D19649881
fbshipit-source-id: c2e7a434a3264951c3ecbd02dab3459f401190d6
Summary: The module no longer exist in Python3, it has been renamed.
Reviewed By: quark-zju
Differential Revision: D19663426
fbshipit-source-id: a805e7fa3d15335a0be4f6a8d8ae096328470728
Summary: Command lines with newlines were messing up the output of `eden top`, so escape them like a shell would.
Reviewed By: wez
Differential Revision: D19611525
fbshipit-source-id: 96c7ac00d02ac4d0f78f4f9b56fedd71b9728585
Summary:
Different versions of dulwich return different types for
`localclient.fetch_pack`. If the returned type is a real dict, then we can't
test the inner `refs` attribute, so check if it is there before testing if it
is `None`.
Reviewed By: singhsrb
Differential Revision: D19657503
fbshipit-source-id: 63cce72fa87f615e7b33279726dcb19c2fdf5b9e
Summary:
Use sed to convert testutil.ddot requires to hghave.
ignore-conflict-markers
for test-simplemerge.py
Reviewed By: simpkins
Differential Revision: D19658355
fbshipit-source-id: afae73eb1e43ead79514dfaf9f911f51ac25972e
Summary:
This breaks test-alias.t, so it looks like demandimport no longer behaves properly.
Original commit changeset: d56814049181
Reviewed By: simpkins
Differential Revision: D19658109
fbshipit-source-id: 9fd4865bd00d2307afe0c99f1500b6e08fe3e785
Summary:
D19652082 changed `urllibcompat.urlreq.quote()` to always return bytes.
This broke most of the code outside of the bundle2 module that was expecting
it to operate on strings.
This changes `quote()` to operate on strings again, since this is what the
Python 3 standard library does. This updates `bundle2` to handle encoding and
decoding properly when parsing strings that go through `quote()` and
`unquote()`.
This also changes bundle2 to stop going through the `urllibcompat.urlreq`
wrapper class, since that wrapper class prevents type checking from being
performed on its members.
Reviewed By: quark-zju
Differential Revision: D19657765
fbshipit-source-id: 0611838213ec22221e0b8367e1f0d8a6dcfceb15
Summary:
D19656501 added a usage of the `b"%b"` format specifier, which only works in
Python 3. Change the code to use `b"".join()` for now, which works in both
Python 2 and Python 3.
Reviewed By: farnz
Differential Revision: D19657472
fbshipit-source-id: 22d3123f4939fa984ffd17516e1cc48bad2bb2b7
Summary:
This diff allows us to remove the `type: ignore` specification on the
affected lines.
Reviewed By: farnz
Differential Revision: D19657442
fbshipit-source-id: 4626daf20c57fbb511b203e54f2575edc619f40f
Summary:
Fix the type annotation for `journalentry.serialize()`: It needs to come
immediately after the method declaration to be recognized, not after the
docstring.
Fixing this causes pyre to produce type errors for this method. I have
changed `journalentry` to derive from `typing.NamedTuple` to fix this. This
syntax is somewhat awkward with Python 2, but is much cleaner in Python 3.
Reviewed By: quark-zju
Differential Revision: D19656758
fbshipit-source-id: a97b8a092bff0bdc7e9dee0650c35ef383b32248
Summary:
This diff marks **ALL** mercurial tests requiring Python 2 feature.
After you fixes some tests, simply remove the `py2` feature requirement and that tests will be continuously run after your diff is landed.
To bypass this feature requirement, run the tests command with `HGTEST_FORCE_PY2=1`. For example:
```
HGTEST_FORCE_PY2=1 buck test //eden/scm/tests:hg_run_tests
```
or
```
HGTEST_FORCE_PY2=1 python run-tests.py
```
----
Basically this diff are created with the following commands:
```
$ sed -i 's/import feature\(.*\)$/import feature\1\n\nfeature.require(["py2"])/' test-*-t.py
$ sed -i '1s/^/#require py2\n/' test-*.t
$ ls | grep -P "^test.*(?<\!-t)\.py$" > list && vim -p $(cat list)
# manually adding feature requires for these Python tests.
```
(Note: this ignores all push blocking failures!)
ignore-conflict-markers
Reviewed By: singhsrb
Differential Revision: D19655148
fbshipit-source-id: 985e3ccb4010cc559049f1d89f8909bc2d9b5e20
Summary:
This is used in D19655148 to skip all the tests that are not passing in Python 3.
(Note: this ignores all push blocking failures!)
Reviewed By: farnz
Differential Revision: D19655164
fbshipit-source-id: 1a0d26926aa1b764077fa1e5bdddf853621a54f1
Summary: The urlreq.quote returns a byte string, let's use b string to manipulate it.
Reviewed By: farnz
Differential Revision: D19656773
fbshipit-source-id: 1cbcc0f19e9463d5eabec2f67f5b00329188777d
Summary: Reading/writing to files is done via bytes, not strings.
Reviewed By: quark-zju
Differential Revision: D19656321
fbshipit-source-id: 9a9b13b27fc9dd8db6fe757dcd53e4730179832d
Summary: These aren't bytes, they are strings.
Reviewed By: quark-zju
Differential Revision: D19656112
fbshipit-source-id: fcd505e3b4e522154358c80305e39ebca5936395
Summary:
Process the backupstate file as UTF-8. Previously it was being read as raw
bytes, causing the code to think it was an unknown version.
These files contain the version specifier (pure-ASCII), the remote path
(unicode), followed by a list of hexadecimal node IDs (pure-ASCII). Therefore
reading the whole file as UTF-8 should be fine.
Reviewed By: farnz
Differential Revision: D19655547
fbshipit-source-id: 6ca536d445cbf81b19122916f1b70b8895304bdb
Summary:
D19539064 disabled demandimport when using Python 3 as a precaution while we
were initially working on Python 3 support. However, it appears to work
correctly and does not seem to cause obvious problems when enabled.
This re-enables demand import by default. It can be explicitly disabled at
runtime by specifying `HGDEMANDIMPORT=disable` in the environment.
Reviewed By: xavierd, farnz
Differential Revision: D19655548
fbshipit-source-id: d56814049181da2d68abd09ac7ca772b04e06618
Summary:
When used in an `hg status` command the `relpath()` template function would
throw an unhandled `KeyError` when it tried to access `ctx` in the template
mapping. This field is only present in `hg log` templates, and is not present
in `hg status` templates.
This updates the `relpath()` template function to look for `repo` in the
template mapping instead. I also updated the `hg status` code to pass in the
`repo` value now. The `hg log` code already passes in this field.
Reviewed By: quark-zju
Differential Revision: D19568463
fbshipit-source-id: 3e1c1d6571c73e4b24bfce22ea28f57679d39846
Summary:
The sources are opened in byte mode, therefore the regexp needs to be a byte
one.
Reviewed By: singhsrb
Differential Revision: D19655928
fbshipit-source-id: 79b54cc5016dc47aee4fe6cf053f28bf04ba630c
Summary:
Bunch of read/writes to files were using plain strings, use byte strings
instead.
Reviewed By: quark-zju
Differential Revision: D19655101
fbshipit-source-id: 0cb70cbc51630d2c83752846774ff1a1c5ec9f41
Summary: The file is opened in binary mode, we need to write bytes into it.
Reviewed By: quark-zju
Differential Revision: D19655103
fbshipit-source-id: a2d059adff72db6c65e2933b3c64804325e51a71
Summary:
Make it possible to run edenscm via a "python package".
This makes it possible to run monkeytype [1] via debugpyhon:
./hg3 debugpython -- -m monkeytype run edenscm help log --pager=off
[1]: https://github.com/Instagram/MonkeyType
Reviewed By: farnz
Differential Revision: D19655850
fbshipit-source-id: 358f9dcf976141f798af2d57fb6392f2bca6a396
Summary: on file copies instead of contents we were commiting b'contents'
Reviewed By: markbt
Differential Revision: D19656501
fbshipit-source-id: e1cb0bdac79da851494318ce31396a2aca6c5754
Summary:
dott tests rig up a custom stdout/stderr. In Python 3 we expect them to
be strings, so we need to use an appropriate io object.
Unfortunatly upstream already created a pycompat.stringio object which uses
bytes for both python 3 and 2, so I had to use a new name for now.
Reviewed By: quark-zju
Differential Revision: D19653469
fbshipit-source-id: a529df5a2ab179c105fa441c4503ed6606e77543
Summary:
The C implementation of util.dirs doesn't work with Python 3. Instead of trying to port it, write an implementation in Rust that works in both Python 2 and Python 3.
The old implementation had a hack for flat dirstate to omit certain entries. Remove this hack as we now only use flat dirstate in tests and small repos. This simplifies the code in the fastpath case.
Reviewed By: quark-zju
Differential Revision: D19634699
fbshipit-source-id: cbb6562bc9a0209b13f67db3dfa5250800a9fcbe
Summary: `PyPath` is to `PyPathBuf` as `Path` is to `PathBuf` and `str` is to `String`.
Reviewed By: quark-zju
Differential Revision: D19647995
fbshipit-source-id: 841a5f6fea295bc72b00da028ae256ca38578504
Summary:
Fix some common errors when run `run-tests` in Python 3.
shlib would be using `str` for stdin/stdout instead of bytes as most of the code in Python 2 operates with that assumption. Getting it to `bytes` will take some work.
Reviewed By: DurhamG, quark-zju
Differential Revision: D19649475
fbshipit-source-id: 1f0190fce4df9a530246774fd17cdfc2d7974a65
Summary: These are Python 2 style print statements not surfaced during the tests. Mostly because they are used in `hg dbsh` or invoked with Mercurial's Python interrupter. So I did a ripgrep to find these statements and convert them into functions.
Reviewed By: farnz
Differential Revision: D19612968
fbshipit-source-id: 1b07e9c789ab834be692ba00fd58c575bc4a17bf
Summary: With this change `hg rm` works even with extensions enabled. Since this is a Cython extension, I did not bother adding type annotations since IIUC Pyre cannot type check Cython files.
Reviewed By: quark-zju
Differential Revision: D19652178
fbshipit-source-id: 2e03a0f241f80732bdae3f472a1e0576684b1911
Summary: This diff just adds the type hints for `memcommit` extension.
Reviewed By: quark-zju
Differential Revision: D19651074
fbshipit-source-id: 834a5980cded92641e4d368ce00d01a3dcaec330
Summary: We need to encode the key to be able to hash it.
Reviewed By: genevievehelsel
Differential Revision: D19651373
fbshipit-source-id: 214a3d127eb71a1c9cbf4ed1fec4f5a58f7f5195
Summary:
Importing directly from collection is deprecated, we should import from
collections.abc in Python3.
Reviewed By: DurhamG
Differential Revision: D19650852
fbshipit-source-id: b2e470e5fde3fe915944ae68a4274e47ed91071a
Summary:
A previous change requires the default value to be a tuple with 4 values,
fsmonitor was only passing 1.
Reviewed By: kulshrax
Differential Revision: D19652000
fbshipit-source-id: c9ae04109c61173a1df27ce653622dc4db653977
Summary:
Server reads & writes bytes. Convert between bytes and unicode where
neccessary in chgserver. Add some type annotations.
Reviewed By: xavierd
Differential Revision: D19645028
fbshipit-source-id: 1ad4bec25c398422112ee0ed1780ee9d704e6622
Summary:
Writing to the file should happen in bytes, so let's make the
journalentry serializer/deserializer convert from strings to bytes for us.
Reviewed By: xavierd
Differential Revision: D19650468
fbshipit-source-id: 3c13aff032ace1a15611c2370fc7d6ed44a6df34
Summary:
bundle2 parameter values are bytes, so when we compare the treemanifest
category with the bundle2 part category we need to encode the bundle2 part one.
Also fix wirepack to read utf8 paths.
Reviewed By: xavierd
Differential Revision: D19650197
fbshipit-source-id: 67da3bd8244f7953ec608019844988b20ad1929f
Summary: Username as utf8, so let's make mutationmarker treat them as such.
Reviewed By: xavierd
Differential Revision: D19649887
fbshipit-source-id: 3f8b2db434a57ee8ee3017de8d925c19a2002b20
Summary:
The commit context requires commit data to be bytes, but drawdag was using str
for it, breaking tests.
Reviewed By: DurhamG
Differential Revision: D19650219
fbshipit-source-id: 1409ce9a277c1c410ede8109989e07595378ff3e