3 # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
6 source "`dirname $0`/guilt"
8 USAGE
="$USAGE <patchname>"
17 if [ -z "$patch" ]; then
19 echo "You must specify a patch name"
23 iidx
=`wc -l < $applied`
25 # make sure that there are no unapplied changes
26 if ! must_commit_first
; then
27 echo "Uncommited changes detected. Refresh first."
31 # create any directories as needed
32 [ "`dirname $patch`" != "." ] && mkdir
-p `dirname $GUILT_DIR/$branch/$patch`
34 # create the empty patch file
35 touch $GUILT_DIR/$branch/$patch
39 if [ ! -z "$top" ]; then
40 sed -i -e "s,^$top\$,$top\n$patch," $series
42 echo "$patch" > $series.tmp
43 cat $series >> $series.tmp
44 mv $series.tmp
$series