This prepares for using the function in commit. Signed-off-by: Hugo Mills <[email protected]> Index: quilt/quilt/scripts/patchfns.in =================================================================== --- quilt.orig/quilt/scripts/patchfns.in 2009-11-26 16:10:28.000000000 +0000 +++ quilt/quilt/scripts/patchfns.in 2009-11-26 19:41:00.000000000 +0000 @@ -437,6 +437,36 @@ [ -n "$patch" ] && echo "$patch" } +list_patch_range() +{ + local first_patch="$1" last_patch="$2" + + if [ -n "$first_patch" ] + then + if [ -n "$last_patch" ] + then + set -- $(patches_before "$last_patch") "$last_patch" + while [ $# -ne 0 ] + do + [ "$1" = "$first_patch" ] && break + shift + done + if [ $# -eq 0 ] + then + printf $"Patch %s not applied before patch %s\n" \ + "$(print_patch $first_patch)" \ + "$(print_patch $last_patch)" >&2 + return 1 + fi + echo "$@" + else + echo "$first_patch" $(patches_after "$first_patch") + fi + else + cat_series + fi +} + # List all patches that have been applied on top of patch $1 patches_on_top_of() { Index: quilt/quilt/mail.in =================================================================== --- quilt.orig/quilt/mail.in 2009-11-26 16:10:48.000000000 +0000 +++ quilt/quilt/mail.in 2009-11-26 16:13:46.000000000 +0000 @@ -369,31 +369,7 @@ } fi -if [ -n "$first_patch" ] -then - if [ -n "$last_patch" ] - then - set -- $(patches_before "$last_patch") "$last_patch" - while [ $# -ne 0 ] - do - [ "$1" = "$first_patch" ] && break - shift - done - if [ $# -eq 0 ] - then - printf $"Patch %s not applied before patch %s\n" \ - "$(print_patch $first_patch)" \ - "$(print_patch $last_patch)" >&2 - exit 1 - fi - patches=( "$@" ) - else - patches=( "$first_patch" $(patches_after "$first_patch") ) - fi -else - patches=( $(cat_series) ) -fi - +patches=( $(list_patch_range "$first_patch" "$last_patch") ) total=${#patch...@]} tmpdir=$(gen_tempfile -d)
_______________________________________________ Quilt-dev mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/quilt-dev
