Commit Graph

2813 Commits

Author SHA1 Message Date
Jun Wu
bd5cfe49b2 commitstore: remove it
Summary:
It only has benchmark code that led to the use of mincode. Now hgcommits is the
main crate for commit storage. `commitstore` without `hg` in its name was
initially planned to support other kinds of commits including git and bonsai.
However we don't have immediate goal for that at present. So let's just remove
the commitstore directory.

Reviewed By: singhsrb

Differential Revision: D24263618

fbshipit-source-id: 84b4861ae490817377e69d8c2006c63331e3db1f
2020-10-12 16:42:58 -07:00
Xavier Deguillard
437031872f fix test-import-t.py take 2
Summary: Whitespaces are needed.

Reviewed By: quark-zju

Differential Revision: D24264452

fbshipit-source-id: a7ecfbe1bba7d14f92d5218f18d55361a3f4319e
2020-10-12 15:43:57 -07:00
Durham Goode
b0e341c311 signals: move signal registering to be behind ui.threaded
Summary:
On the hg servers we're seeing crashes due to signals during syscalls.
Rolling back to prior to the signal changes seems to have fixed it, though we
haven't bisected enough to be sure this is the cause.

The ui.threaded option is already used to opt-out of running on a background
thread, let's also use it to opt-out of the custom signal registering in hopes
that it fixes the server issue, until they can be deprecated.

Reviewed By: quark-zju

Differential Revision: D24254804

fbshipit-source-id: 50e4fc8c7e3a88b5baa49394f6f1edffc946187d
2020-10-12 14:36:47 -07:00
Meyer Jacobs
87cc599161 edenapi: add aux data to FileMetadata and DirectoryMetadata, and recursive children field to TreeEntry
Summary: Need to add new quickcheck tests, verify that remove `Serialize` from `TreeEntry` is okay.

Reviewed By: kulshrax

Differential Revision: D23457777

fbshipit-source-id: aa94ed7aa81b41924eba4a8bd1bdc2c737365b77
2020-10-12 14:05:23 -07:00
Jun Wu
a35f8765c0 lock: print actual lockinfo on error
Summary:
Change

  abort: repository repo: timed out waiting for lock held by <lockinfo ...>

to:

  abort: repository repo: timed out waiting for lock held by process '842210' on host 'hostname'

Reviewed By: singhsrb

Differential Revision: D24214462

fbshipit-source-id: 65056ebb9764651b2f0126061fafdfdefaa4e9c6
2020-10-12 11:22:20 -07:00
Xavier Deguillard
964e0106c9 tests: fix test-import-t.py
Summary: The rev numbers are almost gone, remove them from the test.

Reviewed By: sfilipco

Differential Revision: D24255156

fbshipit-source-id: 5cbc4a71c2d3f773c5b474d1edce84ceceb50bf9
2020-10-12 10:18:45 -07:00
Durham Goode
d10157794d eden: add flush command
Summary:
This will allow Eden to control what data is in Mercurial's memory and
what is on disk. This will let it persist the hg_import_helper process longer,
and prevent slow startup times when needing to restart it.

Reviewed By: xavierd

Differential Revision: D24231131

fbshipit-source-id: a4f743740b44957e8d2dd93f07e9831eadfee7ab
2020-10-09 18:18:00 -07:00
Durham Goode
d4f21a8ec3 atomicfiles: remove fsync from atomic file close
Summary:
This was added in D16078908 (1bc6ecf8fe). It turns out fsync followed by a hardlink
on btrfs results in very slow hardlink performance (100-600ms). Since fewer and
fewer of our files use this atomic write code path and since this affects almost
every hg write command, let's roll this back.

This will increase the chance of data loss during a hard reboot, but commit
cloud is good enough to allow recovering from that in almost every situation.

Reviewed By: sfilipco

Differential Revision: D24230056

fbshipit-source-id: aae1a5612eda5f62bb5ec1442b1312ed45c42786
2020-10-09 16:41:04 -07:00
Jun Wu
e4b677c6e1 remotefilelog: respect invalidatelinkrev store requirement
Summary:
With invalidatelinkrev, linkrev stored in revlog shouldn't be used.
This makes some tests pass with segmented changelog.

Reviewed By: singhsrb

Differential Revision: D24201944

fbshipit-source-id: 6473c30266c79aa97a955b1a6c867411cc67de2b
2020-10-09 13:53:18 -07:00
Jun Wu
7e3dabaab0 context: handle string negative revs with segmented changelog
Summary:
The old code assumes `0..len(repo)` are valid revs, which is no longer true
with segmented changelog.

Reviewed By: singhsrb

Differential Revision: D24201948

fbshipit-source-id: b882a215701c57ccdf4af340c889586b040772da
2020-10-09 13:53:18 -07:00
Jun Wu
2f1c54ae27 clone: copy modern store files
Summary:
Copy segmented changelog, metalog and mutation store for local clones.
This mainly affects tests.

Reviewed By: singhsrb

Differential Revision: D24201941

fbshipit-source-id: c60da9e2bf982a6f66004415e45178749157745e
2020-10-09 13:53:18 -07:00
Jun Wu
631034a2d6 gpg: remove revnum from output
Reviewed By: singhsrb

Differential Revision: D24201943

fbshipit-source-id: 6998ff68ba50480fb7feb4be3b35de1ea4a3ab4a
2020-10-09 13:53:17 -07:00
Jun Wu
3700c832f9 rebase: remove revnum from output
Reviewed By: singhsrb

Differential Revision: D24201945

fbshipit-source-id: 57b8fa1f98625ff186fac76009b1600f22e001bb
2020-10-09 13:53:17 -07:00
Jun Wu
38113e78ee summary: remove revnum from output
Reviewed By: singhsrb

Differential Revision: D24201936

fbshipit-source-id: a864fd1030dd8641ead46d434daadae6d4fca244
2020-10-09 13:53:17 -07:00
Durham Goode
43fe23f09d py3: fix revlog path encodings
Summary: This is needed to move our hg servers to python 3.

Reviewed By: quark-zju

Differential Revision: D24204056

fbshipit-source-id: cbaf97893f8f77b535952ac290766f0fd5e14f0c
2020-10-09 13:31:58 -07:00
Stefan Filip
befcdb1672 tests: fix test-casefolding
Summary: Broken after sweeping changes to remove revnums from tests.

Reviewed By: quark-zju

Differential Revision: D24220976

fbshipit-source-id: bd513b056bf16872ce028c835d680aaa87938917
2020-10-09 10:26:15 -07:00
Arun Kulshreshtha
67aa5455aa edenapi: remove commented out code
Summary: Delete commented out code added in D23455274 (bdff69b747).

Reviewed By: sfilipco

Differential Revision: D24213060

fbshipit-source-id: a017b35241521510c26886505d1de6c7f6538895
2020-10-09 09:35:58 -07:00
Jun Wu
09c28abd20 graft: remove revnum from output
Reviewed By: singhsrb

Differential Revision: D24201937

fbshipit-source-id: bad22b741410ef990a709f77de5f843de7c3b5dc
2020-10-08 22:33:08 -07:00
Jun Wu
ec02fad2c6 bisect: remove revnum from output
Reviewed By: singhsrb

Differential Revision: D24201938

fbshipit-source-id: a6443465feac1ba43962e44a679091f655b24d16
2020-10-08 22:33:08 -07:00
Jun Wu
b01b79cf76 backout: remove revnum from output
Reviewed By: singhsrb

Differential Revision: D24201935

fbshipit-source-id: e1f4a9c9c82f401cc5b5ed9df464a58da64a0b65
2020-10-08 22:33:07 -07:00
Jun Wu
16aa4415c3 template: remove revnum from children template
Reviewed By: singhsrb

Differential Revision: D24201939

fbshipit-source-id: 573da6fbb1577b5e25566d238dccca33235494cd
2020-10-08 22:33:07 -07:00
Jun Wu
aed62002d1 commit: remove revnum from commitstatus
Summary: Do not show revnum or "changeset" after commit (with --debug or --vrebose).

Reviewed By: singhsrb

Differential Revision: D24201942

fbshipit-source-id: 2f0d15711df67070e50d4bf30f0b1b4401d85524
2020-10-08 22:33:07 -07:00
Jun Wu
7c83efd027 revlog: pack non-i32 linkrevs
Summary:
With segmented changelog, linkrev can exceed i32 range and cause "pack" (aka.
bundle) to fail. Workaround it by packing nullrev instead.

~30 tests now pass with segmented changelog with this change.

Reviewed By: singhsrb

Differential Revision: D24201940

fbshipit-source-id: 5f27c185837cd3c1fbe9b65d21ef3cd641eec2e5
2020-10-08 22:33:07 -07:00
Jun Wu
f5988c415c tests: enable segmented changelog for supported tests
Summary: Enable segmented changelog for ~400 tests. They pass without changes.

Reviewed By: singhsrb

Differential Revision: D24201934

fbshipit-source-id: 7972c5548fd8b6b6f49b6bb837433d72a6f6cbd9
2020-10-08 22:33:07 -07:00
Jun Wu
140456fc29 bookmarks: remove revnum from non-plain bookmark output
Summary:
Remove revnum from `hg bookmarks` output.
`HGPLAIN=1` output is not changed for compatibility.

Reviewed By: singhsrb

Differential Revision: D24191788

fbshipit-source-id: 3a873b7baba8f1dfe7b3ec690688313ca1134032
2020-10-08 22:33:07 -07:00
Jun Wu
9b855e9ad9 debugbuilddag: make it compatible with segmented changelog
Summary:
debugbuilddag assumes revs created start from 0, 1, 2..., which is
no longer true with segmented changelog.

Change it to resolve revs using the local `nodeids` array so it's
compatible with segmented changelog.

Reviewed By: singhsrb

Differential Revision: D24191790

fbshipit-source-id: ca7d1cccbba664128c227d66071b166c799cdf49
2020-10-08 22:33:06 -07:00
Jun Wu
88a6d88b90 tests: remove revnum from aliases
Summary: Remove revnum from `showgraph`, `tglog*` aliases.

Reviewed By: singhsrb

Differential Revision: D24191791

fbshipit-source-id: f60c00289a0c6d06101f1c8645fc9d6e0f0c941e
2020-10-08 20:31:41 -07:00
Stefan Filip
794ea888d7 tests: fix test-casecollision-merge.t
Summary:
A previous change updated all tests to remove the use of rev numbers. The
update to the list of results missed this tests case.

Reviewed By: quark-zju

Differential Revision: D24208236

fbshipit-source-id: 289136f31e66eb74b106d7ea9401419fc369d59f
2020-10-08 17:44:13 -07:00
Arun Kulshreshtha
66ea4f6677 edenapi: print operation in debug output
Summary:
Print a message for each EdenAPI method call to stderr if the user has `edenapi.debug` set.

These messages are already logged to `tracing`, but also printing them out when `edenapi.debug` is set makes the debug output more useful, since it provides context for the download stats. This is especially useful when reading through EdenFS logs.

Reviewed By: quark-zju

Differential Revision: D24204381

fbshipit-source-id: 37b47eed8b89438cdf510443e917a5c8660eb43b
2020-10-08 16:12:50 -07:00
Arun Kulshreshtha
e924af7ba5 edenapi: store headers in a HashMap
Summary: Use a `HashMap` to store user-specified additional HTTP headers. This allows headers to be set in multiple places (whereas previously, setting new headers would replace all previously set headers).

Reviewed By: quark-zju

Differential Revision: D24200833

fbshipit-source-id: 93147cf334a849c4d2fc4f29849018a4c7565143
2020-10-08 16:12:50 -07:00
Jun Wu
9ed54f1b94 dag: replace 2 panics with non-panic errors
Summary: The panics can happen when the input sets are out of range.

Reviewed By: kulshrax

Differential Revision: D24191789

fbshipit-source-id: efbcbd7f6f69bd262aa979afa4f44acf9681d11e
2020-10-08 13:22:10 -07:00
Jun Wu
83c996cf95 amend: remove revnum from UX
Summary: Change fold and metaedit to not show revnum in editor message.

Reviewed By: kulshrax

Differential Revision: D24191787

fbshipit-source-id: 140ec58c8eb00c067c6e40e1a18187f7801246e9
2020-10-08 13:22:10 -07:00
Jun Wu
026bd9f950 tests: avoid some rev numbers in revsets
Summary: Done by the fix-revnum.py script.

Reviewed By: singhsrb

Differential Revision: D24173575

fbshipit-source-id: e4cf417be759f9898adfd4102984098474ab38a2
2020-10-08 11:08:37 -07:00
Stefan Filip
6e2ec8b1ca dag: add serde derives to IdDag and InProcessStore
Summary:
Some sort of serialization for the Dag is useful for saving the IdDag produced
by offline jobs load that when a mononoke server starts.

Reviewed By: quark-zju

Differential Revision: D24096964

fbshipit-source-id: 5fac40f9c10a5815fbf5dc5e2d9855cd7ec88973
2020-10-08 09:43:46 -07:00
Durham Goode
8efe07f5b1 bookmarks: don't invalidate filecache during bookmark construction
Summary:
We're seeing an issue on the hg servers where the filecache assertion
that if a value is in obj.__dict__ it's also in obj._filecache is broken. This
occurred about 10% of the time in sandcastle jobs. The diff that caused this
went in in April (D21148446 (73c5cb89de)), so it's unclear why it's only cropping up now.

This is caused by the following steps:

1. repo._bookmarks is accessed while _bookmarks is in the _filecache but not in
the __dict__
2. This causes construction of _bookmarks, before it can set it to __dict__
3. Construction of _bookmarks calls repo.invalidate(clearfilecache=True), which
deletes _bookmarks from _filecache.
4. _bookmarks construction completes, and gets set to __dict__ (but now it's
missing from _filecache, so the invariant will fail next time someone checks).
5. Someone accesses _bookmarks later, and the assertion fires.

The fix is to just not clear the filecache during bookmark construction. The
main purpose of this invalidate was to let the changelog be reloaded, and I
think that will still happen since, if there are any new commits in the
changelog, the file size and time will change, triggering a reload next time the
_filecache entry is checked.

Reviewed By: quark-zju

Differential Revision: D24182914

fbshipit-source-id: fb49137e28d9224c6617d9c84faaf2f9de363aaf
2020-10-07 23:07:36 -07:00
Jun Wu
1ce0eea5dc tests: remove some uses of rev numbers in templates
Summary: Done by `sed`.

Reviewed By: singhsrb

Differential Revision: D24173576

fbshipit-source-id: f1d042b3da7f9b64e0e40b19317364e5cb9ae946
2020-10-07 21:22:58 -07:00
Durham Goode
ce9c900c76 py3: fix line buffer warning during prompts
Summary:
Our stdin/stdout bytes/str manipulations caused input() to print
warnings about buffered not being supported. The only reason we do those
manipulations to handle the case in tests where the prompt answer doesn't come
from stdin, so let's just handle that case via readline instead of prompt.

This is what upstream Mercurial does.

Reviewed By: quark-zju

Differential Revision: D24122909

fbshipit-source-id: ab9d989a66d39990b688c65a1fae80bd48b0f42e
2020-10-06 20:14:56 -07:00
Meyer Jacobs
6421dca639 read_res: add --debug flag to cat command for printing entire message
Summary: Add `--debug` flag to `read_res cat` command for debug printing entire entry rather than just the data blob.

Reviewed By: kulshrax

Differential Revision: D23999804

fbshipit-source-id: 6955854edab2643cffbe5fae484a398716b48055
2020-10-06 19:22:14 -07:00
Jun Wu
ffd7707d3d changelog2: initial support for hybrid commits backend
Summary:
Initial support for a backend using edeanpi.

Note this is just the first step. Most code paths are not updated to the
streaming API to get commit data, so they will error out with commit not found
errors.

Confirm that commit data can be fetched via edenapi:

  $ RUST_LOG=debug lhg dbsh --config experimental.lazy-commit-data=1
  In [1]: master= repo['master'].node()

  In [3]: cl.inner.getcommitrawtext(master) is None
  Out[3]: True

  In [4]: s=cl.inner.streamcommitrawtext(repo.nodes('master~10::master'))
  In [5]: it=iter(s)
  ...
  [2020-09-25T02:09:16.793Z DEBUG hgcommits::hybrid] >> resolve_remote input=[e6c4e203b66f1416e08dc597a2d63b91e93b1466, bfb610989e9dd701e785b4a3a5998e76d9709cab, 68bbfc79602a153895b761089e9479dd8fa33351, 5366fe39ad538463abae6c648eb5150bbb79d4c7, 5ea45d8ab0f8203837ca1736f36ded4a492571b4, 722da0a32eae12de5e85078beea2ae4b7aafe4a4, 4dbe3eab10d13b30697e1762eb7b9ff3ad0cf630, 430ae91aab8028b6572ccef89f8396dafec622c4, 5abd96c5420f0d512c63e768f8cea83f1c6691c9, c84ab3412cebfade730e95a1bc5ebc9b1dd0747b, 790ed2d40e4a0b08fb22fe9b4246fec0165f8a87]
  [2020-09-25T02:09:16.793Z DEBUG hgcommits::hybrid] << resolve_remote input=[e6c4e203b66f1416e08dc597a2d63b91e93b1466, bfb610989e9dd701e785b4a3a5998e76d9709cab, 68bbfc79602a153895b761089e9479dd8fa33351, 5366fe39ad538463abae6c648eb5150bbb79d4c7, 5ea45d8ab0f8203837ca1736f36ded4a492571b4, 722da0a32eae12de5e85078beea2ae4b7aafe4a4, 4dbe3eab10d13b30697e1762eb7b9ff3ad0cf630, 430ae91aab8028b6572ccef89f8396dafec622c4, 5abd96c5420f0d512c63e768f8cea83f1c6691c9, c84ab3412cebfade730e95a1bc5ebc9b1dd0747b, 790ed2d40e4a0b08fb22fe9b4246fec0165f8a87]
  ...
  [2020-09-25T02:09:16.958Z DEBUG zstore::zstore] >> Zstore::contains id=3422a85c3703dd0bf0030d5d4c1bb65775adff90
  [2020-09-25T02:09:16.958Z DEBUG zstore::zstore] << Zstore::contains id=3422a85c3703dd0bf0030d5d4c1bb65775adff90
  [2020-09-25T02:09:16.958Z DEBUG zstore::zstore] >> Zstore::insert data_len=1010 id=3422a85c3703dd0bf0030d5d4c1bb65775adff90
  [2020-09-25T02:09:16.958Z DEBUG zstore::zstore] << Zstore::insert data_len=1010 id=3422a85c3703dd0bf0030d5d4c1bb65775adff90
  ...
  [2020-09-25T02:09:16.959Z INFO  zstore::zstore] >> Zstore::flush
  [2020-09-25T02:09:16.959Z DEBUG indexedlog::log] >> Log::sync dirty_bytes=7048
  [2020-09-25T02:09:16.959Z DEBUG indexedlog::log] << Log::sync dirty_bytes=7048
  [2020-09-25T02:09:16.959Z INFO  zstore::zstore] << Zstore::flush

  In [6]: list(it)
  Out[6]: [...]

The logs about `hgcommits::hybrid ... resolve_remote` shows the remote fetching
is working.  The logs about `Zstore::insert` and `Zstore::flush` shows the
commit data were written to disk.

Reviewed By: sfilipco

Differential Revision: D23924148

fbshipit-source-id: a3d77999e29395ce5c603fe66412936947456534
2020-10-06 19:13:03 -07:00
Jun Wu
8dfd6c26ea pydag: support hybrid commits backend
Summary:
Support constructing the "hybrid" commits backend, which is similar to
"doublewrite" but read commit text from edenapi via the `streamcommitrawtext`
method.

Reviewed By: sfilipco

Differential Revision: D23924149

fbshipit-source-id: cb15ee4be7953af7798d460557ba2ae2d4f24a52
2020-10-06 19:13:03 -07:00
Jun Wu
d103af79df hgcommits: add hybrid backend
Summary:
The hybrid backend is similar to the doublewrite backend, except that it does
not use revlog to read commit data, but uses EdenAPI instead.

Note:
- The non-stream API will not fetch commit data from EdenAPI.
- The commit hashes are not lazy yet.

Reviewed By: sfilipco

Differential Revision: D23924147

fbshipit-source-id: eb2cf8d3a7e1704b4efb13ad3ad86f8b6a1b31d0
2020-10-06 19:13:02 -07:00
Jun Wu
9741de4136 pydag: expose API to read commit text using streams
Summary:
This can be used like:

  In [1]: s=cl.inner.streamcommitrawtext(repo.nodes('.%%master'))  # repo.nodes returns a generator, becomes stream

  In [2]: s
  Out[2]: <stream at 0x7f5eec742df0>

  In [3]: list(s)
  Out[3]: [{'vertex': ..., 'raw_text': ...}, ...]

  In [4]: s.typename()
  Out[4]: 'cpython_ext::convert::Serde<hgcommits::ParentlessHgCommit>'

Reviewed By: sfilipco

Differential Revision: D23911870

fbshipit-source-id: f54959a551d446ed5b8086a2235fe74e47b29e70
2020-10-06 19:13:02 -07:00
Jun Wu
f54efdd04a hgcommits: serde serialize on ParentlessHgCommit
Summary:
This makes it convertible to `PyObject` via `cpython_ext::convert::Serde`
without additional code or dependencies.

Reviewed By: sfilipco

Differential Revision: D23966993

fbshipit-source-id: 74d83524a7c0701cde7aa6d61bb930ff4a1c90f5
2020-10-06 19:13:02 -07:00
Jun Wu
80056bef23 hgcommits: add a streaming data fetching API
Summary:
This API allows us to stream the data. If callsites only use this API, we'll
be more confident that there are no 1-by-1 fetches.

Reviewed By: sfilipco

Differential Revision: D23911865

fbshipit-source-id: 4c7dd8c2b5be33be5a55822845d55345797bacdf
2020-10-06 19:13:02 -07:00
Jun Wu
6defe87dcb streams: add abstraction about downloading missing data from remote
Summary:
The API is basically to resolve `input_stream` to `output_stream`, with a
stateful "resolver" that can resolve locally and remotely.

Reviewed By: sfilipco

Differential Revision: D23915775

fbshipit-source-id: 14a3a37fc897c8229514acac5c91c7e46b270896
2020-10-06 19:13:02 -07:00
Meyer Jacobs
bdff69b747 edenapi: Add file, directory metadata to TreeEntry
Summary:
Introduce `FileMetadata` and `DirectoryMetadata` to `Treeentry`, along with corresponding request API.

Move `metadata.flags` to `file_metadata.revisionstore_flags`, as it is never populated for trees. Do not use `metadata.size` on the wire, as it is never currently populated.

Leaving `DirectoryMetadata` commented out temporarily because serde round trips fail for unit struct. Re-introduced with fields in the next change in this stack.

Reviewed By: DurhamG

Differential Revision: D23455274

fbshipit-source-id: 57f440d5167f0b09eef2ea925484c84f739781e2
2020-10-06 18:36:28 -07:00
Arun Kulshreshtha
7576d60c9c edenapi: skip hash check for LFS files
Summary:
EdenAPI always checks the integrity of filenode hashes before returning file data to the application. In the case of LFS files, this resulted in errors because the filenode hash is computed using the full file content, but the blob from the server only contains an LFS pointer.

Fix the bug by exempting LFS blobs from filenode integrity checks. (If integrity checks for LFS blobs are desired, the LFS code should be able to do this on its own since LFS blobs are content-addressed.)

Reviewed By: quark-zju

Differential Revision: D24145027

fbshipit-source-id: d7d86e2b912f267eba4120d1f5186908c3f4e9e3
2020-10-06 16:18:28 -07:00
Jun Wu
ee82a84a29 pyedenapi: use serde serialization to simplify type conversion
Summary:
`cpython_ext` provides utilities to implement From/ToPyObject directly for
serde types. Lets' use it to simplify the code and set up an example.

debugshell:

  In [2]: s,f=api.commitdata(repo.name, list(repo.nodes('master')))

  In [3]: list(s)
  Out[3]:
  [{'hgid': (7, 61, 22, ...), 'revlog_data': '...'}]

Note: `HgId` serialization should probably be changed to use `serde_bytes` somehow
so it does not translate to a Python tuple. That will be fixed later.

Reviewed By: kulshrax

Differential Revision: D23966987

fbshipit-source-id: 9278ccae6f543c387eafe401d4ef8d6ce96d370f
2020-10-06 16:01:23 -07:00
Jun Wu
47d5813a17 cpython-ext: add a general From/ToPyObject for serde types
Summary:
This can be used to automate Python/Rust conversions for complex structures
like `CommitRevlogData`.

Reviewed By: kulshrax

Differential Revision: D23966988

fbshipit-source-id: 17a19d38270e6ef0952c13a1cd778487e84a94ff
2020-10-06 16:01:23 -07:00
Jun Wu
b5a22da53c cpython-ext: add a serde deserializer that converts Python objects to Rust values
Summary:
The goal is to implement `FromPyObject` and `ToPyObject` more easily.
Today crates have to dependent on `cpython` to implement `From/ToPyObject`,
which is somewhat unwanted for pure Rust crates.

The `ser` module used to ignore the `variant` field for non-unit enum variants.
They have been fixed so the serialized value can be deserialized correctly.
For example, `enum E { A, B(T) }` will be serialized to `"A"` for `E::A`, and
`{"B": T}` for `E::B`.

Reviewed By: kulshrax

Differential Revision: D23966994

fbshipit-source-id: c50d57bf313caeec65a604ed9b05a5729f3b3635
2020-10-06 16:01:22 -07:00