Summary:
Reenables dynamicconfig loading with eden backingstore. Previously it
broke edenfs-windows-release, but we believe the
opensource/fbcode_builder/manifests/eden tweak has fixed it.
Reviewed By: xavierd
Differential Revision: D29561192
fbshipit-source-id: 775dd21d177f3baa09b0192e7d3f7231008c3766
Summary: The `repo` weakref might be invalid after `__del__`. Check before using it.
Reviewed By: DurhamG, singhsrb
Differential Revision: D29565718
fbshipit-source-id: 54c86414cd80db0d10a3966ed4e677b31ddcd906
Summary:
cpython-ext is not part of hg business APIs. It does not need to be consistent
with lower-case class name (and hg codebase is okay with non-lowercase class names,
just that most classes there are lower-case).
This resolves a rustc warning about the struct name.
Reviewed By: kulshrax
Differential Revision: D29526579
fbshipit-source-id: a4bc8e788d55c65aae9eaa87e2c684c2fded7ae2
Summary:
With segmented changelog, this `if head not in repo` check goes and queries
the server to know if this exists. That's slow:
https://fb.workplace.com/groups/corehg/permalink/880425025886062/
This should hopefully fix it.
Reviewed By: quark-zju
Differential Revision: D29550877
fbshipit-source-id: f874fea3f42e1bde0acd4146bcfede4854b585f1
Summary: The use case here is that we can export rust struct into python object, manipulate python object and then convert it back into rust struct
Reviewed By: quark-zju
Differential Revision: D29525281
fbshipit-source-id: 393c8a430a76c720c155432d732085892d56521a
Summary:
Previously Serde<T> required T to implement bunch of traits like Eq, Clone etc
This diff lifts this restriction and only implements those traits for Serde if T implements them, but does not require them
Reviewed By: quark-zju
Differential Revision: D29521112
fbshipit-source-id: e9387b08ab129fc1f2450f6c88fa7fe0f6451349
Summary: Use the bookmarks and commitknown edenapi methods in the setdiscovery process.
Reviewed By: kulshrax
Differential Revision: D29305605
fbshipit-source-id: efbac229e37870f95e0c04c5db275e6e4c8239ac
Summary: Fix two bugs in the eagerpeer pushkey implemention for the case where the bookmark has an existing value. The existing bookmark is already in hex form and errors on conversion. The new bookmark should be set when the new bookmark doesn't match the existing bookmark.
Reviewed By: quark-zju
Differential Revision: D29305606
fbshipit-source-id: 79ec6432d2fe7709f51f5cc508a39238ce446e23
Summary:
Mercurial is already pulling the remote commit for the "local changes" indicator in `hg ssl`.
I'd like to more easily access this remote commit from CLI.
After this change I can run something like `hg ssl -T '{phabcommit}` to get the remote commit and diff locally against it.
I'm very open to changes about the naming / anything else
Reviewed By: DurhamG
Differential Revision: D29482374
fbshipit-source-id: b01fd0186a1f3a999f388edf140b089c89be7bf6
Summary:
We currently encode/decode data when passing it between pull_fast_forward_master and importpulldata and some other cases
pycell is alternative to that, allowing to just transfer pointer, instead of encoding data
Reviewed By: quark-zju
Differential Revision: D29474444
fbshipit-source-id: aabbbb670fde08645031c199afbdeab5cc9093d8
Summary:
Since we pass edenapi to the contentstore, it should be doing the http
fetching internally. Let's get rid of the http fetching from the python logic
then.
Once we're 100% on edenapi, this will let us just delete the remotetreestore
entirely.
Reviewed By: quark-zju
Differential Revision: D29167443
fbshipit-source-id: fe1c4d7aae38135bdebf41a39c8beec34153e60e
Summary:
Previously the fetch path could go from repo.prefetchtrees down to
rust datastore.prefetch then back to python remotetreestore.prefetch then over
to repo._getdesignatednodes. This was loopy and very poor layering.
Let's move the tree fetching logic down into remotetreestore so at least we're
not circling back to the repo object.
Reviewed By: quark-zju
Differential Revision: D29167397
fbshipit-source-id: 0260640367c6fa3365b5756c738ddc234df593f5
Summary:
These are no longer used. This may let us get rid of the complete trees
edenapi endpoint.
Reviewed By: quark-zju
Differential Revision: D29148506
fbshipit-source-id: 36e8b76228d2f741cdded0dacc5d5e5bf4a60a4e
Summary:
All our clients fetch with ondemandfetch set to true. Let's enable it
by default and remove the other fetch path.
Reviewed By: quark-zju
Differential Revision: D29148507
fbshipit-source-id: ea348aedba495d9d3a8652c4289178c08dae2f08
Summary:
All our client fetches now use the designatednodes api call. Let's
support it on the treemanifest python server so we can simplify the client code
around this one way of fetching.
Reviewed By: quark-zju
Differential Revision: D29148505
fbshipit-source-id: 22a92cdcfb105d8861b590de683e1bc12618abae
Summary:
Since the python stores are gone, we no longer need the generating
store concept. Deleting it simplifies are remotetreestore to just a prefetch
function, which will make later fetch path refactoring easier to reason about.
Reviewed By: andll
Differential Revision: D29143583
fbshipit-source-id: 9f5e1063cb9637542f7b4400bddff11fc2215353
Summary:
All treemanifest uses the rust store now. Let's delete the alternative
path.
Reviewed By: andll
Differential Revision: D29142988
fbshipit-source-id: e74a2643ccd25f5e18feb2fa6bc0424ee642d3d0
Summary:
Since we no longer send flat manifests as part of the changegroup,
let's remove the ability to convert flat manifest deltas into local trees.
Reviewed By: andll
Differential Revision: D29142989
fbshipit-source-id: 2b060b3412bf0b48f85de21e68a9ae123c19d360
Summary:
Now that we only support treeonly and the server has been moved out, we
can drop a bunch of dead code.
Reviewed By: andll
Differential Revision: D29140648
fbshipit-source-id: 3d80da0b703e9b20b3522adc3363c32e3d01d4f5
Summary:
All our production clients have been treeonly for years. Let's remove
all the non-treeonly paths. This diff just removes all the conditional logic. A
later diff will remove the classes and functions that are no longer used because
the conditions are gone.
Reviewed By: andll
Differential Revision: D29140647
fbshipit-source-id: 381195d7b48dee33e8540eb428b8061845e13ced
Summary:
Now that the tests are using the copy of treemanifest we can remove the
server logic. To start with, let's remove all the conditional paths for the
server.
A later diff will remove the server specific storage bits (like revlog usage).
Reviewed By: quark-zju
Differential Revision: D29120431
fbshipit-source-id: aceb7ee265ce7333e26065202f114fed93895619
Summary:
The treemanifest store and pull/push logic is overly complicated.
Untangling it is a bit tricky since it needs to support both server and client
use cases. Since we no longer care about the server code except for tests, let's
copy the treemanifest extension and use it for the server repo in tests.
A future diff will take advantage of this to delete all the server logic from
the main treemanifest extension.
Reviewed By: quark-zju
Differential Revision: D29115069
fbshipit-source-id: 8b7080aa6c7de77be058b34baad5e976cd7c1acf
Summary:
Backout lost move info when copy tracing was disabled. Let's force it
to be enabled for reverts.
Reviewed By: andll
Differential Revision: D29501812
fbshipit-source-id: be2a64fa0185ff91df58edc8ae680da17bedf96f
Summary:
S236795 is about hg backout losing blame/history after backing out a
move. Let's add a test demonstrating the bug.
Reviewed By: andll
Differential Revision: D29501813
fbshipit-source-id: 95efe8fd03f2b744661960c79fed928b5f3d4d8f
Summary:
Figured out by
export EDENSCM_LOG=dag::protocol=debug
to see the commit hashes being resolved remotely. Then
export EDENSCM_DISABLE_REMOTE_RESOLVE=1e60115cd0477b0b7569d7a3bdac9b0f7d55bd66
to find the traceback of the code accessing it.
This happens when commits are synced but their predecessors do not exist in the
local repo.
Reported by: markbt
Similar to D29114049 (880b5c3cd8).
Reviewed By: markbt
Differential Revision: D29509362
fbshipit-source-id: b94516cf312cb247d85d1a195919d9e63745ef99
Summary: If the user has modified the commit (ex. amend) and not sending it to Phabricator, we shouldn't mark the local commit as "landed" because it might contain changes that do not exist in the "master" branch.
Reviewed By: quark-zju
Differential Revision: D29401200
fbshipit-source-id: fc09921decdcffb8fc16e65d6a975c5a4154a96d
Summary: We'd like to eliminate directly writing serialized LFS pointers, but it turns out this is still necessary even when `remotefilelog.lfs=True` in some cases. With this change, we can enable writing serialized LFS pointers directly with a config.
Reviewed By: kulshrax
Differential Revision: D29496358
fbshipit-source-id: 66f53e0f0de52060920658a1781c32f27984ff3a
Summary:
`x in repo` will trigger remote lookup for lazy changelog, because
x might be a public commit hash in the local graph but not known
locally. For shelved changes, they aren't expected to be public,
so just use the local filtering without remote lookup.
Reported By: markbt
Reviewed By: DurhamG
Differential Revision: D29495144
fbshipit-source-id: da36d39f21ac2533d0e723e53593365722d61bd8
Summary:
Eliminate remaining uses of `contentstore` directly in the Python bindings.
Add repack functionality to `LegacyStore`.
Implement repack methods on `FileStore` by calling into contentstore fallback if possible, otherwise directly.
Reviewed By: kulshrax
Differential Revision: D29469901
fbshipit-source-id: 5cd134d25680bb55b4ddbe1f6d69e02af8942b16
Summary:
If the default is to pass certificates we should hard fail every single time they are not found instead silently making unauthenticated request. This will surface issues much quicker.
best_match_for can return `Ok(None)`.
Reviewed By: johansglock
Differential Revision: D29159532
fbshipit-source-id: ff28a627d91a9cf37258a97dc2c7f709ba8d00c2
Summary:
add 'upload/filenodes' request
This API must be called after file content has been uploaded. It requires a valid upload token for already uploaded file content.
The token can contain file content id of different types (canonical, sha1, sha256). It may or may not contain content size.
Reviewed By: StanislavGlebik
Differential Revision: D29197219
fbshipit-source-id: 3de31831ab06265675617a5c43cbd4be91f5cbe2
Summary:
If the repo changelog was migrated to lazy, existing processes including the
import helpers might start failing to resolve commits. Detect that, and request
a restart of the import helper.
An example traceback:
edenscm.mercurial.error.RepoLookupError: unknown revision 'ce48ccc4197b2066a8c7f2a930cee89e8aea6379'
2021-06-29 12:33:12,738 error processing command 4
Traceback (most recent call last):
File "edenscm/mercurial/commands/eden.py", line 363, in process_request
cmd_function(req)
File "edenscm/mercurial/commands/eden.py", line 604, in cmd_manifest_node_for_commit
node = self.get_manifest_node(rev_name)
File "edenscm/mercurial/commands/eden.py", line 821, in get_manifest_node
return self._get_manifest_node_impl(rev)
File "edenscm/mercurial/commands/eden.py", line 790, in _get_manifest_node_impl
node_hash = ctx.manifestnode()
File "edenscm/mercurial/context.py", line 569, in manifestnode
return self._changeset.manifest
File "edenscm/mercurial/util.py", line 987, in __get__
result = self.func(obj)
File "edenscm/mercurial/context.py", line 540, in _changeset
return self._repo.changelog.changelogrevision(self._node)
File "edenscm/mercurial/changelog2.py", line 374, in changelogrevision
return changelogrevision(self.revision(nodeorrev))
File "edenscm/mercurial/changelog2.py", line 463, in revision
p1, p2 = self.parents(node)[:2]
File "edenscm/mercurial/changelog2.py", line 610, in parents
parents = list(self.dag.parentnames(node))
error.CommitLookupError: '<int> cannot be found'
Reviewed By: andll
Differential Revision: D29470181
fbshipit-source-id: 40ad6eebe1f656c63d3f96b2b70ad60b350eed21
Summary:
Previously the None edenapi error isn't great for understanding what's going on:
File "edenscm/mercurial/changelog2.py", line 123, in _openhybrid
inner = bindings.dag.commits.openhybrid(
TypeError: Expected type that converts to client but received NoneType
Let's make edenapi non-nullable by default, with nicer error messages, and make
places using the nullable edenapi opt-in explicitly.
Example errors:
% lhg sl --config edenapi.url=
abort: edenapi is required but disabled by missing edenapi.url config
% lhg sl --config edenapi.enable=
abort: edenapi is required but disabled by edenapi.enable being empty
% lhg sl --config paths.default=/tmp
abort: edenapi is required but disabled by paths.default being 'file:'
% lhg sl --config paths.default=ssh://x --config ui.ssh=dummyssh
abort: edenapi is required but disabled by paths.default being 'ssh:' and dummyssh in use
Reviewed By: kulshrax
Differential Revision: D29462258
fbshipit-source-id: 84fab5a7cce837c52ccb8108d1f4fe44ef2b6d1e
Summary:
D29372739 (ef79c2d811) caused issues that repo.edenapi becomes None due to scheme being ssh
(hit by markbt) or fb (hit by StanislavGlebik). Given that it's just legacy tests
that do not want EdenAPI, let's use a blacklist for legacy tests, instead of a
(fragile) whitelist for where EdenAPI should be enabled.
Reviewed By: kulshrax
Differential Revision: D29461305
fbshipit-source-id: 4a0317747d9ee3412ffdfdb25dc0d8383305a25c
Summary:
To construct a lazy changelog, the repo object needs to have `name` and `edenapi`. Implement them.
Besides, print why changelog fails to open with `--debug` or `--traceback`.
Reviewed By: andll
Differential Revision: D29468005
fbshipit-source-id: 5815e0d9313dac897f20fa32668cae05ba90c727
Summary: Looks like another test needs updating after D29437983 (5b1b1febc1).
Reviewed By: quark-zju
Differential Revision: D29446063
fbshipit-source-id: c71684609830b6ec047a2efc615b806dd2a0066b
Summary:
With lazy pull fast path, the legacy commit scan will trigger one-by-one id
resolution, which is terrible and defeat the purpose of laziness. Let's just
force graphql path instead.
Reviewed By: andll
Differential Revision: D29440142
fbshipit-source-id: 4b0d10e6f5a3eb0533b2d95b1889a1f1c1f281cb
Summary:
Similar to D29404057 (cedddd1c8d), add a way to disable resolving IDs by setting
a limit using `EDENSCM_REMOTE_ID_THRESHOLD`.
Reviewed By: andll
Differential Revision: D29440143
fbshipit-source-id: 30409089493ae2cd5c189e37b0d4f88df9a6d8e8