### Recommended Test Setup with newclientrepo Source: https://github.com/facebook/sapling/blob/main/website/docs/dev/process/writing_tests.md Example of setting up a new client repository for testing using `newclientrepo`. ```bash $ newclientrepo <<'EOS' > B > | > A > EOS This is a comment $ touch something $ hg st # this is another comment ? something $ hg go $A -q ``` -------------------------------- ### Example GET Request for Capabilities Source: https://github.com/facebook/sapling/blob/main/eden/scm/sapling/help/internals/wireprotocol.txt Illustrates a GET request to fetch repository capabilities using the 'cmd' query parameter. ```http GET /repo?cmd=capabilities ``` -------------------------------- ### Run Example Server Source: https://github.com/facebook/sapling/blob/main/common/rust/shed/tokio-uds-compat/README.md Use this command to run the provided example server. ```bash cargo run --example server ``` -------------------------------- ### Initial Commit Graph Example Source: https://github.com/facebook/sapling/blob/main/website/docs/overview/rebase.md This example displays the initial commit graph before any rebase operations are performed. It serves as a reference for understanding the subsequent rebase examples. ```sl-shell $ sl o d78f66e01 106 seconds ago remote/main ╷ ╷ o 306ce5ffb 67 seconds ago mary ╷ │ Commit F ╷ │ ╷ o 2ff5f28a1 67 seconds ago mary ╷ │ Commit E ╷ │ ╷ │ o e5513dac4 67 seconds ago mary ╷ │ │ Commit D ╷ │ │ ╷ │ @ 6f782187a 67 seconds ago mary ╷ ├─╯ Commit C ╷ │ ╷ o 3beadc099 67 seconds ago mary ╷ │ Commit B ╷ │ ╷ o b48ce5c8e 67 seconds ago mary ╭─╯ Commit A │ o 17af69994 Today at 08:33 remote/stable ╷ ~ ``` -------------------------------- ### Basic Sapling Installation Source: https://github.com/facebook/sapling/blob/main/eden/scm/README.md Installs Sapling using make and provides commands to check the installation and view help. ```bash $ make install-oss $ sl debuginstall # sanity-check setup $ sl --help # see help ``` -------------------------------- ### Install ReviewStack Dependencies Source: https://github.com/facebook/sapling/blob/main/eden/contrib/reviewstack/README.md Run this command in the `eden/contrib/reviewstack` folder to install all necessary project dependencies. ```bash yarn ``` -------------------------------- ### Start Mononoke Server Source: https://github.com/facebook/sapling/blob/main/eden/mononoke/docs/local-dev-testing.md Navigate to the Mononoke instance directory and start the Mononoke server. It runs in the foreground. ```bash cd ~/local/mymononoke ./bin/mononoke.sh ``` -------------------------------- ### Start ReviewStack Local Server Source: https://github.com/facebook/sapling/blob/main/eden/contrib/reviewstack/README.md Run this command in the `eden/contrib/reviewstack.dev` folder to start a local instance of the ReviewStack development server. ```bash yarn start ``` -------------------------------- ### Install Manifold CLI Source: https://github.com/facebook/sapling/blob/main/eden/mononoke/docs/gitimport_from_bundle_pipeline_guide.md Installs the Manifold CLI tool. Verify its installation by checking the help command. ```bash sudo dnf install fb-manifold manifold --help ``` -------------------------------- ### Install edenfs Executable Source: https://github.com/facebook/sapling/blob/main/eden/fs/CMakeLists.txt Installs the edenfs executable to the bin directory at runtime. ```cmake install(TARGETS edenfs RUNTIME DESTINATION bin) ``` -------------------------------- ### Install Arcanist Tools Source: https://github.com/facebook/sapling/blob/main/eden/mononoke/docs/gitimport_from_bundle_pipeline_guide.md Install the 'arc' command-line tools on Fedora systems. ```bash sudo dnf install fb-arcanist ``` -------------------------------- ### Start ISL in Development Mode Source: https://github.com/facebook/sapling/blob/main/addons/isl/README.md Run this command from the `addons/` folder to start ISL in development mode. It builds the client and server, and spawns a local server instance that opens ISL in your browser. Use `--launch /path/to/my/repo` to specify a different repository. ```bash yarn dev browser --launch . ``` -------------------------------- ### Start VS Code Extension Development Source: https://github.com/facebook/sapling/blob/main/addons/isl/README.md Run this command from the `addons/` folder to start the VS Code extension development environment for ISL. It builds the webview and extension, and launches VS Code in extension development mode. ```bash yarn dev vscode --launch . ``` -------------------------------- ### Start SCS Server Source: https://github.com/facebook/sapling/blob/main/eden/mononoke/docs/local-dev-testing.md In a separate terminal or tmux pane, start the SCS server for Thrift access. Ensure you are in the Mononoke instance directory. ```bash cd ~/local/mymononoke ./bin/scs-server.sh ``` -------------------------------- ### Example hgsql Server Configuration Source: https://github.com/facebook/sapling/blob/main/eden/scm/doc/hgsql/README.md This is an example server configuration for hgsql. Ensure sensitive information like passwords are not stored in plain text in production environments. ```ini [hgsql] database = mydatabase enabled = True host = localhost password = aaa port = 12345 reponame = myreponame user = mysqluser ``` -------------------------------- ### Cache Configuration Example Source: https://github.com/facebook/sapling/blob/main/eden/mononoke/docs/1.3-architecture-overview.md Demonstrates how to control Mononoke's caching behavior using command-line flags. This example shows setting the cache mode to 'local-only'. ```bash --cache-mode=local-only ``` -------------------------------- ### Get Help for a Specific Debug Command Source: https://github.com/facebook/sapling/blob/main/eden/scm/newdoc/dev/process/DebuggingFeatures.md Use `hg help ` to get detailed documentation for a specific debug command. For example, `hg help debugstate` provides information on the `debugstate` command. ```bash > hg help debugstate hg debugstate show the contents of the current dirstate use "hg -v help debugstate" to show global options ``` -------------------------------- ### Implement Initial Repo Setup Source: https://github.com/facebook/sapling/blob/main/eden/integration/README.md Define the initial directory and file structure for your test by overriding the `populate_backing_repo` function. ```python def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: raise NotImplementedError( "individual test classes must implement " "populate_backing_repo()" ) ``` -------------------------------- ### Creating and Inspecting a New Repository Source: https://github.com/facebook/sapling/blob/main/website/docs/dev/process/writing_tests.md Demonstrates creating a new repository with `newclientrepo` and checking its default name and server configuration. ```bash $ newclientrepo $ pwd # the name of the repo is repo by default $TESTTMP/repo1 $ hg config paths.default # similarly, the repo names are repo test:repo1_server ``` -------------------------------- ### Get Manifest ID with Mercurial Source: https://github.com/facebook/sapling/blob/main/eden/scm/newdoc/notes/201910-manifests-past-and-future.md Example of retrieving a manifest ID for a specific commit using Mercurial's debugdata command. ```default $ hg debugdata -c 2a18a529f6f01e3dd7505c401e20d87acbc05d7c 3fdb1f4ac9ffff62ceefccb4cacfae7fe15a2998 <- the corresponding manifest id Testy McTest ... ``` -------------------------------- ### Sapling Transaction Example Source: https://github.com/facebook/sapling/blob/main/website/docs/dev/internals/metalog.md Demonstrates how to use MetaLog within a Sapling transaction. Reloads the latest MetaLog root at the start and writes changes at the end. ```python with repo.lock(), repo.transaction("transaction-name") as tr: ... ``` -------------------------------- ### Python ZstDelta Diff and Apply Example Source: https://github.com/facebook/sapling/blob/main/website/docs/dev/internals/zstdelta.md Demonstrates calculating a compressed delta between two byte strings and applying it to restore the original content using the Python bindings for zstd. Ensure the bindings are installed. ```python >>> import bindings, hashlib >>> a = b".".join(hashlib.sha256(str(i).encode()).digest() for i in range(1000)) >>> len(a) >>> b = a[:10000] + b'x' * 10000 + a[11000:] >>> diff = bindings.zstd.diff(a, b) >>> len(diff) >>> bindings.zstd.apply(a, diff) == b ``` -------------------------------- ### Initializing client repositories with newclientrepo Source: https://github.com/facebook/sapling/blob/main/website/docs/dev/process/writing_tests.md Shows how to use the `newclientrepo` function to create new repositories, optionally specifying custom server names and navigating into them. ```shell $ newclientrepo foo $ newclientrepo bar test:customservername $ cd $TESTTMP/foo # this goes back to the foo repo ``` -------------------------------- ### Verify GPGSM Installation Source: https://github.com/facebook/sapling/blob/main/website/docs/git/signing.md Check if gpgsm is installed and available. On macOS, you can install it via Homebrew. ```sh gpgsm --version ``` -------------------------------- ### Using tinit.sh functions for test setup Source: https://github.com/facebook/sapling/blob/main/website/docs/dev/process/writing_tests.md Demonstrates how to use helper functions from tinit.sh to simplify test configurations and repository initialization. ```shell Use functions in tinit.sh: $ setconfig lfs.url=file://$TESTTMP/lfs lfs.threshold=10B $ enable lfs rebase $ newrepo ``` ```shell $ cat >> $HGRCPATH << EOF > [extensions] > lfs= > rebase= > [lfs] > url=file://$TESTTMP/lfs > threshold=10B > EOF $ hg init repo1 $ cd repo1 ``` -------------------------------- ### Initial Push with --create Flag Source: https://github.com/facebook/sapling/blob/main/eden/mononoke/docs/local-dev-testing.md Use the --create flag on the first push to resolve 'abort: could not find remote bookmark 'main'' errors. ```bash hg push --to main --force --create ``` -------------------------------- ### Build and Install macOS Executable Source: https://github.com/facebook/sapling/blob/main/eden/scm/exec/eden_apfs_mount_helper/CMakeLists.txt Defines and installs the eden_apfs_mount_helper executable on macOS systems. This ensures the tool is available in the 'bin' directory after installation. ```cmake IF(CMAKE_SYSTEM_NAME STREQUAL Darwin) rust_executable(eden_apfs_mount_helper) install_rust_executable( eden_apfs_mount_helper DESTINATION "bin" ) ENDIF() ``` -------------------------------- ### Flat Manifest Content Example Source: https://github.com/facebook/sapling/blob/main/eden/scm/newdoc/notes/201910-manifests-past-and-future.md Demonstrates the content of a flat manifest, showing file paths and their associated IDs and flags. ```default $ hg debugdata -m ffb23329f6f01e3dd7505c401e20d87acbc00a33 analytics/abtest.pig 06763db6de79098e8cdf14726ca506fdf16749be**x** analytics/traffic.pig ecf027f3b56bf7fadf8e3dd75cfcd67d8b58deb1**x** assets/banner.jpg 5ac863e17c7035f1d11828d848fb2ca450d89794 assets/icons.jpg edd628e83c50e15004dce0207aaab63f8ceb8c97 index.php 78f7c038716f258f451528e1e8241d895419f2ee signup.php 2943e43127ba9d2e2bdd4627a36787d0b56b5e6b ``` -------------------------------- ### Sample System Configuration (/etc/eden/edenfs.rc) Source: https://github.com/facebook/sapling/blob/main/eden/fs/docs/Config.md This snippet shows a sample system configuration file using an INI-like format. It defines settings for the 'overlay' and 'experimental' sections. ```ini [overlay] buffered = true inode-catalog-type = "lmdb" [experimental] enable-nfs-server = false ``` -------------------------------- ### Generate Get Project V2 Args Source: https://github.com/facebook/sapling/blob/main/eden/mononoke/git/git_types/test_data/target_object.txt Generates Thrift-compatible iodata for the arguments of the get project V2 service call. It includes the get project request. ```erlang -spec gen_crypto_v2_manager_service_get_project_v2_args(X :: crypto_v2_manager_service_get_project_v2_args()) -> iodata(). gen_crypto_v2_manager_service_get_project_v2_args(X) -> S0 = thrift_runtime:gen_struct_begin(), S1 = case maps:get(request, X, undefined) of 'undefined' -> S0; VV0 -> thrift_runtime:gen_field(S0, 1, ?CP_STRUCT, gen_get_project_request_v2(VV0)) end, thrift_runtime:gen_struct_end(S1). ``` -------------------------------- ### Setup for Incremental Integration Tests Source: https://github.com/facebook/sapling/blob/main/eden/mononoke/tests/integration/README.md Build all necessary dependencies once for integration tests to enable incremental rebuilds. Specify the server component and optionally build in opt mode. ```sh ./incremental_integration_setup.sh server/server ``` ```sh ./incremental_integration_setup.sh server/server @mode/opt ``` -------------------------------- ### Build Sapling on FreeBSD Source: https://github.com/facebook/sapling/blob/main/website/docs/introduction/installation.md Install necessary packages like GNU Make and terminfo-db, set the TERMINFO environment variable, clone the repository, and then build using gmake. ```bash pkg install gmake terminfo-db export TERMINFO=/usr/local/share/terminfo git clone ${gitHubRepo} cd ${gitHubRepoName}/eden/scm gmake oss ./sl --help ``` -------------------------------- ### Fold commits between two revisions Source: https://github.com/facebook/sapling/blob/main/website/docs/commands/fold.md Use `--from ::` to fold all commits linearly between the specified start and end revisions into the current commit. The range is inclusive of the start and exclusive of the end. ```bash sl fold --from e254371c1::be57079e4 ``` -------------------------------- ### Example Blobstore Stack Composition Source: https://github.com/facebook/sapling/blob/main/eden/mononoke/docs/2.4-storage-architecture.md Illustrates a typical production blobstore stack, showing how decorators are layered to provide specific functionalities from application access down to backend storage. ```text Application (repo attributes, features, etc.) ↓ Prefixblob (adds repo-specific key prefix) ↓ Cacheblob (memcache + cachelib caching) ↓ Multiplexedblob (write to multiple backends) ↓ Packblob (compression) ↓ Backend storage (sqlblob, manifoldblob, or s3blob) ``` -------------------------------- ### Verify Sapling Installation (Windows) Source: https://github.com/facebook/sapling/blob/main/website/docs/introduction/installation.md Verify that Sapling is installed and accessible from your command line by checking its version. ```powershell sl --version ``` -------------------------------- ### Show Sapling Installation Directory with getdeps Source: https://github.com/facebook/sapling/blob/main/eden/scm/README.md Retrieves the installation directory for Sapling binaries built with getdeps. ```bash ./build/fbcode_builder/getdeps.py show-inst-dir --allow-system-packages --src-dir=. sapling ``` -------------------------------- ### Running Tests with EdenFS Enabled via Buck2 Source: https://github.com/facebook/sapling/blob/main/website/docs/dev/process/writing_tests.md Example of how to run a .t test with EdenFS enabled using the `buck2` build system. ```bash # Runs test-rust-checkout.t with EdenFS enabled $ buck2 test '@fbcode//mode/opt' :sl_edenfs_run_tests -- test_rust_checkout_t ``` -------------------------------- ### Launch Sapling Web Server Source: https://github.com/facebook/sapling/blob/main/website/docs/addons/isl.md Start the Sapling Web server to access the Interactive Smartlog UI. This command opens the UI in a local browser by default. ```bash sl web ``` -------------------------------- ### Install Dependencies for Docusaurus Source: https://github.com/facebook/sapling/blob/main/website/src/plugins/sapling-output/README.md Run `yarn install` within your Docusaurus project to apply code changes from this plugin. ```shell yarn install ``` -------------------------------- ### Run Sapling Without Installation Source: https://github.com/facebook/sapling/blob/main/eden/scm/README.md Builds Sapling for in-place usage and checks the version without a formal installation. ```bash $ make oss # build for inplace usage $ ./sl --version # should show the latest version ``` -------------------------------- ### Configure X.509 Signing Backend with Separate Cert and Key Source: https://github.com/facebook/sapling/blob/main/website/docs/git/signing.md Recommended [signing] configuration for X.509 backend when certificate and private key are in separate files. ```ini [signing] backend = x509 key = ~/certs/private-key.pem x509.certfile = ~/certs/certificate.pem ``` -------------------------------- ### Check Installed EdenFS RPM Source: https://github.com/facebook/sapling/blob/main/eden/docs/Engineering/Repo_Support_On_Remote_Execution/manage_eden_release.md After logging into an RE agent task, use this command to query the installed fb-eden package version. ```bash [06:09:10 root@tsp_cco/remote_execution/scm_agent.prod/0 ~]$ rpm -q fb-eden fb-eden-20250310-234332.x86_64 ``` -------------------------------- ### Build Sapling on macOS or Linux Source: https://github.com/facebook/sapling/blob/main/website/docs/introduction/installation.md Clone the repository, navigate to the source directory, and run the build command. Finally, verify the installation with the help command. ```bash git clone ${gitHubRepo} cd ${gitHubRepoName}/eden/scm make oss ./sl --help ``` -------------------------------- ### Crypto V2 Manager Service Get All Projects V2 Args Source: https://github.com/facebook/sapling/blob/main/eden/mononoke/git/git_types/test_data/target_object.txt Arguments for the Get All Projects V2 service operation. ```APIDOC ## crypto_v2_manager_service_get_all_projects_v2_args ### Description Arguments structure for the `get_all_projects_v2` service call. This operation does not require any specific arguments. ``` -------------------------------- ### Crypto V2 Manager Service Get Project V2 Args Source: https://github.com/facebook/sapling/blob/main/eden/mononoke/git/git_types/test_data/target_object.txt Arguments for the Get Project V2 service operation. ```APIDOC ## crypto_v2_manager_service_get_project_v2_args ### Description Arguments structure for the `get_project_v2` service call. ### Fields - **request** (default_crypto_v2_manager_get_project_request_v2) - Required - The project retrieval request payload. ``` -------------------------------- ### Running Tests with Watchman Enabled via Buck2 Source: https://github.com/facebook/sapling/blob/main/website/docs/dev/process/writing_tests.md Example of how to run a .t test with Watchman enabled using the `buck2` build system. ```bash # Runs test-rust-checkout.t with Watchman enabled $ buck2 test '@fbcode//mode/opt' :sl_watchman_run_tests -- test_rust_checkout_t ``` -------------------------------- ### Run hgsql Tests Source: https://github.com/facebook/sapling/blob/main/eden/scm/doc/hgsql/README.md To run the hgsql tests, first configure the database connection details in `getdb.sh.example` and then execute the tests. ```bash cd tests ./run-tests.py test-hgsql-*.t ``` -------------------------------- ### Basic .t Test Example Source: https://github.com/facebook/sapling/blob/main/website/docs/dev/process/writing_tests.md A simple .t test demonstrating command execution and output verification. ```bash Test 'echo' works. This line is a comment. $ echo A A ``` -------------------------------- ### Install System Dependencies for getdeps Build Source: https://github.com/facebook/sapling/blob/main/eden/scm/README.md Installs required system packages for a getdeps build of Sapling. Ensure you have the necessary permissions. ```bash ./build/fbcode_builder/getdeps.py install-system-deps --recursive sapling ``` -------------------------------- ### Generate Get All Projects Response V2 Source: https://github.com/facebook/sapling/blob/main/eden/mononoke/git/git_types/test_data/target_object.txt Generates Thrift-compatible iodata for the get all projects response. It serializes a list of projects with their keys. ```erlang -spec gen_get_all_projects_response_v2(X :: get_all_projects_response_v2()) -> iodata(). gen_get_all_projects_response_v2(X = #crypto_v2_manager_get_all_projects_response_v2{}) -> S0 = thrift_runtime:gen_struct_begin(), S1 = case S1In = X#crypto_v2_manager_get_all_projects_response_v2.projects of 'undefined' -> S0; _ -> thrift_runtime:gen_field(S0, 1, ?CP_LIST, thrift_runtime:gen_list(?CP_STRUCT, [thrift_crypto_v2_if_crypto_v2:gen_tproject_with_keys(X0) || X0 <- S1In])) end, thrift_runtime:gen_struct_end(S1). ``` -------------------------------- ### Configure Patch Binary Path (Windows) Source: https://github.com/facebook/sapling/blob/main/eden/scm/contrib/vim/patchreview.txt Specify the full path to the patch binary if it's not on the system path. This example is for Windows with Cygwin. ```vim let g:patchreview_patch = 'c:\\cygwin\\bin\\patch.exe' ``` -------------------------------- ### Clone Repository and Create Commits Source: https://github.com/facebook/sapling/blob/main/eden/mononoke/docs/local-dev-testing.md Clone the repository and create initial commits. The first commit requires the --create flag. Subsequent commits add new files and push to main. ```bash ./bin/hg-clone.sh cd hg # First commit needs --create echo "base" > base.txt hg add base.txt hg commit -m "Base commit" hg push --to main --force --create # Subsequent commits echo "hello" > hello.txt hg add hello.txt hg commit -m "Add hello.txt" hg push --to main --force ``` -------------------------------- ### DrawDag Basic Hexagon Example Source: https://github.com/facebook/sapling/blob/main/website/docs/dev/internals/drawdag.md A DrawDag code example that visually forms a hexagon shape, generating a corresponding commit graph. ```drawdag -B- / \ A--C--D \ / E-F ``` -------------------------------- ### Install Sapling from Local Bottle (macOS) Source: https://github.com/facebook/sapling/blob/main/website/docs/introduction/installation.md Install Sapling from a downloaded bottle on macOS using Homebrew. Ensure you have downloaded the bottle first. ```bash HOMEBREW_DEVELOPER=1 brew install ./{macArmAsset.name} ``` -------------------------------- ### Sample Dynamic System Configuration (/etc/eden/edenfs_dynamic.rc) Source: https://github.com/facebook/sapling/blob/main/eden/fs/docs/Config.md This snippet demonstrates a dynamic system configuration file that overrides specific settings from other system configuration files. It modifies the 'enable-nfs-server' option within the 'experimental' section. ```ini [experimental] enable-nfs-server = true ``` -------------------------------- ### Sample User Configuration (~/.edenrc) Source: https://github.com/facebook/sapling/blob/main/eden/fs/docs/Config.md This snippet illustrates a user-specific configuration file in TOML format. It allows users to override system settings, such as 'readdir-prefetch' in the 'mount' section. ```toml [mount] readdir-prefetch = "trees" ``` -------------------------------- ### Integer to Atom Conversion for Get Project Request Mode Source: https://github.com/facebook/sapling/blob/main/eden/mononoke/git/git_types/test_data/target_object.txt Converts an integer representation of the get project request mode to its atom equivalent. ```APIDOC ## tget_project_request_mode_integer_to_atom(Code) ### Description Converts an integer `Code` into its corresponding atom representation for `tget_project_request_mode`. ### Parameters - **Code** (integer()) - The integer code to convert. ### Returns - `tget_project_request_mode()` - The atom representation of the request mode. ``` -------------------------------- ### Configure X.509 Signing Backend with OpenSSL Source: https://github.com/facebook/sapling/blob/main/website/docs/git/signing.md Recommended [signing] configuration for X.509 (S/MIME) backend using OpenSSL, specifying the PEM file path. ```ini [signing] backend = x509 key = ~/certs/signing.pem ``` -------------------------------- ### Spec Get Project Response V2 Source: https://github.com/facebook/sapling/blob/main/eden/mononoke/git/git_types/test_data/target_object.txt Defines the Thrift specification for the get project response v2 structure, including the project with keys. ```erlang -spec spec_get_project_response_v2() -> {struct, thrift_decode:struct_config()}. spec_get_project_response_v2() -> Types = #{ 1 => {#crypto_v2_manager_get_project_response_v2.project_with_keys, fun thrift_crypto_v2_if_crypto_v2:spec_tproject_with_keys/0} }, {struct, {record, Types, crypto_v2_manager_get_project_response_v2, record_info(size, crypto_v2_manager_get_project_response_v2), [], [], #{}}}. ``` -------------------------------- ### Parse Get Project Response V2 Source: https://github.com/facebook/sapling/blob/main/eden/mononoke/git/git_types/test_data/target_object.txt Parses the entire get project response v2 structure. Ensures no trailing bytes after parsing. ```erlang -spec parse_get_project_response_v2(X :: binary()) -> get_project_response_v2(). parse_get_project_response_v2(X) -> {Res, Rest} = value_parse_get_project_response_v2(X), Rest =:= <<>> orelse thrift_runtime:error_trailing_bytes(Rest), Res. ``` ```erlang -spec value_parse_get_project_response_v2(X :: binary()) -> {get_project_response_v2(), Rest :: binary()}. value_parse_get_project_response_v2(X) -> {Struct, Rest} = fields_parse_get_project_response_v2(X, 0, #crypto_v2_manager_get_project_response_v2{}), {Struct, Rest}. ``` -------------------------------- ### Build Sapling on Windows Source: https://github.com/facebook/sapling/blob/main/website/docs/introduction/installation.md Clone the repository, configure Git for long paths, execute the Windows build script, and then test with the generated executable. ```bash git clone ${gitHubRepo} cd ${gitHubRepoName}/eden/scm git config --system core.longpaths true python3 .\packaging\windows\build_windows_zip.py .\build\embedded\sl.exe --help ``` -------------------------------- ### Basic .t Test Structure Source: https://github.com/facebook/sapling/blob/main/eden/scm/tests/README.md Demonstrates the fundamental structure of a .t test file, including setting up a new repository, creating and committing files, and verifying status. ```bash Test description here $ newclientrepo Create some files: $ echo "hello" > file1.txt $ hg add file1.txt $ hg commit -m "initial" Verify status is clean: $ hg status Test modification: $ echo "world" >> file1.txt $ hg status M file1.txt Test with commit graph: $ newclientrepo <<'EOS' > B > | > A > EOS $ hg log -r "all()" -T "{desc}\n" A B ``` -------------------------------- ### Parse Get Project Request V2 Source: https://github.com/facebook/sapling/blob/main/eden/mononoke/git/git_types/test_data/target_object.txt Parses the entire get project request v2 structure. Validates that there are no extra bytes after parsing. ```erlang -spec parse_get_project_request_v2(X :: binary()) -> get_project_request_v2(). parse_get_project_request_v2(X) -> {Res, Rest} = value_parse_get_project_request_v2(X), Rest =:= <<>> orelse thrift_runtime:error_trailing_bytes(Rest), Res. ``` ```erlang -spec value_parse_get_project_request_v2(X :: binary()) -> {get_project_request_v2(), Rest :: binary()}. value_parse_get_project_request_v2(X) -> {Struct, Rest} = fields_parse_get_project_request_v2(X, 0, #crypto_v2_manager_get_project_request_v2{}), {Struct, Rest}. ``` -------------------------------- ### Get a NUL separated list of added files Source: https://github.com/facebook/sapling/blob/main/website/docs/commands/status.md Use `-an0` to get a NUL-separated list of added files, which is suitable for piping to `xargs`. ```bash sl status -an0 ``` -------------------------------- ### Crypto V2 Manager Service Multi Get Projects V2 Args Source: https://github.com/facebook/sapling/blob/main/eden/mononoke/git/git_types/test_data/target_object.txt Arguments for the Multi Get Projects V2 service operation. ```APIDOC ## crypto_v2_manager_service_multi_get_projects_v2_args ### Description Arguments structure for the `multi_get_projects_v2` service call. ### Fields - **request** (default_crypto_v2_manager_multi_get_projects_request_v2) - Required - The multi-project retrieval request payload. ```