Log and undo external modifications
authorKarl Hasselström <kha@treskal.com>
Sun, 21 Sep 2008 12:17:41 +0000 (14:17 +0200)
committerKarl Hasselström <kha@treskal.com>
Sun, 21 Sep 2008 12:19:07 +0000 (14:19 +0200)
commitc70033b45deac916730549bb915231f59895caf9
tree41fb131827f0db31b8d7375b393b6b098f60168c
parent121c14e552a2ba679e06842ca43bf00aa147755f
Log and undo external modifications

At the beginning of every StGit command, quickly check if the branch
head recorded in the log is the same as the actual branch head; if
it's not, conclude that some non-StGit tool has modified the stack,
and record a log entry that says so. (Additionally, if the log doesn't
exist yet, create it.)

This introduces the possibility that a log entry specifies a head and
a top that aren't equal. So teach undo, redo, and reset to deal with
that case.

Signed-off-by: Karl Hasselström <kha@treskal.com>
stgit/commands/common.py
stgit/commands/redo.py
stgit/commands/reset.py
stgit/commands/undo.py
stgit/lib/log.py
stgit/lib/transaction.py
t/t3105-undo-external-mod.sh [new file with mode: 0755]