Commit Graph

11 Commits

Author SHA1 Message Date
Pyre Bot Jr
0f0334f97a suppress errors in fbcode/eden - batch 1
Differential Revision: D32470212

fbshipit-source-id: 9170c56d6a6bab051bf35337ef8df57a5a73371f
2021-11-16 12:54:39 -08:00
Muir Manders
716d3245bb lock: kill inheritable lock code
Summary:
This unused feature allowed a sub-process to inherit an hg repo wlock from the parent process. It was apparently intended for merge drivers, but nothing was using it.

I want to move some locking logic into rust, and this stuff was complicating things.

Note that this functionality was also removed upstream in https://phab.mercurial-scm.org/D9053.

Reviewed By: quark-zju

Differential Revision: D31184339

fbshipit-source-id: 92908220d48e2bc55e2f4fca90e647650ca5bef7
2021-09-27 14:58:42 -07:00
Jia Chen
b742a447e2 Switch eden to new Pyre backend
Summary: This project has custom stubs that contain type errors. We'll need to fix them so the switch to new Pyre backend won't create any regressions.

Reviewed By: dkgi

Differential Revision: D29953374

fbshipit-source-id: f54d25682d6b01eed4867eab6823e29ddb95e754
2021-07-27 22:39:51 -07:00
Arun Kulshreshtha
befabb81c0 eden: make the EdenFS import helper use EdenAPI's /trees endpoint instead of /complete_trees
Summary:
The EdenFS import helper's `_fetch_tree_impl` method works by either calling `repo._prefetchtrees` or `repo.prefetchtrees`, both of which are methods from `treemanifest` extension's `treerepository` class. Unfortunately, these methods are lower-level than their names would suggest, and will always perform gettreepack style fetching (see [1]).

If HTTP fetching is enabled, this means that EdenFS will always query EdenAPI's `/complete_trees` endpoint instead of `/trees`, which is needlessly expensive given that EdenFS just wants the exact set of trees specified. As a somewhat hacky workaround, this diff just checks whether HTTP fetching is enabled, and if so, directly calls the appropriate HTTP fetch method.

This solution isn't ideal; it would be better for the import helper to request the trees from Mercurial's `remotetreestore` instead of via methods from `treerepository`. Unfortunately, with the current structure of Mercurial's storage layer, the `remotetreestore` isn't readily accessible because it gets passed into the Rust API's storage hierarchy upon construction.
 ---
[1]: The various `*prefetchtrees` methods  are usually called from Mercurial's `remotetreestore`, which is where the choice of tree fetching strategy is made (i.e., designated nodes vs gettreepack). The `remotetreestore` then calls `*prefetchtrees` for gettreepack-style fetching, or `*getdesignatednodes` for on-demand fetching. As such, a call to `*prefetchtrees` generally implies gettreepack-style fetching.

Reviewed By: quark-zju

Differential Revision: D26560451

fbshipit-source-id: 2eedf50a6e66fac78df77214b777544eb8049714
2021-02-22 14:23:40 -08:00
Jun Wu
dabce28285 repoview: further remove repoview references
Summary:
Since repoview is removed, those concetps are useless. Therefore remove them.

This includes:
- repo.unfiltered(), repo.filtered(), repo.filtername
- changelog.filteredrevs
- error.FilteredIndexError, error.FilteredLookupError,
  error.FilteredRepoLookupError
- repo.unfilteredpropertycache, repo.filteredpropertycache,
  repo.unfilteredmethod
- index.headsrevsfiltered

Reviewed By: DurhamG

Differential Revision: D22367600

fbshipit-source-id: d133b8aaa136176b4c9f7f4b0c52ee60ac888531
2020-07-06 14:04:27 -07:00
Jun Wu
1535e0774e changelog: expose rawheadrevs() API
Summary:
In the past we hide the revlog headrevs API with the idea that calculating
heads in the DAG is not going to scale, and heads should be based on references
(remotenames, visible heads). Practically calculating heads in the DAG based
on segmented changelog is not going to be painfully slow so we probably can
afford it.

Therefore let's just re-expose the DAG-based heads API as rawheads. The only
user of it is in dagutil.py.

This will be used in the next diff where streamclone first gets the revlog
changelog copied without remote bookmarks. Then it needs to do a pull
which requires the heads information.

Reviewed By: DurhamG

Differential Revision: D21296530

fbshipit-source-id: a81a61e3b58c921a3390fda8f716bd7ae0e55ed1
2020-05-12 10:23:23 -07:00
Jun Wu
ea59a506f1 fsinfo: expose fstype via bindings.fs.fstype
Summary: Expose the Rust fstype implementation so we can remove C and Python code.

Reviewed By: xavierd

Differential Revision: D20313390

fbshipit-source-id: 931b4f6bc8c4b81f30bfea06d055fae3c677eedd
2020-03-11 17:35:40 -07:00
Jun Wu
2777fea957 py3: localrepo: manually fixup some type annotations
Summary: This might help pyre check more things.

Reviewed By: farnz

Differential Revision: D19678144

fbshipit-source-id: a04207ccb04ce76796e9a0a7326a8d527d17cff1
2020-02-03 17:07:36 -08:00
Jun Wu
165a8d4f8d py3: add stub for localrepository
Summary:
The "repo" type is a bit hard to type since it might be wrapped by extensions,
and the decorators like "unfilteredmethod" are too hard for type checkers.

Provide a stub for it so typecheck can work. The stub was generated by `pytype`,
I made a small change to `close` to make pyre happy.

Reviewed By: DurhamG

Differential Revision: D19677410

fbshipit-source-id: 71afb3fe78a75ee269c8005d18eee3a807b50df6
2020-02-03 17:07:36 -08:00
Jun Wu
ad0c50a5cb py3: fix some type issues detected by pyre with some type stubs
Summary:
The issues were found by pyre with some type stubs generated via pytype:

  python36 -m pytype edenscm --no-report-errors -j 30

I didn't include the pytype generated stubs because most of them are `Any`.
I'm trying to see if we can get something cleaner.

Reviewed By: markbt

Differential Revision: D19672435

fbshipit-source-id: c57f2ad3a981ddd4a3a267ff1c00e7bdb71e65ca
2020-01-31 16:38:02 -08:00
Jun Wu
e124dfebc6 pyre: add stub for "bindings"
Summary:
Add a partial stub so pyre stops complaining about "bindings" being unknown.

Pyre's "search_path" was adjusted to read the new "pystubs" directory.

Reviewed By: DurhamG

Differential Revision: D19669131

fbshipit-source-id: a592ed411d1689058405689eb657e543b7172774
2020-01-31 13:18:54 -08:00