From d56b1585e11f8ddebfe5b49ca010bc5439fd3f03 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Tue, 13 Jun 2006 22:57:01 +1000 Subject: [PATCH] Define 'p unapply' This reverses an applied patch that was forced in. It goes back to the removed directory exactly as it was. Signed-off-by: Neil Brown --- p | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/p b/p index eaab2d3..4f6d475 100755 --- a/p +++ b/p @@ -724,11 +724,12 @@ case $cmd in then echo OK, it seems to apply elif [ -n "$force" ] then echo "It doesn't apply cleanly, but you asked for it...." - echo "Saving original at .patches/last-applied" - cp $pfile .patches/last-applied + echo "Saving original at .patches/last-conflict" + cp $pfile .patches/last-conflict else echo >&2 "Sorry, patch doesn't apply"; exit 1 fi # lets go for it ... + cp $pfile .patches/last-applied patch --fuzz=0 -f -p$prefix < "$pfile" | tee .patches/tmp sed -n -e '2q' -e 's/^Status: *//p' $pfile > .patches/status base=${pfile##*/} @@ -751,6 +752,16 @@ case $cmd in esac ;; + unapply ) + get_meta + mv .patches/last-applied .patches/patch + save_patch removed $name + echo Restored to $new$name + make_diff + mv .patches/patch .patches/last-purge + all_files discard_one + rm -f .patches/name .patches/status .patches/notes + ;; publish ) name=`date -u +%Y-%m-%d-%H` if [ -d .patches/dest ]