| @@ -853,6 +853,20 @@ | ||
| 853 | 853 | send("log", { step: "import", line }); |
| 854 | 854 | }); |
| 855 | 855 | |
| 856 | // Create Sapling-style bookmark (gitimport creates "heads/main", Sapling needs "main") | |
| 857 | send("progress", { step: "import", message: "Creating bookmarks..." }); | |
| 858 | ||
| 859 | await runDocker([ | |
| 860 | "run", "--rm", | |
| 861 | "-v", "/data/grove:/data/grove", | |
| 862 | "--entrypoint", "sh", | |
| 863 | "grove/mononoke:latest", | |
| 864 | "-c", | |
| 865 | `CSID=$(admin --config-path ${MONONOKE_CONFIG_PATH} --local-configerator-path ${DATA_DIR}/configerator --cache-mode disabled --just-knobs-config-path ${DATA_DIR}/justknobs.json bookmarks --repo-name ${repoName} list 2>/dev/null | grep 'heads/main' | awk '{print $1}') && admin --config-path ${MONONOKE_CONFIG_PATH} --local-configerator-path ${DATA_DIR}/configerator --cache-mode disabled --just-knobs-config-path ${DATA_DIR}/justknobs.json bookmarks --repo-name ${repoName} set main $CSID`, | |
| 866 | ], (line) => { | |
| 867 | send("log", { step: "import", line }); | |
| 868 | }); | |
| 869 | ||
| 856 | 870 | send("progress", { step: "import", message: "Import complete." }); |
| 857 | 871 | |
| 858 | 872 | // Step 3: Restart Mononoke services |
| 859 | 873 | |
| @@ -229,7 +229,8 @@ | ||
| 229 | 229 | const cloneTmp = join(dir, "..", `.grove-clone-${name}-${Date.now()}`); |
| 230 | 230 | try { |
| 231 | 231 | // Clone into a temp dir, then move .sl into the working dir |
| 232 | execSync(`sl clone slapi:${name} "${cloneTmp}"`, { stdio: "pipe" }); | |
| 232 | // Pass selectivepulldefault so sl clone pulls the right bookmark (default is "master") | |
| 233 | execSync(`sl clone --config remotenames.selectivepulldefault=${gitBranch} slapi:${name} "${cloneTmp}"`, { stdio: "pipe" }); | |
| 233 | 234 | |
| 234 | 235 | // Remove .git and replace with .sl |
| 235 | 236 | rmSync(join(dir, ".git"), { recursive: true, force: true }); |
| @@ -239,6 +240,9 @@ | ||
| 239 | 240 | const config = buildSlConfig({ ...repo, default_branch: gitBranch }, hub); |
| 240 | 241 | writeFileSync(join(dir, ".sl", "config"), config); |
| 241 | 242 | |
| 243 | // Reset dirstate to match existing working copy files | |
| 244 | execSync(`sl goto ${gitBranch} --clean`, { cwd: dir, stdio: "pipe" }); | |
| 245 | ||
| 242 | 246 | s3.stop("Sapling working copy ready"); |
| 243 | 247 | } catch (e: any) { |
| 244 | 248 | s3.stop("Clone failed"); |
| 245 | 249 | |