Skip to content

Commit 630c2e5

Browse files
authored
Merge pull request #941 from RooVetGit/bring_back_checkpoints_for_windows
Bring back checkpoints on Windows
2 parents 43d4c5c + 8576809 commit 630c2e5

File tree

4 files changed

+20
-40
lines changed

4 files changed

+20
-40
lines changed

src/core/Cline.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export class Cline {
143143
this.fuzzyMatchThreshold = fuzzyMatchThreshold ?? 1.0
144144
this.providerRef = new WeakRef(provider)
145145
this.diffViewProvider = new DiffViewProvider(cwd)
146-
this.checkpointsEnabled = process.platform !== "win32" && !!enableCheckpoints
146+
this.checkpointsEnabled = enableCheckpoints ?? false
147147

148148
if (historyItem) {
149149
this.taskId = historyItem.id

src/services/checkpoints/CheckpointService.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,6 @@ export class CheckpointService {
312312
}
313313

314314
public static async create({ taskId, git, baseDir, log = console.log }: CheckpointServiceOptions) {
315-
if (process.platform === "win32") {
316-
throw new Error("Checkpoints are not supported on Windows.")
317-
}
318-
319315
git = git || simpleGit({ baseDir })
320316

321317
const version = await git.version()

src/services/checkpoints/__tests__/CheckpointService.test.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ describe("CheckpointService", () => {
1414
let git: SimpleGit
1515
let testFile: string
1616
let service: CheckpointService
17-
let originalPlatform: string
1817

1918
const initRepo = async ({
2019
baseDir,
@@ -49,19 +48,6 @@ describe("CheckpointService", () => {
4948
return { git, testFile }
5049
}
5150

52-
beforeAll(() => {
53-
originalPlatform = process.platform
54-
Object.defineProperty(process, "platform", {
55-
value: "darwin",
56-
})
57-
})
58-
59-
afterAll(() => {
60-
Object.defineProperty(process, "platform", {
61-
value: originalPlatform,
62-
})
63-
})
64-
6551
beforeEach(async () => {
6652
const baseDir = path.join(os.tmpdir(), `checkpoint-service-test-${Date.now()}`)
6753
const repo = await initRepo({ baseDir })

webview-ui/src/components/settings/SettingsView.tsx

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -701,29 +701,27 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
701701
</div>
702702
)}
703703

704-
{process.platform !== "win32" && (
705-
<div style={{ marginBottom: 15 }}>
706-
<div style={{ display: "flex", alignItems: "center", gap: "5px" }}>
707-
<span style={{ color: "var(--vscode-errorForeground)" }}>⚠️</span>
708-
<VSCodeCheckbox
709-
checked={checkpointsEnabled}
710-
onChange={(e: any) => {
711-
setCheckpointsEnabled(e.target.checked)
712-
}}>
713-
<span style={{ fontWeight: "500" }}>Enable experimental checkpoints</span>
714-
</VSCodeCheckbox>
715-
</div>
716-
<p
717-
style={{
718-
fontSize: "12px",
719-
marginTop: "5px",
720-
color: "var(--vscode-descriptionForeground)",
704+
<div style={{ marginBottom: 15 }}>
705+
<div style={{ display: "flex", alignItems: "center", gap: "5px" }}>
706+
<span style={{ color: "var(--vscode-errorForeground)" }}>⚠️</span>
707+
<VSCodeCheckbox
708+
checked={checkpointsEnabled}
709+
onChange={(e: any) => {
710+
setCheckpointsEnabled(e.target.checked)
721711
}}>
722-
When enabled, Roo will save a checkpoint whenever a file in the workspace is
723-
modified, added or deleted, letting you easily revert to a previous state.
724-
</p>
712+
<span style={{ fontWeight: "500" }}>Enable experimental checkpoints</span>
713+
</VSCodeCheckbox>
725714
</div>
726-
)}
715+
<p
716+
style={{
717+
fontSize: "12px",
718+
marginTop: "5px",
719+
color: "var(--vscode-descriptionForeground)",
720+
}}>
721+
When enabled, Roo will save a checkpoint whenever a file in the workspace is modified,
722+
added or deleted, letting you easily revert to a previous state.
723+
</p>
724+
</div>
727725

728726
{Object.entries(experimentConfigsMap)
729727
.filter((config) => config[0] !== "DIFF_STRATEGY")

0 commit comments

Comments
 (0)