2 from yap
.yap
import YapCore
, YapError
3 from yap
.util
import run_command
6 class BackupPlugin(YapCore
):
7 "Save a backup of files before reverting them"
9 def cmd_revert(self
, *args
, **flags
):
11 changed
= set(self
._get
_staged
_files
() + self
._get
_unstaged
_files
())
16 x
= files
.intersection(changed
)
19 run_command("cp %s %s~" % (f
, f
))
20 super(BackupPlugin
, self
).cmd_revert(*args
, **flags
)