Support restore operation
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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']
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user