Commit Graph

60929 Commits

Author SHA1 Message Date
Mateusz Kwapich
b178c03a4a use references instead of clones
Summary: Let's use more references when we can

Reviewed By: krallin

Differential Revision: D24161694

fbshipit-source-id: 5cf7edf843fa8dcf0d24ca114c3d520263d92a3b
2020-10-08 05:38:01 -07:00
Mateusz Kwapich
42a783999d enable single process to work on multiple repos.
Summary:
This change enables the filler job to work on all repos available instead of a
single one. We are still going to be able to dedicate the job to a certain repo
(by crafting a config with a single repo enabled) but we can put the entire
long tail for low-traffic repos under a single job.

This requires D24110335 to land in configerator to work.

Reviewed By: krallin

Differential Revision: D24136239

fbshipit-source-id: 4b77d1667c37cc55f11c3087b02a09dbae29db0f
2020-10-08 05:38:01 -07:00
Kostia Balytskyi
c02ee1b1d1 hooks: allow deletion of any files in no_insecure_filenames
Reviewed By: StanislavGlebik

Differential Revision: D24190517

fbshipit-source-id: d26a144596f0bd316a9e6b1e7000efc31b93d049
2020-10-08 05:03:37 -07:00
Alex Hornby
9756def014 mononoke: implement BlobstorePutOps for sqlblob
Summary: Implement BlobstorePutOps for sqlblob

Differential Revision: D24021172

fbshipit-source-id: be24bc0d58263e190fdca546a3adf9b5815b3c4b
2020-10-08 04:59:11 -07:00
svcscm
d30aa0c265 Updating submodules
Summary:
GitHub commits:

921800d679

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 99403abe08b76596ddc629bf97dd654a8d89134a
2020-10-08 04:59:11 -07:00
Stanislau Hlebik
8f8345881d mononoke: allow optional bookmark in sync_commit_and_ancestors
Summary: Allow bookmark to be optional - again, will be used in the next diffs

Reviewed By: ahornby

Differential Revision: D24163608

fbshipit-source-id: e037731117181d0b1bbe4eb273301245142b507d
2020-10-08 03:48:54 -07:00
Stanislau Hlebik
6f9825eb69 mononoke: extract functionality to sync commit and ancestors from x_repo_sync_job
Summary: This functionality will be used in the next diffs.

Reviewed By: ahornby

Differential Revision: D24163517

fbshipit-source-id: 36e5c9646e21913f0e0d79d77dd11862f5aa5331
2020-10-08 03:48:54 -07:00
Kostia Balytskyi
dd64e842c3 cross_repo_sync: use parent config version when syncing merges
Summary:
This diff fixes how syncing of merge commits decides on the `CommitSyncConfigVersion` to use. Old and incorrect behavior just always uses current version from `LiveCommitSyncConfig`. The desired behavior is to reuse the version with which parent commits are synced, and manually sync commits when version changes are needed.

For merges it is more interesting, as merges have multiple parents. The overarching idea is to force all of the parents to have the same version and bail a merge if this is not the case. However, that is an ideal, and we are not there yet, because:
- there are `NotSyncCandidate` parents, which can (and should at the moment) be safely excluded from the list of parents of the synced commit.
- there are `Preserved` parents (which will turn into the ones synced with a `noop` version)
- there are `RewrittenAs` and `EquivalentWorkingCopy` parents, which don't have an associated version.

So until the problems above are solved:
- absent `RewrittenAs`/`EquivalentWorkingCopy` versions are replaced with the current version
- `Preserved` merge parents cause merge sync to fail.

Reviewed By: StanislavGlebik

Differential Revision: D24033905

fbshipit-source-id: c1c98b3e7097513af980b5a9f00cc62d248fc03b
2020-10-08 02:43:19 -07:00
Kostia Balytskyi
2035a34a0e commit_rewriting: do not create accidental Preserved syncs
Summary:
Our higher-level goal is to get rid of `CommitSyncOutcome::Preserved` altogether. This diff is a step in that direction. Specifically, this diff removes the creation of "accidental" Preserved commits: the ones where the hashes are identical, although a `Mover` of some version have been applied. There are a few sides to this fix:
- `get_commit_sync_outcome` now returns `Preserved` only when the source and target hashes are identical, plus stored version is `None` (previously it would only look at hashes).
- `sync_commit_no_parents` now records the `Mover` version it used to rewrite the commit (previously it did not, which would sometimes create `Preserved` roots)
- there are now just two ways to sync commits as `Preserved`:
  - `unsafe_preserve_commit` (when the caller explicitly asks for it). The idea is to only remove it once we remove the callers of this methods, of course.
  - `sync_commit_single_parent` when the parent is also `Preserved`. Note that automatically upgrading from `Preserved` parent to a rewritten changeset is incorrect for now: `Preserved` does not have an associated version by definition, so we would have to use a current version, which may corrupt the repo. Once we get rid of `Preserved`, this case will naturally go away.
- as we now have `update_mapping_with_version` and `update_mapping` (which consumes current version), we need to add explicit `update_mapping_no_version` for preserved commits we are still creating (again, recording a current version is a mistake here, same reason as above)

NB: I've added/changed a bunch of `println`s in tests, leaving them here, as they are genuinely useful IMO and not harmful.

Reviewed By: StanislavGlebik

Differential Revision: D24142837

fbshipit-source-id: 2153d3c5cc406b3410eadbdfca370f79d01471f9
2020-10-08 02:43:19 -07:00
Chad Austin
b63beee959 avoid cleanly tearing down objects under KeyboardInterrupt
Summary:
There's a bug in Thrift-py3 streaming support, where interrupting
iterating over an async stream leaves Thrift objects in a broken
state. Futures get dropped (and warnings are printed to the console)
but the destructors hang. Don't even try to garbage collect the heap
in that case.

Reviewed By: genevievehelsel

Differential Revision: D24032229

fbshipit-source-id: 5f16667fe6cfd27de1b39cc2974028729e18b214
2020-10-07 23:36:40 -07:00
Chad Austin
3d16771b68 give new thrift client access to streaming APIs
Summary: Thrift-py3 supports streaming, so give the new client access to APIs from streamingeden.thrift.

Reviewed By: wez

Differential Revision: D24032144

fbshipit-source-id: 44f350b5cfa943154084b8d64f6c696e315e6b88
2020-10-07 23:36:40 -07:00
Chad Austin
8c074fac83 fix subscribeStreamTemporary signature
Summary: Eden mounts are identified by paths, not by strings, so fix the Thrift signature.

Reviewed By: wez

Differential Revision: D23774513

fbshipit-source-id: c0fb82c48eee5ce4e8fbffef5623f9016ef76e40
2020-10-07 23:36:40 -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
Chad Austin
f663d81b6a use TraceBus in FuseChannel
Summary: Migrate FuseChannel outstanding request tracking to the TraceBus's background thread.

Reviewed By: kmancini

Differential Revision: D23773955

fbshipit-source-id: 5137437e6526cf4e995f60144e5ecbe392245719
2020-10-07 22:23: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
svcscm
c558d62e1a Updating submodules
Summary:
GitHub commits:

02629208f9
65edc19cd4

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 676d168ccaadf7d8a690d82188489e03422fc2e1
2020-10-07 21:22:58 -07:00
svcscm
b87b2ff30b Updating submodules
Summary:
GitHub commits:

ad46f38199
1f84611e5d
a58e9881c3
34ed4d9542

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: a4b6d0f799b3ccb073496cd5536868b14713fa65
2020-10-07 19:08:34 -07:00
Katie Mancini
b2f1773e4e CLI to prefetch profiles
Summary:
Adds a subcommand to `eden debug prefetch_profile` to fetch all the files
for a list of profiles or all the active profiles for a checkout.

These profiles (files) can contain lists of file names, or globs of files, eden
will be able to resolve them since this uses the existing prefetch code.

I opted to put this command under `eden debug prefetch_profile` instead
of `eden prefetch` since the command may change to call into eden with out
the list of files (letting eden resolve the active profiles and names). Then
it will no longer resemble prefetch and so long term it may be better homed
here.

Reviewed By: genevievehelsel

Differential Revision: D23771483

fbshipit-source-id: 12af81d40cc495efd381e3c3a2df645d72053ccd
2020-10-07 18:37:25 -07:00
svcscm
588a4dec29 Updating submodules
Summary:
GitHub commits:

4994669a4c
b2e8ddd0cf
2d1783a9d5
c03ff62380
fb6f6bf443
79754e91b4
daef21e319
2b8ad08415
6e2ea948b9
4e3ea55e06
2d1d349b07
c895f3c396
8cc3114733

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 4253c9fd7be174b8690af2fb291cc57384f05681
2020-10-07 15:43:58 -07:00
Chad Austin
9af61f3b7b light journal refactoring and comment improvements
Summary:
Before I make further changes to the Journal, improve the comments and
refactor a few small things.

Reviewed By: kmancini

Differential Revision: D24089530

fbshipit-source-id: de9da2c1e6b1c87b6587781cfa55ae7cc4085eeb
2020-10-07 14:15:34 -07:00
svcscm
eac47d780f Updating submodules
Summary:
GitHub commits:

ee68399337
e2a0e6b37a
ee156bf8e4
59aad4e9df
b2a1a6d031
38d0a365e3
3a18045569
36e9edbaf0
44c1639927
591aa9df29
f8480b930e
f91e220753
ae310febe8

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 3b89e930f74b1c907dbea42ba836f2524c4dabb9
2020-10-07 14:02:11 -07:00
Chad Austin
1703d6834d break dependency on ServiceFrameworkLight
Summary:
Scanning through the functionality provided in ServiceFrameworkLight,
it looks like none of it really applies to the edenfs daemon, so break
the dependency entirely. Removing this complexity would have prevented
the regression where we stopped recording Thrift call statistics.

This should also improve our build times a bit, and maybe resource
consumption.

Reviewed By: genevievehelsel

Differential Revision: D24094784

fbshipit-source-id: fefd1a648c7ecba8484296527ff8100269c176b6
2020-10-07 13:42:36 -07:00
Xiaoting Tang
81151580b4 Use a beta version of libbpf to unblock perf_buffer__buffer API
Summary: It turns out that perf_buffer API is only available in libbpf 0.2.0, which hasn't been released yet. To unblock katran, I grabbed the latest libbpf revision and created a temporary manifest. To avoid relying on this "beta" version libbpf on other projects only katran uses it. I'll make sure to remove it in favor of the official libbpf 0.2.0 once it's released.

Reviewed By: anakryiko

Differential Revision: D24156655

fbshipit-source-id: 32f6e04079a862fbfe96fd5475678cfa4ae1b3db
2020-10-07 12:35:41 -07:00
Alex Hornby
4e772d07d5 mononoke: implement BlobstorePutOps for S3Blob
Summary:
Implement BlobstorePutOps for S3Blob.  This uses is_present to check the various put behaviours

While implementing this I noticed get_sharded_key could be updated to take a reference, so I did that as well.

Differential Revision: D24079253

fbshipit-source-id: 16e194076dbdb4da8a7a9b779e0bd5fb60f550a6
2020-10-07 12:11:11 -07:00
Alex Hornby
cac5350f5f mononoke: add test for blobstore OverwriteStatus
Summary: Now that fileblob and memblob support put behaviour logic, update the overwrite test to check the overwrite result.

Differential Revision: D24021167

fbshipit-source-id: d9578630205cf5d79999a459cc29481968d5717d
2020-10-07 12:11:10 -07:00
Alex Hornby
cad15511f8 mononoke: update memblob to be PutBehaviour aware
Summary: Update memblob to be PutBehaviour aware by changing implementation from Blobstore to BlobstoreOps

Differential Revision: D24021166

fbshipit-source-id: 04dd25c5535769ea507120c1886592b808a7bbc6
2020-10-07 12:11:10 -07:00
Alex Hornby
fb1d4515df mononoke: update Memblob::new callsites to ::default()
Summary: Update Memblob::new callsites to ::default() in preparation for adding arguments to ::new() to specify the put behaviour desired

Differential Revision: D24021173

fbshipit-source-id: 07bf4e6c576ba85c9fa0374d5aac57a533132448
2020-10-07 12:11:10 -07:00
Alex Hornby
9c9401f691 mononoke: add put behaviour handling to fileblob
Summary: Add put behaviour handling to fileblob so that it can prevent overwrites if requested.

Differential Revision: D23933228

fbshipit-source-id: 8e74ac96b232be841174f6ad2bd2fccf92aaa90d
2020-10-07 12:11:10 -07:00
Alex Hornby
2abe862535 mononoke: add put behaviour to BlobstoreOptions
Summary:
Add put behaviour to BlobstoreOptions in preparation for passing in the put behaviour through blobstore_factory.

Later in the stack a command line option is added to set this non-None so that we can turn on overwrite logging for particular jobs.

Reviewed By: StanislavGlebik

Differential Revision: D24021169

fbshipit-source-id: 5692e2d3912ebde07b0d7bcce54b79df188a9f16
2020-10-07 12:11:10 -07:00
Chad Austin
ee70e76512 add a TraceBus
Summary: Add a reliable, lightweight TraceBus class for publishing events to a background thread. Subscribers can be registered for observing events or computing telemetry about them.

Reviewed By: wez

Differential Revision: D23404525

fbshipit-source-id: 3539466421b0821ffb918ea862168d3cccd19b15
2020-10-07 12:07:37 -07:00
svcscm
7e548a6bcc Updating submodules
Summary:
GitHub commits:

a02d3acad3
f893516a07
11df260700
b80fb1011d

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: e083d3e1a0930867c6c34ab7f085aa20c59b8017
2020-10-07 12:07:37 -07:00
svcscm
bcd8e4ba5b Updating submodules
Summary:
GitHub commits:

e98fd2d467
dbe7e82971
e488faed8a
8163084053
552cc97ed0
3b515a8f60
967accd2e6
5625c46279
7935be36e5
5851147ea5
d583f61932
0339667215
75edb39e6c

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: d9d70eb880538e76304f0c1c5fc9222e97347a54
2020-10-07 10:49:54 -07:00
Genevieve Helsel
8b509ff683 remove usage of sh -c in eden rage
Summary: To be more Windows compatable, we should move away from using `sh -c`. We don't use shell=True because that is susceptible to shell injection. As long as we don't close stdin until we're done, using Popen raw should be fine.

Reviewed By: xavierd

Differential Revision: D24151425

fbshipit-source-id: c0bcc883af948491862e8ce0cee56bcbe98e04f1
2020-10-07 10:25:53 -07:00
Arun Kulshreshtha
5b8a25acd7 edenapi_server: log client username to scuba
Summary: Add a new "user" column to the EdenAPI server's Scuba data.

Reviewed By: krallin

Differential Revision: D24153765

fbshipit-source-id: 95a3177d9283e5b0e3f47e7f42a1de5142049b99
2020-10-07 08:17:59 -07:00
Arun Kulshreshtha
6cc6ee822f gotham_ext: add method to get username from client identity
Summary: Add a method to get the client's username from a client identity. This is helpful for logging, etc.

Reviewed By: krallin

Differential Revision: D24153766

fbshipit-source-id: 2ecf85e5de72918aeb292ce88539a991da4de900
2020-10-07 08:17:59 -07:00
Mark Thomas
5fa06fc3f1 scs_server: add pushvar support
Summary: Allow source control service clients to set pushvars.

Reviewed By: krallin

Differential Revision: D24136870

fbshipit-source-id: 34f9176ec66ca319b363c91015dae9b59a55a244
2020-10-07 07:09:40 -07:00
Mark Thomas
78f07af0ef bookmarks_movement: add pushvars for delete_bookmark
Summary:
Add the possibilty of setting `pushvars` when deleting bookmarks.  This makes
it consistent with the  other write operations.

Reviewed By: krallin

Differential Revision: D24136869

fbshipit-source-id: f98b74c6c731e50552184000ad697d04748711fd
2020-10-07 07:09:39 -07:00
Stanislau Hlebik
96d3514290 mononoke: read mutable_counters from replica in blobimport warmer
Summary:
Previously all mutable_counters reads were going to leader. This might be
useful for some cases, but in the case of blobimport warmer this opens too
many connections to sql leader.

Let's read from replica instead

Reviewed By: krallin

Differential Revision: D24160315

fbshipit-source-id: 0cecde3c54a00bbea215a1e0fa63d4a7c3dc9eaa
2020-10-07 05:24:30 -07:00
Mateusz Kwapich
2aa73b8a0b migrate sync_bookmark to new-style futures
Reviewed By: liubov-dmitrieva

Differential Revision: D24017535

fbshipit-source-id: 8d9abb13769f97eea57a7a1641e086dc518f863c
2020-10-07 05:08:40 -07:00
Mateusz Kwapich
a1fa3eb768 migrate sql_replay_bookmarks_queue module to new-style futures
Reviewed By: farnz

Differential Revision: D24017536

fbshipit-source-id: b4703d150cdcedd69c7c3b7ec77f72fe527f572f
2020-10-07 05:08:39 -07:00
Mateusz Kwapich
f95e933479 migrate replay_stream module to new-style futures
Reviewed By: farnz

Differential Revision: D24016055

fbshipit-source-id: 2b84bbe5eb7055df2b9fc7a1c38ed0b16db50a04
2020-10-07 05:08:39 -07:00
Thomas Orozco
3e6a3a02be mononoke: fix broken edenapi-server-trees.t
Summary:
This seems to have broken as a result of a land race between D23999804 (6421dca639) and
D23455274 (bdff69b747). Let's fix it.

Reviewed By: ikostia

Differential Revision: D24158809

fbshipit-source-id: 1d733e2c93eb8a0803395d409fbb15e2e2146bdd
2020-10-07 03:49:57 -07:00
Pavel Aslanov
daa5a0409a add variant of bounded_traversal_stream which accepts children in the form of a stream
Summary: Adds version of `bounded_traversal_stream` where unfold returns a stream over children instead of an iterator. This function also applies back pressure on children iteration when we have too many unscheduled items.

Reviewed By: krallin

Differential Revision: D23931035

fbshipit-source-id: 2e2806653782d4e646dcdf4b2d4e624fd6543da8
2020-10-07 03:38:28 -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