Support restore operation

This commit is contained in:
WQY\qiong
2022-11-25 23:52:18 +08:00
parent e13bb53b98
commit 008cd2b3a2
7 changed files with 25 additions and 11 deletions

View File

@@ -9,7 +9,7 @@ from .operation import ChangeSet
from .operation import get_current_operation
from .operation import execute_undo, execute_redo
from .operation import have_snapshot, take_snapshot, pick_snapshot
from .operation import pick_operation, sync_with_server
from .operation import pick_operation, sync_with_server, get_restore_operation
from .command import execute_batch_command, execute_batch_commands

View File

@@ -307,3 +307,7 @@ def sync_with_server(name: str, operation: int) -> ChangeSet:
index -= 1
return change.compress()
def get_restore_operation(name: str) -> int:
return read(name, f'select * from restore_operation')['id']

View File

@@ -221,7 +221,9 @@ def read_inp(project: str, inp: str):
create_project(project)
open_project(project)
execute_batch_command(project, _read_inp(inp))
execute_batch_commands(project, _read_inp(inp))
op = get_current_operation(project)
write(project, f'update restore_operation set id = {op}')
def dump_inp(project: str, inp: str):