Summary:
I recently built and installed Sapling on a Windows machine
with few existing developer tools installed on it, so I wanted
to capture the `vcpkg` requirements that were not previously
documented.
Reviewed By: akushner
Differential Revision: D42232827
fbshipit-source-id: e6c9ce74b164b8f552188946a032852e06d03ec7
Summary: Don't use f-string since that precludes use of the i18n framework. Instead, use _() to (potentially) translate the format string, then substitute the format verbs.
Reviewed By: bolinfest
Differential Revision: D42251176
fbshipit-source-id: af7e20d2fc8c81fd04e8c366373c46e333e09635
Summary:
Using the fix in D42230099, regenerate the command docs
for the website.
Pull Request resolved: https://github.com/facebook/sapling/pull/351
Test Plan:
Imported from OSS
Verify that `yarn build` works with the current `.md` file contents.
Reviewed By: zzl0
Differential Revision: D42230100
Pulled By: bolinfest
fbshipit-source-id: b9929bc1fdd4ede3dc032fdc310c4ca10e4a9194
Summary:
We currently have an issue where the generated docs for
`sl pr` produce a line that happens to start with the word `import`.
MDX tries to parse this line as an import statement.
As a quick fix so we can publish the website again,
introduce a simple escaping solution as described on:
https://stackoverflow.com/questions/61188612/escaping-import-and-react-html-to-display-as-text-in-mdx/74096776
Pull Request resolved: https://github.com/facebook/sapling/pull/352
Test Plan:
Imported from OSS
Verified in D42230100
Reviewed By: zzl0
Differential Revision: D42230099
Pulled By: bolinfest
fbshipit-source-id: af2f87e40ed7d71dac5eba7a054f026a1209ec62
Summary:
CommitGraph was already a facet, but it didn't have a builder.
This diff adds it to repo_factory so we can easily build it as needed. It also adds it to test_repo_factory so it's easy to build it for tests.
Reviewed By: YousefSalama
Differential Revision: D42209698
fbshipit-source-id: ee0e4831f809110e564ad11e4f8a9fe088ed22e5
Summary:
I added a very simple backfiller from the current commit graph structure to the new one.
It simply lists changesets in order and adds them to the new structure.
Reviewed By: YousefSalama
Differential Revision: D42208979
fbshipit-source-id: 60875ae6f8dfafafb596f4910bb5a7f21d67cce8
Summary:
First I added a `if cs_ids.is_empty()` early return, which actually fixes an error because SQL doesn't like queries with empty vecs (see P584137849).
I also moved `fetch_many_edges` to `fetch_many_edges_impl` and allowed it to use either the `read_connection` or `read_master_connection`. The default implementation remains the same, but now `fetch_many_edges_required` will look at master read connection if it didn't find something.
This is specially important if we're creating multiple changeset entries sequentially, as they might not be in the read replicas if we read too fast.
Reviewed By: YousefSalama
Differential Revision: D42208978
fbshipit-source-id: e78c64af15402d1cabc7d6e9ec9cc493c457f3df
Summary:
The default casecollisionauditor reads all of dirstate._map by iterating through it. This is expensive for a large repo and eden now raises RuntimeError for the iterator method. Please check D3964461 (73f0e3dd41) for more info.
As Jun pointed out:
* For non-edenfs we would always use treestate, therefore the original `if not dirstate._istreestate and not dirstate._istreedirstate:` check always evaluate to `False`.
* For EdenFS, due to above reason, we should not go into the `then`-part of the if statement.
So we can just delete the `then`-part of the if statement:
```
if not dirstate._istreestate and not dirstate._istreedirstate:
allfiles = "\0".join(dirstate._map)
self._loweredfiles = set(encoding.lower(allfiles).split("\0"))
```
Reviewed By: quark-zju
Differential Revision: D42210487
fbshipit-source-id: 6c5d5daca9dd85deae6505344a4abad2cafb2831
Summary:
Metalog committing should go through the transaction layer. The transaction
layer ensures all metadata are consistently updated atomically, and ensures the
description of metalog is in a certain format.
Let's migrate snapshot to use transaction for metalog write instead.
Reviewed By: yancouto
Differential Revision: D42203509
fbshipit-source-id: b5ecd90c52389add7bdc40ebd383b05bb586470f
Summary:
The command flags of `push` is not obvious. A common mistake is
`push --to remote/main` (which will create a `remote/remote/main` remote
bookmark).
This diff changes the logic to accept `push remote/main`,
`push --to remote/main` or `push default/main` to do the obvious thing for a
better UX.
Reviewed By: muirdm
Differential Revision: D42203177
fbshipit-source-id: d73647823c147dbdbce58c71a04dd4965e8ac2fb
Summary: The forcecompat config is not used. Therefore remove it.
Reviewed By: muirdm
Differential Revision: D42203299
fbshipit-source-id: 36f7b86661e8ecc716f223daf7cefadd7ced76b0
Summary: Refactor the skew binary commit graph methods to allow reusing them with the p1 linear tree.
Reviewed By: yancouto
Differential Revision: D39635155
fbshipit-source-id: 81eb9e6ce370d1831d980310d6e34a9607b7a28a
Summary:
This matches the Git behavior. Update committer and date by default.
`test-git.t` is changed since some commits have committer written by Git with
`test <test@example.org>` and this diff rewrites the committer to `test <>`.
Reviewed By: sggutier
Differential Revision: D42200687
fbshipit-source-id: 0d40ad0868e89cbe0cf932782bfe4f74d42c9e65
Summary: Implemented a method called get_ancestors_difference that given two vectors of ChangesetIds heads and common, returns a vector of ChangesetIds of all changesets that are ancestors of any changeset in heads excluding any ancestor of any changeset in common.
Reviewed By: markbt
Differential Revision: D39479488
fbshipit-source-id: b8b135927f8814b94627fdd5436e1fa01fc679b7
Summary: Refactored tests into a separate library called testlib.
Reviewed By: yancouto
Differential Revision: D39479298
fbshipit-source-id: 2bd3e39a0717c4b121ab23137fa44ea4c05b5ffe
Summary: Implemented the CommitGraphStorage methods fetch_edges, fetch_many_edges and fetch_by_prefix for SqlCommitGraphStorage and their corresponding SQL queries.
Reviewed By: yancouto
Differential Revision: D39479299
fbshipit-source-id: 80451465dd396d370574b1e38871c0fbf5383c10
Summary: Implemented the CommitGraphStorage method add for SqlCommitGraphStorage that insert a new changeset into the storage and the corresponding SQL query.
Reviewed By: yancouto
Differential Revision: D39479300
fbshipit-source-id: 9c049451f0b67386f80e936c7c67d9480be09de6
Summary:
Updates `parseSaplingStackBody()` to keep track of the format
of the PR body that it parsed so that
`stripStackInfoFromSaplingBodyHTML()` can do the right thing
in both cases.
Reviewed By: quark-zju
Differential Revision: D42183664
fbshipit-source-id: 41bb47bfc5034deae357a444fa5816b674a6329b
Summary:
Scp-like git urls like "user@host:path" are common, but Sapling wants proper ssh urls like "ssh://user@host/path". clone already converts to the desired format. Now, "paths" also converts scp-like urls to ssh urls when adding a new remote.
Fixes#196.
Reviewed By: quark-zju
Differential Revision: D42196319
fbshipit-source-id: 3a27027a17fa770ab1291ace654ecff95a63afef
Summary: The existing config editting code didn't look correct in all cases, so let's standardize on rcutil.
Reviewed By: quark-zju
Differential Revision: D42196320
fbshipit-source-id: 2dd325fc527a9b0ecf10827651a3655591e232e5
Summary: Going to use this in next diff.
Reviewed By: quark-zju
Differential Revision: D42196323
fbshipit-source-id: 38e79307213cf850c45dc96c8e87712e0f295518
Summary: When adding a secion.name=value config item, we now check if "[section]" already exists, and if so append the config item. Previously, we always created a new "[section]" entry at the bottom.
Reviewed By: quark-zju
Differential Revision: D42196321
fbshipit-source-id: 94630cee893683f54b5cb4ea954bd19e5ce324c3
Summary:
Querying clocks has a cost. Add a microbenchmark for measuring that
cost on all platforms.
Reviewed By: genevievehelsel
Differential Revision: D42182073
fbshipit-source-id: facb907fc4abed74625e0e28fe3ab63d8335a9fd
Summary: A recently added tripwire check was misfiring for this test. Fix by stripping quotes off the path before testing for absoluteness.
Reviewed By: zzl0
Differential Revision: D42196915
fbshipit-source-id: 7db29dad02f89f7bd27b25cd239c300226e63375
Summary:
Revive the "bookmark --remote" flag to allow querying Git refs. There are some pattern aliases "branches", "tags", and "prs" which can be used for convenience to trim off the leading "refs/*". Or, you can specify "git ls-remote" patterns directly, such as "refs/heads/*", in which case no trimming is done.
Examples:
```
list remote branches:
sl bookmark --remote
list remote tags:
sl bookmark --remote tags
list all refs:
sl bookmark --remote 'refs/*'
list branches from specified path:
sl bookmark --remote --remote-path my-fork
```
I moved the "--remote-path" flag from the infinitepush extension to the remotenames extension so it can be used for choosing the Git remote. remotenames is a required extension, so this should be safe.
Reviewed By: quark-zju
Differential Revision: D42183496
fbshipit-source-id: 58892fe9203ae7471663faef078e37f90199454c
Summary: Now if you give --updaterev/-u a branch name, we will include it in "names" when doing the initial pull. If you specify a 40 byte commit hash, we include it in "nodes". This makes it possible to (easily) clone and goto an arbitrary branch or commit.
Reviewed By: quark-zju
Differential Revision: D42183498
fbshipit-source-id: 4fd821de809501f7a4bc8936b35a886511bd8106
Summary:
We've made a considerable number of changes
since initial launch, so it's about time we bumped this number.
Reviewed By: quark-zju
Differential Revision: D42195925
fbshipit-source-id: 0e758409f016c3d6838ee4b8d5d51fda253e7dde
Summary:
In-memory rebase and on-disk rebase are quite different in terms of code paths
used for submodule handling. Let's run the test cases through both
configurations.
Reviewed By: sggutier
Differential Revision: D42193838
fbshipit-source-id: 9cddb84fad667bb8f2b6334da185e931e3127990
Summary: This will be used by the next change.
Reviewed By: sggutier
Differential Revision: D42193839
fbshipit-source-id: 9c287cd76574cb899031d3fee1e5e832f2c1fd76
Summary:
Move the "showing commit description with submodule commit description" logic
to a function so it can be used in all test cases.
Reviewed By: bolinfest
Differential Revision: D42186691
fbshipit-source-id: a142eb8443b3ace1936556817af68a1287c7b336
Summary:
Rebasing a stack that contains submodule change to the destination with
conflicted submodules should not crash.
The current implementation might be not the final UX. But at least it no longer
crashes.
Reviewed By: bolinfest
Differential Revision: D42184286
fbshipit-source-id: da5bc4a8b4caf60673e159955a0f1153510a9ca3
Summary:
Rebasing a stack that contains submodule change should preserve the change in
the destination, if the destination does not change the submodules.
Reviewed By: bolinfest
Differential Revision: D42184288
fbshipit-source-id: 678a931ece444a008b7d8cb34741e271579469f3
Summary:
Google Benchmark automatically measures iteration time, so there's no
need to manually measure the cost of an operation. Instead, we can
just lift all of the setup work out of the benchmark iteration loop.
This diff also removes use of divisions and floats in the benchmark
loop.
Reviewed By: xavierd
Differential Revision: D42180588
fbshipit-source-id: d51621ed1057acd26e92342c28dfa9f10b0c11be