Skip to content

Commit e75a1f6

Browse files
vilattometa-codesync[bot]
authored andcommitted
Use Python edenfsctl for eden clone
Summary: Switch eden_clone to use the Python edenfsctl (via EdenCmdType::Python / legacy_command config key) for the clone subprocess. This skips the overhead of launching rust cli and falling back to python cli. Reviewed By: janezhang10, genevievehelsel Differential Revision: D99192225 fbshipit-source-id: c71e1ab6d83d10de80f08445ebd2917e5c9a0dcd
1 parent 057f41e commit e75a1f6

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

eden/integration/hg/lib/hg_extension_test_base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ def hg_clone_additional_repo(
202202
"--config",
203203
f"edenfs.command={cmd}",
204204
"--config",
205+
f"edenfs.legacy_command={cmd}",
206+
"--config",
205207
f"edenfs.basepath={self.eden._base_dir}",
206208
*clone_args,
207209
cwd=self.mounts_dir,

eden/scm/lib/clone/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,11 @@ pub fn eden_clone(
157157
) -> Result<()> {
158158
let config = repo.config();
159159

160-
let mut clone_command = edenfs_client::build_eden_command(config)?;
160+
// We don't have `clone` supported in rust edenfs cli for now. Specifying
161+
// python cli to avoid the overhead of falling back.
162+
// We should remove this hack once `clone` is supported in rust.
163+
let mut clone_command =
164+
edenfs_client::build_eden_command_type(config, edenfs_client::EdenCmdType::Python)?;
161165

162166
clone_command.args([
163167
OsStr::new("clone"),

eden/scm/sapling/testing/ext/edenfs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def testsetup(t: TestTmp):
3434
sl_config.write(f"""
3535
[edenfs]
3636
command={edenfsctl_path}
37+
legacy_command={edenfsctl_path}
3738
backing-repos-dir=$TESTTMP/.eden-backing-repos
3839
3940
[clone]

0 commit comments

Comments
 (0)