Index: bash_completion =================================================================== RCS file: /cvsroot/quilt/quilt/bash_completion,v retrieving revision 1.14 diff -u -r1.14 bash_completion --- bash_completion 12 Jun 2005 12:37:56 -0000 1.14 +++ bash_completion 13 Jun 2005 20:36:52 -0000 @@ -135,7 +135,7 @@ COMPREPLY=( $( compgen -W "-h $(quilt applied)" -- $cur ) ) ;; delete) - COMPREPLY=( $( compgen -W "-h $(quilt series)" -- $cur ) ) + COMPREPLY=( $( compgen -W "-n -h $(quilt series)" -- $cur ) ) ;; diff) case $prev in Index: quilt/delete.in =================================================================== RCS file: /cvsroot/quilt/quilt/quilt/delete.in,v retrieving revision 1.13 diff -u -r1.13 delete.in --- quilt/delete.in 15 Nov 2004 22:43:19 -0000 1.13 +++ quilt/delete.in 13 Jun 2005 20:36:52 -0000 @@ -19,13 +19,16 @@ usage() { - printf $"Usage: quilt delete [patch]\n" + printf $"Usage: quilt delete [patch | -n]\n" if [ x$1 = x-h ] then printf $" Remove the specified or topmost patch from the series file. If the patch is applied, quilt will attempt to remove it first. (Only the topmost patch can be removed right now.) + +-n Delete the next patch after topmost, rather than the specified + or topmost patch. " exit 0 @@ -34,7 +37,7 @@ fi } -options=`getopt -o h -- "$@"` +options=`getopt -o nh -- "$@"` if [ $? -ne 0 ] then @@ -46,6 +49,9 @@ while true do case "$1" in + -n) + opt_next=1 + shift ;; -h) usage -h ;; --) @@ -54,7 +60,7 @@ esac done -if [ $# -gt 1 ] +if [ $# -gt 1 -o \( -n "$opt_next" -a $# -gt 0 \) ] then usage fi @@ -63,10 +69,25 @@ if [ -z "$patch" ] then patch="$(top_patch)" - if [ -z "$patch" ] + if [ -z "$opt_next" ] then - printf $"No patches applied\n" >&2 - exit 1 + if [ -z "$patch" ] + then + printf $"No patches applied\n" >&2 + exit 1 + fi + else + if [ -z "$patch" ] + then + patch="$(cat_series | head -n 1)" + else + patch="$(patches_after "$patch" | head -n 1)" + fi + if [ -z "$patch" ] + then + printf $"No next patch\n" >&2 + exit 1 + fi fi else save_patch=$patch