Prevent most commands from running when there are conflicts
authorKarl Hasselström <kha@treskal.com>
Tue, 20 May 2008 21:33:25 +0000 (23:33 +0200)
committerKarl Hasselström <kha@treskal.com>
Tue, 20 May 2008 21:33:25 +0000 (23:33 +0200)
commit781e549a76633dd45cdf305c3e73e26ab706e3c9
treebdc01ee763f555dd666dfc77794ae0630a91af2b
parent7755d7f15d6282945c2ad92e52e54cfd6392b9d7
Prevent most commands from running when there are conflicts

When there are conflicts, we want most commands to fail, since the
conflicts conceptually belong to the topmost patch. git read-tree
already checks this for us when we check out a new tree, but there are
operations where the top tree stays the same, e.g. stg new.

This patch inserts a conflict check when the tree to check out is the
same. By default, conflicts will prevent the checkout from succeeding,
but commands can choose to override this if the same patch stays on
top (for some definition of "same").

This change only affects the new-infrastructure commands; the others
always refuse to run when there are local changes of any kind.

Signed-off-by: Karl Hasselström <kha@treskal.com>
stgit/commands/clean.py
stgit/commands/coalesce.py
stgit/commands/commit.py
stgit/commands/delete.py
stgit/commands/edit.py
stgit/commands/uncommit.py
stgit/lib/transaction.py