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 that there are no unapplied changes
24 if ! must_commit_first
; then
25 die
"Uncommited changes detected. Refresh first."
28 # make sure it is not applied
29 pline
=`cat $applied | grep -e "^[0-9a-f]\{40\}:$patch\$"`
30 if [ ! -z "$pline" ]; then
31 die
"Patch is applied. Pop the patch first."
34 # make sure it is a file
35 if [ ! -f "$GUILT_DIR/$branch/$patch" ]; then
36 die
"Patch '$patch' is not a regular file."
41 # back it up just in case :)
42 [ -z "$keep" ] && mv "$GUILT_DIR/$branch/$patch" "$GUILT_DIR/$branch/$patch~"