3 # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
6 USAGE
="[-e] [<patchname>]"
14 if [ "$1" = "-e" ]; then
22 [ "$1" != "-e" ] && usage
30 # are there any patches applied?
31 [ -z "$patch" ] && die
"No patches applied."
33 # check that patch exists in the series
34 ret
=`get_full_series | grep -e "^$patch\$" | wc -l`
35 if [ $ret -eq 0 ]; then
36 die
"Patch $patch is not in the series"
39 # FIXME: warn if we're editing an applied patch
41 TMP_MSG
=`get_tmp_file msg`
42 TMP_DIFF
=`get_tmp_file diff`
44 if [ -z "$edit" ]; then
45 do_get_header
"$GUILT_DIR/$branch/$patch"
47 do_get_full_header
"$GUILT_DIR/$branch/$patch" > "$TMP_MSG"
48 do_get_patch
"$GUILT_DIR/$branch/$patch" > "$TMP_DIFF"
50 mv "$GUILT_DIR/$branch/$patch" "$GUILT_DIR/$branch/$patch~"
55 ) > "$GUILT_DIR/$branch/$patch"
58 rm -f "$TMP_MSG" "$TMP_DIFF"