Convert "stg refresh" to the new infrastructure
authorKarl Hasselström <kha@treskal.com>
Sun, 21 Sep 2008 12:17:42 +0000 (14:17 +0200)
committerKarl Hasselström <kha@treskal.com>
Sun, 21 Sep 2008 12:19:07 +0000 (14:19 +0200)
commit85aaed816bde469b3de72e80d8f8ed7830302fbf
tree3eef8150e16f51a02fda9a1d1da188794b1a4686
parentde19d17bd03100446c1b9e581a40a21d1b0ad6ca
Convert "stg refresh" to the new infrastructure

And in the process, make it more powerful: it will now first create a
temp patch containing the updates, and then try to merge it into the
patch to be updated. If that patch is applied, this is done by
popping, pushing, and coalescing; if it is unapplied, it is done with
an in-index merge. This allows us to correctly handle a few corner
cases that didn't use to work, such as adding a new file to a
non-topmost patch (fixes the t2701 test failure).

The temp patch creation and merging is logged in two separate stages,
so that the user can undo them separately.

Also, whenever path limiting is used, we will now use a temporary
index in order to avoid including all staged updates (since they may
touch stuff outside the path limiters).

Support for the --force, --undo, and --annotate flags were dropped.

Signed-off-by: Karl Hasselström <kha@treskal.com>
stgit/commands/refresh.py
stgit/lib/git.py
stgit/lib/stack.py
stgit/lib/transaction.py
t/t2701-refresh-p.sh
t/t3100-reset.sh