mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
add some logging for undo
This commit is contained in:
parent
e328b86d97
commit
5fb3f700c0
1 changed files with 3 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
use super::apply;
|
use super::apply;
|
||||||
use crate::storage::{ReplicaOp, StorageTxn};
|
use crate::storage::{ReplicaOp, StorageTxn};
|
||||||
|
use log::{debug, trace};
|
||||||
|
|
||||||
/// Undo local operations until an UndoPoint.
|
/// Undo local operations until an UndoPoint.
|
||||||
pub(super) fn undo(txn: &mut dyn StorageTxn) -> anyhow::Result<bool> {
|
pub(super) fn undo(txn: &mut dyn StorageTxn) -> anyhow::Result<bool> {
|
||||||
|
@ -12,8 +13,10 @@ pub(super) fn undo(txn: &mut dyn StorageTxn) -> anyhow::Result<bool> {
|
||||||
if op == ReplicaOp::UndoPoint {
|
if op == ReplicaOp::UndoPoint {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
debug!("Reversing operation {:?}", op);
|
||||||
let rev_ops = op.reverse_ops();
|
let rev_ops = op.reverse_ops();
|
||||||
for op in rev_ops {
|
for op in rev_ops {
|
||||||
|
trace!("Applying reversed operation {:?}", op);
|
||||||
apply::apply_op(txn, &op)?;
|
apply::apply_op(txn, &op)?;
|
||||||
applied = true;
|
applied = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue