Merge pull request #941 from RooVetGit/bring_back_checkpoints_for_windows

Bring back checkpoints on Windows
This commit is contained in:
Matt Rubens 2025-02-11 11:19:23 -05:00 committed by GitHub
commit 630c2e59eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 20 additions and 40 deletions

View file

@ -143,7 +143,7 @@ export class Cline {
this.fuzzyMatchThreshold = fuzzyMatchThreshold ?? 1.0
this.providerRef = new WeakRef(provider)
this.diffViewProvider = new DiffViewProvider(cwd)
this.checkpointsEnabled = process.platform !== "win32" && !!enableCheckpoints
this.checkpointsEnabled = enableCheckpoints ?? false
if (historyItem) {
this.taskId = historyItem.id

View file

@ -312,10 +312,6 @@ export class CheckpointService {
}
public static async create({ taskId, git, baseDir, log = console.log }: CheckpointServiceOptions) {
if (process.platform === "win32") {
throw new Error("Checkpoints are not supported on Windows.")
}
git = git || simpleGit({ baseDir })
const version = await git.version()

View file

@ -14,7 +14,6 @@ describe("CheckpointService", () => {
let git: SimpleGit
let testFile: string
let service: CheckpointService
let originalPlatform: string
const initRepo = async ({
baseDir,
@ -49,19 +48,6 @@ describe("CheckpointService", () => {
return { git, testFile }
}
beforeAll(() => {
originalPlatform = process.platform
Object.defineProperty(process, "platform", {
value: "darwin",
})
})
afterAll(() => {
Object.defineProperty(process, "platform", {
value: originalPlatform,
})
})
beforeEach(async () => {
const baseDir = path.join(os.tmpdir(), `checkpoint-service-test-${Date.now()}`)
const repo = await initRepo({ baseDir })

View file

@ -701,29 +701,27 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
</div>
)}
{process.platform !== "win32" && (
<div style={{ marginBottom: 15 }}>
<div style={{ display: "flex", alignItems: "center", gap: "5px" }}>
<span style={{ color: "var(--vscode-errorForeground)" }}></span>
<VSCodeCheckbox
checked={checkpointsEnabled}
onChange={(e: any) => {
setCheckpointsEnabled(e.target.checked)
}}>
<span style={{ fontWeight: "500" }}>Enable experimental checkpoints</span>
</VSCodeCheckbox>
</div>
<p
style={{
fontSize: "12px",
marginTop: "5px",
color: "var(--vscode-descriptionForeground)",
<div style={{ marginBottom: 15 }}>
<div style={{ display: "flex", alignItems: "center", gap: "5px" }}>
<span style={{ color: "var(--vscode-errorForeground)" }}></span>
<VSCodeCheckbox
checked={checkpointsEnabled}
onChange={(e: any) => {
setCheckpointsEnabled(e.target.checked)
}}>
When enabled, Roo will save a checkpoint whenever a file in the workspace is
modified, added or deleted, letting you easily revert to a previous state.
</p>
<span style={{ fontWeight: "500" }}>Enable experimental checkpoints</span>
</VSCodeCheckbox>
</div>
)}
<p
style={{
fontSize: "12px",
marginTop: "5px",
color: "var(--vscode-descriptionForeground)",
}}>
When enabled, Roo will save a checkpoint whenever a file in the workspace is modified,
added or deleted, letting you easily revert to a previous state.
</p>
</div>
{Object.entries(experimentConfigsMap)
.filter((config) => config[0] !== "DIFF_STRATEGY")