regression: test 060: test files code
[guilt/mob.git] / guilt-delete
blob8fdf23dc17fd210887390ed155c867a6e7acccdd
1 #!/bin/sh
3 # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
6 USAGE="[-f] <patchname>"
7 . `dirname $0`/guilt
9 case $# in
11 # just patchname
12 force=
15 # -f patchname
16 if [ "$1" != "-f" ]; then
17 usage
20 force=t
21 shift
24 usage
26 esac
28 patch="$1"
30 if [ -z "$patch" ]; then
31 die "You must specify a patch to delete"
34 p=`grep -e "^[0-9a-f]\{40\}:$patch\$" < "$applied"`
35 if [ ! -z "$p" ] ; then
36 die "Cannot delete an applied patch"
39 series_remove_patch "$patch"
41 guilt_hook "delete" "$patch"
43 [ ! -z "$force" ] && rm -f $GUILT_DIR/$branch/$patch
45 exit 0