Commit Graph

79660 Commits

Author SHA1 Message Date
Michael Bolin
fb516c52b3 website: update docs for building on Windows
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
2022-12-27 10:28:30 -08:00
Muir Manders
affbfc224c fix usage of f-string
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
2022-12-27 10:09:50 -08:00
Open Source Bot
fd098b0e6c Updating submodules
Summary:
GitHub commits:

563d1ca546
ec1b4d554a
7af54760dd
ac2e2de0e5

Reviewed By: jurajh-fb

fbshipit-source-id: 36887e91d1e27fda4155db1ca95120aa0f19fe50
2022-12-26 07:00:51 -08:00
Open Source Bot
e32232355d Updating submodules
Summary:
GitHub commits:

c1c4d88c8f
b30d65ae3b
a37238356c
250b7bb94d
1620094de6
306a9ba6ca

Reviewed By: jurajh-fb

fbshipit-source-id: 49d9f416b525f876e6f166eccedf11c8ae07bc2d
2022-12-26 02:07:25 -08:00
Open Source Bot
698cec8906 Updating submodules
Summary:
GitHub commits:

bc25e422e1

Reviewed By: jurajh-fb

fbshipit-source-id: 9c779ffe26608bfe907f543f4a78d329b4c36d1f
2022-12-25 01:50:21 -08:00
Open Source Bot
61f00b00c2 Updating submodules
Summary:
GitHub commits:

9aa90e1b3f

Reviewed By: jurajh-fb

fbshipit-source-id: 34d801e1d0e464e69e90287a32ba52ea3c611be0
2022-12-24 05:16:38 -08:00
Open Source Bot
ae1cdff0b8 Updating submodules
Summary:
GitHub commits:

581285d83e

Reviewed By: jurajh-fb

fbshipit-source-id: e208f2e369805dcc3ca4ea0dc2f37806ea317242
2022-12-23 15:40:49 -08:00
Michael Bolin
1d4bfcaabf Regenerate command docs for website (#351)
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
2022-12-23 15:07:36 -08:00
Michael Bolin
f55b8b3894 temporary fix to website command codegen to work around escaping issue (#352)
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
2022-12-23 15:07:36 -08:00
Open Source Bot
139abea4e2 Updating submodules
Summary:
GitHub commits:

5a6c6e2106

Reviewed By: jurajh-fb

fbshipit-source-id: 2569bbc4d8b916e010048e6cf89cae70c3b0d13b
2022-12-23 14:56:54 -08:00
Open Source Bot
e5b4e7e9b0 Updating submodules
Summary:
GitHub commits:

125938e150
025e55a676

Reviewed By: jurajh-fb

fbshipit-source-id: 295cbcc180d2ab9c1540cb1490c15c9e329817e2
2022-12-23 03:45:45 -08:00
Zhaolong Zhu
b2269eaf31 remotenames: fix test-remotenames-pushto-pathandname.t
Summary: as title

Reviewed By: akushner

Differential Revision: D42224640

fbshipit-source-id: 2263d0ec5c714eb318829c128c928ec6cda726c4
2022-12-23 03:36:10 -08:00
Open Source Bot
9b6a3717f9 Updating submodules
Summary:
GitHub commits:

ac5ddeb9b9
cb41ec7da4
74b72c21c3
93a0678172
7c6050a2b5
80a8857770
1ca2b463f9
45072abd1f
8834abcc61
66631370cc
b9ab9e180b

Reviewed By: jurajh-fb

fbshipit-source-id: 94c732f01198162e03968c411453cbef498b1d43
2022-12-23 03:01:22 -08:00
Yan Soares Couto
0708069664 repo_factory: Add builder for commit_graph
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
2022-12-23 02:25:53 -08:00
Yan Soares Couto
081fdc6a9f Add simple backfiller for commit graph
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
2022-12-23 02:25:53 -08:00
Yan Soares Couto
4328ecb270 commit_graph: Don't query empty lists + query from master on fetch_edges_required
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
2022-12-23 02:25:53 -08:00
Open Source Bot
76d861ec95 Updating submodules
Summary:
GitHub commits:

47cfb9b20d
46cc2d4dbf

Reviewed By: jurajh-fb

fbshipit-source-id: dbd72e55fd5cd32fc7af44ff3295a8d4512eb21a
2022-12-23 02:11:43 -08:00
Open Source Bot
dea3362494 Updating submodules
Summary:
GitHub commits:

47a1d96917
2c7e5ecfcc

Reviewed By: jurajh-fb

fbshipit-source-id: 727c4d574a2bbc481b97a25369bbe96a0ae22ee0
2022-12-22 22:07:25 -08:00
Zhaolong Zhu
a6a66d09ad casecollisionauditor: ignore eden_dirstate_map
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
2022-12-22 15:24:08 -08:00
Jun Wu
01167e3baa snapshot: do not write to metalog directly
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
2022-12-22 13:13:55 -08:00
Jun Wu
9d5a484820 remotenames: translate 'push --to remote/foo' to 'push default --to foo'
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
2022-12-22 13:13:55 -08:00
Jun Wu
4dcde3c343 remotenames: drop forcecompat support
Summary: The forcecompat config is not used. Therefore remove it.

Reviewed By: muirdm

Differential Revision: D42203299

fbshipit-source-id: 36f7b86661e8ecc716f223daf7cefadd7ced76b0
2022-12-22 13:13:55 -08:00
Youssef Ibrahim
7c501efc82 commit_graph: add the logic for calculating the p1_linear_skew_ancestor
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
2022-12-22 08:56:40 -08:00
Jun Wu
7f88efd743 git: update committer information when creating new commits
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
2022-12-22 08:54:54 -08:00
Youssef Ibrahim
47d08bfe40 commit_graph: Implement get_ancestors_difference
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
2022-12-22 08:37:47 -08:00
Youssef Ibrahim
a6b3e69d33 sql_commit_graph: test SqlCommitGraphStorage using testlib
Summary: Hook up SqlCommitGraphStorage to testlib.

Reviewed By: yancouto

Differential Revision: D39479297

fbshipit-source-id: 1cdffc1547f46a9ed14c7d6be3868c6f5bf83a1f
2022-12-22 08:14:32 -08:00
Youssef Ibrahim
7207786317 commit_graph: refactor tests to allow reuse between different CommitGraphStorages
Summary: Refactored tests into a separate library called testlib.

Reviewed By: yancouto

Differential Revision: D39479298

fbshipit-source-id: 2bd3e39a0717c4b121ab23137fa44ea4c05b5ffe
2022-12-22 07:32:33 -08:00
Youssef Ibrahim
4d6595698a sql_commit_graph: implement fetching changesets
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
2022-12-22 06:58:55 -08:00
Youssef Ibrahim
7525acd8ec sql_commit_graph: implement insertion of new changesets
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
2022-12-22 06:06:10 -08:00
Michael Bolin
f32ae61f72 reviewstack: fix parsing logic to hide stack info from PR body
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
2022-12-21 21:32:14 -08:00
Open Source Bot
cc3b2901d6 Updating submodules
Summary:
GitHub commits:

b4ecb134f9
f18aa662bd
f5673abe83

Reviewed By: jurajh-fb

fbshipit-source-id: 446a9639383ab180ae4b24ccc14a544ee08f74fe
2022-12-21 20:04:13 -08:00
Muir Manders
67fa8488e1 paths: normalized scp-like git urls
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
2022-12-21 19:08:24 -08:00
Muir Manders
f2078085a1 paths: use rcutil to edit "[paths]" config
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
2022-12-21 19:08:24 -08:00
Muir Manders
77fa228f5b rcutil: support deleting config items
Summary: Going to use this in next diff.

Reviewed By: quark-zju

Differential Revision: D42196323

fbshipit-source-id: 38e79307213cf850c45dc96c8e87712e0f295518
2022-12-21 19:08:24 -08:00
Muir Manders
58331d4925 rcutil: support adding config items to existing sections
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
2022-12-21 19:08:24 -08:00
Muir Manders
1b74d35598 scmposix: kill some dead code
Reviewed By: quark-zju

Differential Revision: D42196322

fbshipit-source-id: 04915727e086f3f1f214441605a9df5d0610ecba
2022-12-21 19:08:24 -08:00
kurtz.brandon@gmail.com
2a7fa80c65 surface output in addition to exit code if ghstack shell command fails (#340)
Summary:
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/sapling/pull/340).
* __->__ https://github.com/facebook/sapling/issues/340

surface output in addition to exit code if ghstack shell command fails

Pull Request resolved: https://github.com/facebook/sapling/pull/340

Reviewed By: mitrandir77

Differential Revision: D42198530

Pulled By: bolinfest

fbshipit-source-id: 2fc0422e3eb95e715f162320d8c88e9696ef883b
2022-12-21 14:57:46 -08:00
Chad Austin
f0e16a3f02 add a benchmark for standard std::chrono clocks
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
2022-12-21 14:44:54 -08:00
Muir Manders
d934cb3715 fix test-merge-halt.t on Windows
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
2022-12-21 14:06:50 -08:00
Muir Manders
e8f57d7902 bookmark: support querying remote Git refs
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
2022-12-21 13:50:31 -08:00
Muir Manders
9804c66bb8 clone: improve "-u" for git repos
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
2022-12-21 13:50:31 -08:00
Muir Manders
159fe07e6d node: remove Python 2 support
Reviewed By: quark-zju

Differential Revision: D42183497

fbshipit-source-id: 069fe3dd1a319dd428ed0ebc1e5a6ee8c0e228cc
2022-12-21 13:50:31 -08:00
Open Source Bot
4c68fd1c71 Updating submodules
Summary:
GitHub commits:

c0fd6e8542
f8969ad7d4
8a2810b464

Reviewed By: jurajh-fb

fbshipit-source-id: 3054faf19d559411212bdcdd14bbcbec310d028e
2022-12-21 13:10:19 -08:00
Michael Bolin
a3475b3a43 bump SAPLING_VERSION from 0.1 to 0.2 in preparation for the next release
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
2022-12-21 12:23:53 -08:00
Jun Wu
a0a1aac26b test-git-submodule-rebase: check in-memory rebases
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
2022-12-21 10:58:58 -08:00
Jun Wu
0d8667f03b testing: add 'py' builtin to get python values from shell
Summary: This will be used by the next change.

Reviewed By: sggutier

Differential Revision: D42193839

fbshipit-source-id: 9c287cd76574cb899031d3fee1e5e832f2c1fd76
2022-12-21 10:58:58 -08:00
Jun Wu
59426d7e91 test-git-submodule-rebase: remove duplicated logic
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
2022-12-21 10:58:58 -08:00
Jun Wu
2b94b6f941 git: fix rebasing conflicted submodule changes
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
2022-12-21 10:58:58 -08:00
Jun Wu
1f5424d83c git: fix rebasing submodule changes
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
2022-12-21 10:58:58 -08:00
Chad Austin
412faa4594 clean up timing of ObjectCache benchmarks
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
2022-12-21 10:46:20 -08:00