3 # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
6 USAGE
="[-k] <patchname>"
9 if [ "$1" = "-k" ]; then
19 if [ -z "$patch" ]; then
20 die
"No patch name supplied."
23 # make sure it is a file
24 if [ ! -f "$GUILT_DIR/$branch/$patch" ]; then
25 die
"Patch $patch does not exist."
28 # make sure that there are no unapplied changes
29 if ! must_commit_first
; then
30 die
"Uncommited changes detected. Refresh first."
33 # make sure it is not applied
34 pline
=`cat $applied | grep -e "^$patch$"`
35 if [ ! -z "$pline" ]; then
36 die
"Patch is applied. Pop the patch first."
41 # back it up just in case :)
42 [ -z "$keep" ] && mv "$GUILT_DIR/$branch/$patch" "$GUILT_DIR/$branch/$patch~"