Skip to content

Commit

Permalink
Define 'p unapply'
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
neilbrown committed Jun 13, 2006
1 parent fb08742 commit d56b158
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions p
Original file line number Diff line number Diff line change
Expand Up @@ -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##*/}
Expand All @@ -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 ]
Expand Down

0 comments on commit d56b158

Please sign in to comment.