Commit Graph

811 Commits

Author SHA1 Message Date
Jun Wu
7872c44fdf configparser: stabilize tests
Summary:
Add locking for tests reading / mutating global env vars.
Restore HG_TEST_REMOTE_CONFIG after testing.

Reviewed By: DurhamG

Differential Revision: D23269862

fbshipit-source-id: d61141b25c923a059de07c3dc8479f3bee06dce7
2020-08-24 12:36:09 -07:00
Jun Wu
e7f3167810 hgcommands: show milliseconds on RUST_LOG output
Summary: This makes it a bit easier to track down perf issues printed by RUST_LOGs.

Reviewed By: sfilipco

Differential Revision: D23095463

fbshipit-source-id: 78221a1992389f512fac6e6e633be6d19123e04a
2020-08-21 13:00:45 -07:00
Jun Wu
d7cbb641ff dag: fix fuzz tests
Summary:
The fuzz tests need `TestContext::id_dag()`, which was removed by D20471712 (1fb5acf242).
Restore it so fuzz tests can run. This is mainly to check the new `range`
function.

The `range` fuzz test does find an issue caused by `>` written as `>=`
relatively quickly.

Reviewed By: sfilipco

Differential Revision: D23106176

fbshipit-source-id: e9540cc932503a9d54246d24c70bac829fcb13df
2020-08-21 13:00:45 -07:00
Jun Wu
749602e534 hgcommits: add gitsegments backend
Summary:
The backend translates git commit graph to segments. It's useful for
benchmarking on git commit graphs.

Reviewed By: DurhamG

Differential Revision: D23095470

fbshipit-source-id: 21a28869e91ef8f38bbf9925443eb4ac26f05e3d
2020-08-21 13:00:45 -07:00
Jun Wu
d352133d6d hgcommits: use concrete error types
Summary: Migrate to concrete types so it can be typechecked.

Reviewed By: DurhamG

Differential Revision: D23095469

fbshipit-source-id: 27c6da30ca8a1329df544cd2ded7d9734593e48a
2020-08-21 13:00:45 -07:00
Jun Wu
e5527715b7 gitdag: crate to build segmented dag from git history
Summary:
Read git commit graph and migrate them to `dag::Dag`.

This allows using Rust dag abstractions on the git
commit graph.

Reviewed By: DurhamG

Differential Revision: D23095471

fbshipit-source-id: 2163701350ce82ce6e97074e56ad5877f3c9c158
2020-08-21 13:00:45 -07:00
Jun Wu
45db3bbf96 mutationstore: add a native path to calculate 'obsolete()'
Summary:
The new path does not calculate the complicated `successorssets`, and is
known to make wez's repo operations significantly faster (which, I suspect is
slowed by a very long chain).

The new code is about 3x faster on my repo too:

  # before
  In [1]: list(repo.nodes('draft()'))
  In [2]: %time len(m.mutation.obsoletenodes(repo))
  CPU times: user 246 ms, sys: 42.2 ms, total: 288 ms
  Wall time: 316 ms
  Out[2]: 1127

  # after
  In [1]: list(repo.nodes('draft()'))
  In [2]: %time len(m.mutation.obsoletenodes(repo))
  CPU times: user 74.3 ms, sys: 7.92 ms, total: 82.3 ms
  Wall time: 82.3 ms
  Out[2]: 1127

Reviewed By: markbt

Differential Revision: D23036063

fbshipit-source-id: afd6ac122bb5d8d513b5cdc033e04d2c377286eb
2020-08-21 13:00:45 -07:00
Jun Wu
78477ad9c5 mutationstore: optimize get_dag
Summary:
Optimize get_dag:
- Avoid parsing mutation entries once they are parsed, by keeping an in-memory
  `parent_map`.
- Pass `heads` to `add_heads` so the segments are less fragmented, cycle break
  helper is more efficient.

The `heads` optimization is effective. Practically this makes `get_dag` about 2x faster.

This has a subtle change on cycle handling - full cycle without any non-cycle heads will
be ignored. Practically cycles are rare so it might be okay.

Together with improvements on the `dag` side, `get_dag` is about 4x faster.

Reviewed By: markbt

Differential Revision: D23036062

fbshipit-source-id: 3dc407b562f7ebf2543a87c5cd651ad6a2339d67
2020-08-21 13:00:45 -07:00
Jun Wu
be2d28fb95 dag: fix non-master high-level segments building
Summary:
If there is no new master segments, it's still possible to have new non-master
segments. Fix the loop condition so we don't skip building non-master segments.

Reviewed By: sfilipco

Differential Revision: D23095465

fbshipit-source-id: 46eb9d5b5f2b04241981558646e0bc090652abce
2020-08-21 13:00:45 -07:00
Jun Wu
e11f36e96b dag: test high-level segments building for non-master
Summary:
I noticed that high-level segments are somehow not built for non-master vertexes.
Add a test to demonstrate the issue.

Reviewed By: DurhamG, sfilipco

Differential Revision: D23095466

fbshipit-source-id: c5a6da14bdfabcf7c432f6c6dfe096c71cc10ee9
2020-08-21 13:00:45 -07:00
Jun Wu
23074edd9b dag: add some tracing spans
Summary: This is useful to investigate internals of dag calculations.

Reviewed By: sfilipco

Differential Revision: D23095473

fbshipit-source-id: 4750c1b4ffad32b1317051d17db9659aaaed59c4
2020-08-21 13:00:45 -07:00
Jun Wu
cd9aa9cb6c dag: improve segment building perf by using precalculated flat segments
Summary:
Follow up of the previous change by actually using the flat segments to build
segments. This significantly improved the perf. `cargo bench --bench dag_ops`
shows:

  building segments (old)                           774.109 ms
  building segments (new)                           143.879 ms

Besides, a `O(N^2)` update to `head_ids` is changed. It improves performance
when the graph has many heads (ex. the mutation graph).

Reviewed By: sfilipco

Differential Revision: D23036080

fbshipit-source-id: 033565700f253c6f20e30a00adb6b579921d6679
2020-08-21 13:00:45 -07:00
Jun Wu
9c9ecbc82b dag: make IdMap::assign_head calculate flat segments
Summary:
While testing the `obsolete()` set, I found an in-memory segmented DAG takes
10x time to build than a HashMap DAG.

Part of the inefficiency is to use a translated "parent_func" that round-trips
through Id and Vertex, used by segment building logic. This diff makes
`IdMap::assign_head` return flat segments, so we don't need a translated
"parent_func" to build flat segments.

This diff only adds checks to make sure the parent_func (Id version) matches
the segments. The next diff switches the segment building to not use the
translated parent_func.

Reviewed By: sfilipco

Differential Revision: D23036060

fbshipit-source-id: 99137f4b5be455cdf43218ba23eb3954b6d9e05a
2020-08-21 13:00:45 -07:00
Jun Wu
0742dc6293 dag: make to_set API bind the dag
Summary:
This affects the `tonodes` API in the Python world. Practically this will bind
the main commit graph to sets like draft, public.

The `ToSet` requirement on `DagAlgorithm` has to be removed to avoid stack
overflow of rustc resolving constraints.

Reviewed By: sfilipco

Differential Revision: D23036077

fbshipit-source-id: 912b924e29611680ab6b2ee4dbcd7ab39824409a
2020-08-21 13:00:45 -07:00
Jun Wu
adf027742e nameset: add flatten API
Summary: This will be useful for the `obsolete()` set.

Reviewed By: sfilipco

Differential Revision: D23036072

fbshipit-source-id: 2f944ef31cf19f902622d90545fa02b7dda89221
2020-08-21 13:00:45 -07:00
Jun Wu
f23b1112f0 nameset: a & b should not use id-based fast path if id map is incompatible
Summary:
If two sets have different IdMap, their Ids cannot be compared directly
for correctness.

Reviewed By: sfilipco

Differential Revision: D23036068

fbshipit-source-id: e800e8273b95c1f8174236e0f30445db7fd44556
2020-08-21 13:00:45 -07:00
Jun Wu
c1e596dbd6 nameset: use real id map snapshot instead of a pointer in hints
Summary: This is similar to the previous change. This allows "binding" IdMaps to sets.

Reviewed By: sfilipco

Differential Revision: D23036058

fbshipit-source-id: ec1b1ec73e949ad4865aecf17bfcc5c1ca723e0d
2020-08-21 13:00:45 -07:00
Jun Wu
0ac5f05097 nameset: use real dag snapshot instead of a pointer in hints
Summary:
This trades a bit performance (calculating the snapshot) for correctness (no
pointer reuse issues) and convenience (set captures dag information with them
and enables use-cases like converting NameSet from another dag to the
current dag without requiring extra `dag` objects).

Reviewed By: sfilipco

Differential Revision: D23036067

fbshipit-source-id: 2e691f09ad401ba79dbc635e908d79e54dadca5e
2020-08-21 13:00:45 -07:00
Jun Wu
759ceb6212 nameset: do not swap x & y if they come from different graphs
Summary:
If `x` and `y` come from a same graph, `x & y` is more efficient than
`y & x` if `y` is larger. However, if `x` and `y` are from different
graphs, the `FULL` hint can no longer accurately predict which one
is larger. Therefore the swap should be avoided.

Reviewed By: sfilipco

Differential Revision: D23036081

fbshipit-source-id: fe3970fc38c853b36689bfd0ee1dec20643ace78
2020-08-21 13:00:45 -07:00
Jun Wu
762603455a nameset: new metaset for separate iter+contains lazy/fast paths
Summary:
For sets like `obsolete()`, `merge()`, they could have a fast "contains" path:
Just check the given commit without calculating a full set. It's also possible
to have a relatively efficient code path to return StaticSet (for obsolete()),
or IdStaticSet (for merge(), by checking flat segments). This diff adds a
`MetaSet` that allows defining two fast paths separately.

This will be used for the `obsolete()` set in upcoming changes.

Reviewed By: sfilipco

Differential Revision: D23036059

fbshipit-source-id: 06e6f90e7e9511626a12cfa729c306ff539256d2
2020-08-21 13:00:45 -07:00
Jun Wu
7d8f4ef92f dag: fix re-assigning master flush
Summary:
Before this change, `flush` with empty changes but `master` moves will cause an
error, because the `parents_func` only contains "pending changes", aka. new
vertexes. The `parents_func` does not know `master` and `master` is needed to
re-assign them from the non-master to the master group.

With the snapshot API, things become easier. We just take a snapshot before
reloading, and use the snapshot to answer parent_names.

Reviewed By: sfilipco

Differential Revision: D22970569

fbshipit-source-id: 99a25857ba98792edff69985c16df118a560ffb0
2020-08-21 13:00:45 -07:00
Jun Wu
f666cb1cf0 dag: add DagAlgorithm::snapshot_dag
Summary:
This API allows the underlying Dag to provide a snapshot. The snapshot can then
be used in places that do not want a lifetime (ex. NameSet).

Reviewed By: sfilipco

Differential Revision: D22970579

fbshipit-source-id: ededff82009fd5b4583f871eef084ec907b45d33
2020-08-21 13:00:45 -07:00
Jun Wu
b8e7828edd dag: add NameDag::snapshot_dag
Summary:
Make it possible to snapshot a Dag. This is useful for cases where another
struct wants access to the Dag without lifetimes. Namely, the LazySet can
might want to keep a snapshot of Dag.

Reviewed By: sfilipco

Differential Revision: D22970568

fbshipit-source-id: 508c38d3ffac2ffcd2e682578c3c5e5787ea3bcf
2020-08-21 13:00:45 -07:00
Jun Wu
741d050f10 dag: drop inverse DAG
Summary:
The only intended use of the inverse DAG is to implement the Python dag
interface in `dagutil.py`. D22519589 (2d4d44cf3d) stack changed it so the Python dag
interface becomes optional. Therefore there is no need to keep the inverse DAG
interface, which is a bit tricky on sorting.

Reviewed By: sfilipco

Differential Revision: D22970581

fbshipit-source-id: 58a126b41d992e75beaf76ece25cb578ee84760b
2020-08-21 13:00:45 -07:00
Jun Wu
fa25f42fea pydag: add an API to migrate from one DAG to segmented DAG
Summary:
This will be used for migrating revlog DAG to segmented changelog. It does not
migrate commit text data (which can take 10+ minutes).

Reviewed By: DurhamG, sfilipco

Differential Revision: D22970582

fbshipit-source-id: 125a8726d48e15ceb06edb139d6d5b2fc132a32c
2020-08-21 13:00:45 -07:00
Durham Goode
b2ece412fd configs: handle timestamp anomalies in dynamicconfigs
Summary:
Dynamicconfigs compares the timestamp of config files with the current
timestamp to determine when to regenerate. If the timestamp of the config file
is newer than the current timestamp, Rust throws an exception. Let's handle that
case and treat it as if the file was just created instead of crashing.

Reviewed By: quark-zju

Differential Revision: D23230216

fbshipit-source-id: ca185de7dfca46953e04ec08c84668eda6d749bd
2020-08-21 13:00:45 -07:00
Mark Thomas
4d18561ab8 bgprogress: Stdio is only used on Unix
Summary: This fixes the Windows build.

Reviewed By: farnz

Differential Revision: D23212195

fbshipit-source-id: 159f3ddebf6a97f52f9b6c80ef19315c8f4b0c85
2020-08-21 13:00:45 -07:00
Jun Wu
6b64f9a2bf dag: add import_and_flush API
Summary:
This allows importing from other DAGs. It will be used to import revlog DAG to
the new segmented format.

Reviewed By: sfilipco

Differential Revision: D22970572

fbshipit-source-id: 0a183e7b64831574cc9c60d4639124d02d19cf43
2020-08-21 13:00:45 -07:00
Jun Wu
c448e0f575 renderdag: move to dag
Summary:
This allows dag to use renderdag in tests to verify graph result. Previously
it was hard because dag <-> renderdag would form circular dependency.

It also make it possible to implement more efficient and integrated fast paths
for graph rendering.

Reviewed By: sfilipco

Differential Revision: D22970570

fbshipit-source-id: 526497339bd7aa8898d1af4aa9cf6d2a6797aae0
2020-08-21 13:00:45 -07:00
Jun Wu
d047f07b70 commits: add a trait to describe storage backend and use-cases
Summary: This will be used to describe what the commit graph backend is.

Reviewed By: sfilipco

Differential Revision: D22970577

fbshipit-source-id: 753efdbdd4466730ece758d9f4789fbd21e2801b
2020-08-21 13:00:45 -07:00
Jun Wu
b77355ca0c commits: add double write commits backend
Summary:
This allows us to try segmented changelog while maintaining revlog
compatibility.

Reviewed By: sfilipco

Differential Revision: D22970583

fbshipit-source-id: 7c43cdadd76300e76e89f38aac5ed3ecc0cff728
2020-08-21 13:00:45 -07:00
Durham Goode
d7b036c29a Enable fb features for cargo test diff runs
Summary:
We missed a Windows http client breakage because our LFS server integration
wasn't run on Windows. Let's enable the fb feature for all our cargo test runs.

Reviewed By: singhsrb

Differential Revision: D23140315

fbshipit-source-id: 46cc533c1e543ffc32d472b49a8f6daeee3b5009
2020-08-18 14:01:01 -07:00
Meyer Jacobs
656e3c90d6 edenapi: Introduce serde annotations for wire protocol compatibility and compact wire representation
Summary:
Aux data wire protocol part 1: field annotations & basic compatibility model.

Annotates fields in `file`, `tree`, and `complete_tree` wire structs with `#[serde(rename = "N", default, skip_serializing_if = "is_default")]`. I've avoided using `#[serde(default)]` on the container structs themselves because this can cause some confusion / incorrect behavior if not used carefully. Consider a wire struct `FooRequest` with a field of type `Option<Bar>`. `Option<Bar>` defaults to `None`. If `FooRequest`'s `Default` implenentation sets the field's default to `Some(bar)`, a `FooRequest` explicitly constructed with `None` for the field will be serialized with the field omitted (because it passes `is_default`) and will be deserialized on the server as `Some(bar)`, causing incorrect behavior. To address this, we'd need to change the `is_default` function used with `skip_serializing_if` to check against the field's default value as set by the container, which isn't trivially possible without some sort of reflection (please correct me if you know a good way to achieve this). This is unfortunate, as it'd be very desirable for the container to be able to set defaults different from the individual field type defaults, for cases where one boolean, for instance, should default to true. As-is, we'd need to address this with wrapper types instead, where we can fully control the `Default` implenentation.

We can, of course, address this by providing an alternate `skip_serializing_if` function to fields with default that doesn't match that set by the container. This will need to be done carefully, though, to avoid the issue I described above.

Currently the JSON module manually serializes and deserializes all the top-level request objects, so the rename annotation doesn't impact it. We can add `#[serde(alias = "rustfieldname")]` if we'd like the server and client to be able to accept manually-crafted requests and responses with explicit field names. This could also be useful to replace the manual parsing in the JSON module, but can't replace the manual serialization in a clean way. We'd need to introduce a second copy of the wire types, without the serde `rename` attribute, to allow serializing with the actual rust field name.

I've only modified the `tree`, `file`, and `complete_tree` modules. I intend to eventually update the rest of the edenapi protocol later on, when the implementation of `file` and `tree` are complete / stable. This will give us a chance to fix any mistakes before copying the design to more places.

Note: I do not intend to keep to proper wire protocol compatibility at this stage in the implementation. Expect field numbers to be re-used by non-compatible changes.

Reviewed By: kulshrax

Differential Revision: D23172756

fbshipit-source-id: 39976ed4bede892bd6981f9c3f23557a91f9028b
2020-08-18 13:44:35 -07:00
Xavier Deguillard
88c3bf4826 revisionstore: remove translate_lfs_missing
Summary:
As noted in the documentation for it, this can be removed once get and prefetch
return a continuation. This is now done, and thus we can remove it entirely.

Mis-use of it caused data to be fetched twice: once by memcache, and the second
one by getpackv2.

Reviewed By: singhsrb

Differential Revision: D23123344

fbshipit-source-id: 9ac0594faaba94ead04a8bb9035e14809a706641
2020-08-17 17:05:58 -07:00
Durham Goode
fe6cb9dc13 configs: fix handling shared path with trailing new lines
Summary: The python code stripped new lines but the Rust code did not.

Reviewed By: singhsrb

Differential Revision: D23167515

fbshipit-source-id: add33ec6e4cfd9169e6fef8208490e0aeede38bd
2020-08-17 15:53:08 -07:00
Durham Goode
33a634167e dynamicconfig: support a disallowlist config
Summary:
This new disallowlist will let us specify config section.key's which
should not be accepted from old rc files. This will let us incrementally disable
loading of those configs from the old files, which will then let us delete them
from the old rc's and eventually delete the old rc's entirely.

This diff also removes hgrc.local and hgrc.od from the list of configs we
verify, since those are not on the list of configs that need to be removed in
this initiative.

Reviewed By: quark-zju

Differential Revision: D23065595

fbshipit-source-id: 5cd742d099efd651174cab5e87bb7cdc4bae8054
2020-08-16 16:56:00 -07:00
Durham Goode
0cf7ebeffe configs: make backingstore load hg configs through the approved path
Summary:
Previously the backing store was loading configs manually. Now that
system, dynamic, user, and repo config loading are unified, let's go through
that approved path.

Reviewed By: kulshrax

Differential Revision: D22736338

fbshipit-source-id: 232023e660107a096691e9d99bf89c04c218dfbd
2020-08-16 16:56:00 -07:00
Durham Goode
2da121cb60 configs: add rust support for loading dynamic and repo configs
Summary:
This threads the calls to load_dynamic and load_repo through the Rust
layer up to the Python bindings. This diff does 2 notable things:

1. It adds a reload API for reloading configs in place, versus creating a new
one. This will be used in localrepo.__init__ to construct a new config for the
repo while still maintaining the old pinned values from the copied ui.
2. It threads a repo path and readonly config list from Python down to the Rust
code. This allows load_dynamic and load_repo to operate on the repo path, and
allows the readonly filter to applied to all configs during reloading.

Reviewed By: quark-zju

Differential Revision: D22712623

fbshipit-source-id: a0f372f4971c5feac2f20e89a0fb3fe6d4a65d6f
2020-08-16 16:56:00 -07:00
Durham Goode
6b0014490c configs: implement dynamic and repo config loading in Rust
Summary:
In a future diff we'll enable dynamic and repo config loading purely
from Rust. To do so we need load functions for both cases.  A future diff will
call these.

The dynamicconfig loading is based off the Python equivalent in uiconfig.py

Reviewed By: quark-zju

Differential Revision: D22712624

fbshipit-source-id: ff46f6315fb80d4cd9e31d875ac60264563b12f2
2020-08-16 16:56:00 -07:00
Durham Goode
194e815245 configs: move HGRCPATH loading to load_system
Summary:
Previously load_system would skip loading if HGRCPATH was present and
then load_user would actually load the HGRCPATH. In an upcoming diff I add
load_dynamic, which happens after system but before user. The tests for
dynamicconfig depend on HGRCPATH being loaded when load_dynamic runs, so let's
move HGRCPATH loading up to load_system.

Reviewed By: quark-zju

Differential Revision: D22712627

fbshipit-source-id: 91175d9d7f85b9392ffea4af815a4facebbfe7c1
2020-08-16 16:56:00 -07:00
Durham Goode
ef9ba19dc5 configs: make Options clonable
Summary:
In a future diff we'll allow an outside caller to pass an Options down
to configparsers::hg::load() so that filters can be applied during loading. Inside
hg::load() we need to use the options multiple times with different values, so
let's make Options clonable.

Reviewed By: quark-zju

Differential Revision: D22712626

fbshipit-source-id: 975145f38d35afe7d4a6c8e87071b0fb0ae74797
2020-08-16 16:55:59 -07:00
Durham Goode
0cea385252 configs: remove config from repo.rs API
Summary:
A future diff will move all dynamic and repo config loading to be in
configparser. As part of this, let's simplify the repo.rs API to not pass
configs around everywhere.

Reviewed By: quark-zju

Differential Revision: D22712628

fbshipit-source-id: 79f23991aa826ce8b4f7430b45d7702efdc6b982
2020-08-16 16:55:59 -07:00
Durham Goode
26564596a1 utils: add background process utility
Summary:
Similar to the Python runbgcommand (extutil.py), this is a Rust utility that runs a
detached background process in a cross platform way.

This will be used in a later diff to run dynamicconfig generation in the
background.

Reviewed By: quark-zju

Differential Revision: D22712629

fbshipit-source-id: a317465bf03c96d977a203678e2bef13ce57cc12
2020-08-16 16:55:59 -07:00
Durham Goode
0b123ba41d configs: move Rust dynamicconfig generation into configparser::hg
Summary:
As part of moving all hg config loading and generation logic into Rust,
let's move the config generation logic from hgcommands and pyconfigparser to
configparser, unifying them at the same time.

Future diffs will move config loading in as well.

Reviewed By: quark-zju

Differential Revision: D22590208

fbshipit-source-id: d1760c404a6a5c57347df30713c20de55cfdb9a4
2020-08-16 16:55:59 -07:00
Durham Goode
7ff28d3e1c configs: move dynamicconfig into configparser
Summary:
A future diff will unify all config loading into configparser::hg, but
to do so we need dynamicconfig to live in configparser, so it can load
dynamicconfigs. Let's move everything in.

Reviewed By: quark-zju

Differential Revision: D22587237

fbshipit-source-id: 5613094175b6e1597aa113ee3e6d92ce7ec79f6d
2020-08-16 16:55:59 -07:00
Durham Goode
a40331be8d configs: unify system+user config loading into pure rust layer
Summary:
We had two spots that loaded system and user configs, one in the
pyconfigparser layer, and one in the pure rust config layer. In an upcoming diff
I'd like to move dynamicconfig loading down into the pure rust layer, so let's
unify these.

Reviewed By: quark-zju

Differential Revision: D22585554

fbshipit-source-id: 0cea7801ae1d5a3a3c12b80ee23b37f9e690e2bc
2020-08-16 16:55:59 -07:00
Durham Goode
3129f032a4 contentstore: make history rotatelog size configurable
Summary:
In a future diff we'll increase the size of the rotatelog temporarily
during clones. To do so we need it to be configurable.

Reviewed By: quark-zju

Differential Revision: D23089539

fbshipit-source-id: ebfc3beaf3c0fe5b01b87d97c19455b0a24afa72
2020-08-16 16:44:16 -07:00
Durham Goode
b821ab3766 contentstore: make data rotatelog size configurable
Summary:
In a future diff we'll increase the size of the rotatelog temporarily
during clones. To do so we need it to be configurable.

Reviewed By: quark-zju

Differential Revision: D23089541

fbshipit-source-id: 5010e417a83a2611283322f1dbb7023f4286f503
2020-08-16 16:44:16 -07:00
Durham Goode
76d3d46837 revisionstore: remove from_path from LocalStore
Summary:
from_path is an awkward constructor because it doesn't pass any other
information, like a config object. It also requires that the constructor be very
generic across all the stores. Right now it's only needed for pack files, so
let's move it to it's own trait that is limited to pack files.

This will allow us to make the indexedlog store constructors more versatile in a
later diff. Once we get rid of pack files we can delete the StoreFromPath trait
entirely.

Reviewed By: xavierd

Differential Revision: D23089542

fbshipit-source-id: ea6c50853e5d5390a029002ef5d15c74fe41fe69
2020-08-16 16:44:16 -07:00
Jun Wu
2db783bed8 revlogindex: make parent_revs fallible
Summary: If parent_revs gets an out-of-bound rev, it should fail.

Reviewed By: sfilipco

Differential Revision: D23036071

fbshipit-source-id: 7fae0fd5adf07ac3c933a29d7d06289d8d740c60
2020-08-14 22:00:26 -07:00