Summary:
This functionality is generic enough to be inside the common module so
that it can be shared easily. Upcoming commits will make use of this
functionality by importing from the common module.
Reviewed By: markbt
Differential Revision: D14919848
fbshipit-source-id: b3b7eef9eb0929334cba7ce869e7c9377c265da2
Summary:
This functionality is generic enough to be inside the common module so
that it can be shared easily. Upcoming commits will make use of this
functionality by importing from the common module.
Reviewed By: markbt
Differential Revision: D14919849
fbshipit-source-id: 74c6ad5158bd196bb062e2ec7b04ca121b5d2c3a
Summary:
This diff adds args escaping using single quote symbol before sending them to hooks.
Before all arguments where joined by space symbol " " which was producing incorrect result when argument itself contains space symbol.
Reviewed By: markbt
Differential Revision: D14799188
fbshipit-source-id: df5a4324d138515a4b881df96f2991de03df7a5b
Summary:
Add `shelvename` template keyword, which expands to the name of the shelve for
commits that contain shelves.
Reviewed By: farnz
Differential Revision: D14932985
fbshipit-source-id: cddebd2dbc6454f7c61ed296f37822179da8a2de
Summary:
We should update the builder for Key to take a repo path. We could build
the key directly using the default struct constructor but representing
the two constructors as functions is more clear.
Reviewed By: quark-zju
Differential Revision: D14877543
fbshipit-source-id: 328906521cdbad535e28df22fea82f21e8b5410a
Summary:
Marking the uses of byte arrays for repository paths as deprecated
to make it easier to remove uses in the code.
Reviewed By: quark-zju
Differential Revision: D14877541
fbshipit-source-id: 4c06e0f7012a33cc92752530618396c3c529f986
Summary:
It is fairly difficult to avoid an intermediary state where we don't have some
panics. Since we don't really deal with invalid paths this intermediary state
is not a real concern.
Reviewed By: quark-zju
Differential Revision: D14877553
fbshipit-source-id: 6f60f20af8d8f1e3ff23c5d8ab5353bc8d919ebf
Summary:
The overhead of generating all the different strings is noticeable when
we start to generate a lot of values.
Reviewed By: quark-zju
Differential Revision: D14877547
fbshipit-source-id: 8a91241ff3e86b6ac9b68197c449ed2be445f941
Summary: This builder is the mirror of `String::from_utf8` in the RepoPathBuf type.
Reviewed By: quark-zju
Differential Revision: D14877551
fbshipit-source-id: de79c36b0f5d638aad12428f7e5ee1bbe19c4bc6
Summary: This is preparation to change the backing storage from Vec<u8> to RepoPath
Reviewed By: quark-zju
Differential Revision: D14877544
fbshipit-source-id: a7f3c805fcc9bc96a4135b2e36e73e2662cec54e
Summary: This will be used in transitioning key from bytes to repo path.
Reviewed By: quark-zju
Differential Revision: D14877548
fbshipit-source-id: f79863469d58b53557e51ebb033cc6a6b5f43499
Summary:
Nothing fancy for RepoPathBuf to prevent us from marking them Serializable.
These will be used by the api server to wire data.
Reviewed By: quark-zju
Differential Revision: D14877552
fbshipit-source-id: 1a8728e28209213fced06d739698099ab8c462f2
Summary:
This function is difficult to justify in the context of the Rust borrow checker.
The primary concern for this pattern is preventing mutation when the object is
passed around.
We can always add the function back if it has to more than just return the
underlying value.
Reviewed By: quark-zju
Differential Revision: D14877545
fbshipit-source-id: acdd796e1bee5445c1bce5ce0ceb41a7334e4966
Summary: AsRef as a parameter is more flexible than direct slice.
Reviewed By: quark-zju
Differential Revision: D14908313
fbshipit-source-id: 07b317f151403be433eded136122bf652c887a07
Summary:
It makes this method 25-30% faster (shaves off 250-300 ms).
Also it counts number of fetched rows correctly - fetchall method was
overriden, but looks like __iter__ method wasn't
Reviewed By: ikostia
Differential Revision: D14915472
fbshipit-source-id: 313695c1a83d05dac2fc801792226b6b64539cb5
Summary: This test was failing because mercurial wants the file paths to be valid utf-8.
Reviewed By: singhsrb
Differential Revision: D14924604
fbshipit-source-id: be2db5c437df77ad3ad70f6956451e4a03835378
Summary: This extension has been refactored many times, resulting in some code and config options that are (as far as I can tell) completely unused. Let's remove them.
Reviewed By: singhsrb
Differential Revision: D14920751
fbshipit-source-id: 8d716a1d6144ba51cdb2750f6cfc6d6262b3b8a3
Summary:
The internal rustfmt linter suggests wrong autofixes for the `impl_offset!`
macro. That's noisy for every diff touching `index.rs`. Silence it by moving
macros to a separate file.
To be consistent, `define_error!` is also moved.
Differential Revision: D14885746
fbshipit-source-id: d1a518e631f80d6d7945f1ea3c2e4d18e1c799ca
Summary:
While the Rust code can read/write content out of an indexedlog, the Python
code cannot. For now, all the writes will be done in Rust, and the Python code
will only be able to read from it.
Reviewed By: quark-zju
Differential Revision: D14894330
fbshipit-source-id: 5c1698d31412bc93e93dabb93be106a2ef17d184
Summary:
As The IndexedLogDataStore will be used in hg_memcache_client, it needs to be
used in async code, and thus needs an async wrapper.
Note: I should probably rename the crate to "asyncrevisionstore" :)
Reviewed By: quark-zju
Differential Revision: D14881362
fbshipit-source-id: 203ce50954d99899715b32f85e6118e757578ece
Summary:
While not a correctness issue, taking and releasing the repack lock multiple
times per repack makes `hg debugwaitonrepack` unreliable, which in turns makes
test flakey.
Reviewed By: quark-zju
Differential Revision: D14877896
fbshipit-source-id: 682b649f388d19fd51bcf8dd205ac96944039e86
Summary:
We currently send perf traces to the blackbox, but we also want to log
them to our metrics. This configures hg to log the perf trace as a sample. Later
diffs will configure our wrapper to route these samples to manifold.
Reviewed By: mitrandir77
Differential Revision: D14881308
fbshipit-source-id: 07690f9af9fe14279a9ebf5089548c5880cba45d
Summary:
Autorels attempts to detect the scenario where `P -> Q` and `X -> Y` are
being added, and there already exists a `P -> ... -> X` relationship.
In this case it will create a `Q -> Y` "copy" marker to express the fact
that `Q` should be copied.
However, this also triggers in the case where `Q == Y`, creating a revive
marker for `Q`.
Normally this is benign, as Q is probably visible anyway, however when there
are two commits associated with a diff that has been landed, pullcreatemarkers
can create two markers: `P -> L` and `X -> L`. Since P and X are for the same
diff, there probably exists a `P -> ... -> X` relationship, and so autorels
attempts to make an `L -> L` marker. This fails because L is public.
Differential Revision: D14891063
fbshipit-source-id: 3f076a003508dd7b7d17e3eb7cdaeb8ac09e6b15
Summary:
Demonstrate that a combination of autorels and pullcreatemarkers causes an
attempt to obsolete a public commit.
Differential Revision: D14891064
fbshipit-source-id: 29f5cea9c843cc87aef18f74bad11eaabfa7b311
Summary:
With explicit visibility tracking, some commits may be hidden but not obsolete.
Pullcreatemarkers should not include these hidden commits when it is considering
what to link to landed commits.
Differential Revision: D14891062
fbshipit-source-id: 542363c979aca85d6de2e2161c00d91f67f0add3
Summary:
The `subonly` option in the command decorator indicates that a command must be
called with a subcommand. Document this in the decorator documentation.
Differential Revision: D14876782
fbshipit-source-id: d121f94437e47cad2a7f3abe0faac300792c1c76
Summary:
The `tglogm` test function displays a graph log with mutation information.
Use this common function in all tests.
Differential Revision: D14876688
fbshipit-source-id: 2eb29a45b6267d448d292ac13dbfb0135d6fc8e4
Summary:
Add support for explicit visibility tracking in commit cloud sync.
This means commit cloud reads the visibleheads and syncs these with the commit
cloud heads directly, removing the source of problems where obsmarkers disagree
on different hosts.
Commit cloud requires that the ordering of heads is maintained to get stable
ordering of new commits. Update the visibleheads tracking to maintain
ordering, rather than using sets.
Finally, the calculation of the replacement node was slightly off. This was
revealed in the new test case that is being added, so it is also fixed.
Differential Revision: D14876266
fbshipit-source-id: fe5b6bffd196d3bd74e7582e29484969495eac8e
Summary:
The computation of whether a commit is obsolete or not can be improved.
We can cache which commits are known to not be obsolete.
We can also have a cache for each filter type so that we only need to compute
obsolete nodes that match the filter.
Finally, when we need to compute all obsolete commits, we can start by looking
for commits which are made obsolete by only their closest successors, and then
filling back obsolescence to the predecessors of these obsolete commits.
Reviewed By: DurhamG
Differential Revision: D14858655
fbshipit-source-id: 1d03e214ad878ecb6ae548f80373702e2a184146
Summary: The `absorb` command should also record mutation information when it modifies commits.
Reviewed By: DurhamG
Differential Revision: D14871232
fbshipit-source-id: 46bc95b7f5781f0b5f5e057a34c755fcfe653f7e
Summary:
With explicit visibility tracking, the hiddenoverride feature of the amend
extension is no long necessary. When upgrading to explicit visibility,
include the pinned visible commits, however after that point, hiddenoverride
should have no effect.
Users can permanently reveal obsoleted commits using `hg unhide`.
Reviewed By: DurhamG
Differential Revision: D14851269
fbshipit-source-id: b516fa97ed1545d39b51baaf9c574cb73a571645
Summary:
Rather than implicitly upgrading or downgrading a repo based on the
`visibility.tracking` config option, add a new `hg debugvisibility` command to
do this explicitly.
Reviewed By: DurhamG
Differential Revision: D14871231
fbshipit-source-id: 73f4648408b3eca9ac12bd77e54d2d37ee342069
Summary:
When run with `--hidden`, the calculation for `backupheads()` may include extra
commits (ones that are hidden but not obsolete). This can cause some of the old
nodes to apper with "Not backed up" annotations. They should be excluded, too.
Reviewed By: DurhamG
Differential Revision: D14851035
fbshipit-source-id: f176b50a7ac62dc493a5c4df1e0c72532c43b680
Summary:
The pullcreatemarkers extension creates fake markers for landed commits by comparing
the differential revision of draft commits with those of landed commits.
In the future, mutation records will handle lands correctly, however until that stage,
replicate the pullcreatemarkers behaviour.
Reviewed By: DurhamG
Differential Revision: D14834746
fbshipit-source-id: e196ee28645270ccab1775ea896f0e453740c03e
Summary:
In case there are nothing to write, `Log` and `LogRotate` can take
a fast path that does not take directory locks.
Differential Revision: D14885450
fbshipit-source-id: 4d72d5a3e33b7371880ad31f8bc43ed31c03797f
Summary:
The `flush()` function does two things: read and write. It's not just writing
data. Rename it to `sync` to clarify.
`Index::flush` is unchanged because although it might read new data, the new
data is not visible. Calling `Index::flush` without dirty changes does not
cause visible (queriable) changes to the index.
`FlushFilter` is unchanged because it is coupled with the write path. It is
not to filter reading.
The old name is kept temporarily until all pending code gets committed and
we can do a codemod.
Differential Revision: D14885451
fbshipit-source-id: 3aed3b741e5e8f09b611ddcc25930a6fdf71706c
Summary:
The `writable_log` API can be misused to "flush" a Log, bypassing the check
about whether it should be rotated or not.
The real need of `writable_log` is to get accesses to indexes on the "writable"
(or "latest") log. Therefore let's just expose that instead.
Practically, the only use case of querying the index on the "latest" log is to
make sure dependent content are written to a same Log. That also requires a
"flush_filter" to be provided. Therefore add an assertion about it.
Differential Revision: D14866022
fbshipit-source-id: f6c07a498597b6f0f07d7cc3130e9033ba8b9be4
Summary:
Introduce the "flush filter" that can replace content to be written.
This would be useful to make sure delta chains are self-contained.
For LogRotate, flush_filter is trigger not only when the log file
was modified, but also when rotation happens,
Differential Revision: D14866024
fbshipit-source-id: f417200d3ae573e9ac82985ad6afd082412b358d