--- quilt/applied.in | 12 +++++++++--- quilt/delete.in | 16 +++++++++++----- quilt/files.in | 18 ++++++++++++------ quilt/graph.in | 18 +++++++++++++----- quilt/header.in | 14 ++++++++++---- quilt/next.in | 14 ++++++++++---- quilt/pop.in | 15 ++++++++++++--- quilt/previous.in | 14 ++++++++++---- quilt/push.in | 15 ++++++++++++--- quilt/refresh.in | 18 ++++++++++++------ quilt/unapplied.in | 16 +++++++++++----- 11 files changed, 122 insertions(+), 48 deletions(-) Index: quilt/quilt/applied.in =================================================================== --- quilt.orig/quilt/applied.in +++ quilt/quilt/applied.in @@ -25,6 +25,9 @@ usage() printf $" Print a list of applied patches, or all patches up to and including the specified patch in the file series. + +-P patch + Print all patches upto and including the specified patch. " exit 0 else @@ -32,7 +35,7 @@ specified patch in the file series. fi } -options=`getopt -o nh -- "$@"` +options=`getopt -o P:nh -- "$@"` if [ $? -ne 0 ] then @@ -44,6 +47,9 @@ eval set -- "$options" while true do case "$1" in + -P) + opt_patch="$2" + shift 2 ;; -h) usage -h ;; --) @@ -52,12 +58,12 @@ do esac done -if [ $# -gt 1 ] +if [ $# -gt 0 ] then usage fi -patch=$(find_applied_patch "$1") || exit 1 +patch=$(find_applied_patch "$opt_patch") || exit 1 for patch in $(applied_before "$patch") $patch do Index: quilt/quilt/delete.in =================================================================== --- quilt.orig/quilt/delete.in +++ quilt/quilt/delete.in @@ -19,7 +19,7 @@ fi usage() { - printf $"Usage: quilt delete [-r] [--backup] [patch|-n]\n" + printf $"Usage: quilt delete [-r] [--backup] [-P patch|-n]\n" if [ x$1 = x-h ] then printf $" @@ -27,6 +27,9 @@ Remove the specified or topmost patch fr patch is applied, quilt will attempt to remove it first. (Only the topmost patch can be removed right now.) +-P patch + Delete the named patch. + -n Delete the next patch after topmost, rather than the specified or topmost patch. @@ -43,7 +46,7 @@ topmost patch can be removed right now.) fi } -options=`getopt -o nrh --long backup -- "$@"` +options=`getopt -o P:nrh --long backup -- "$@"` if [ $? -ne 0 ] then @@ -55,6 +58,9 @@ eval set -- "$options" while true do case "$1" in + -P) + opt_patch="$2" + shift 2 ;; -n) opt_next=1 shift ;; @@ -72,13 +78,13 @@ do esac done -if [ $# -gt 1 -o \( -n "$opt_next" -a $# -gt 0 \) ] +if [ $# -gt 0 ] then usage fi -if [ -n "$1" ]; then - patch=$(find_patch "$1") || exit 1 +if [ -n "$opt_patch" ]; then + patch=$(find_patch "$opt_patch") || exit 1 else patch=$(top_patch) fi Index: quilt/quilt/files.in =================================================================== --- quilt.orig/quilt/files.in +++ quilt/quilt/files.in @@ -19,12 +19,15 @@ fi usage() { - printf $"Usage: quilt files [-v] [-a] [-l] [--combine patch] [patch]\n" + printf $"Usage: quilt files [-v] [-l] [-a | -P patch | --combine patch]\n" if [ x$1 = x-h ] then printf $" Print the list of files that the topmost or specified patch changes. +-P patch + List the files in specified patch. + -a List all files in all applied patches. -l Add patch name to output. @@ -43,7 +46,7 @@ Print the list of files that the topmost fi } -options=`getopt -o vhal --long combine: -- "$@"` +options=`getopt -o P:vhal --long combine: -- "$@"` if [ $? -ne 0 ] then @@ -55,17 +58,20 @@ eval set -- "$options" while true do case "$1" in + -P) + opt_patch="$2" + shift 2 ;; -v) opt_verbose=1 shift ;; -a) opt_all=1 shift ;; + -h) + usage -h ;; -l) opt_labels=1 shift ;; - -h) - usage -h ;; --combine) opt_all=1 if [ "$2" = - ] @@ -81,12 +87,12 @@ do esac done -if [ $# -gt 1 ] +if [ $# -gt 0 ] then usage fi -last_patch=$(find_patch_in_series "$1") || exit 1 +last_patch=$(find_patch_in_series "$opt_patch") || exit 1 if [ -n "$opt_all" -a -z "$first_patch" ] then Index: quilt/quilt/graph.in =================================================================== --- quilt.orig/quilt/graph.in +++ quilt/quilt/graph.in @@ -19,7 +19,7 @@ fi usage() { - printf $"Usage: quilt graph [--all] [--reduce] [--lines[=num]] [--edge-labels=files] [-T ps] [patch]\n" + printf $"Usage: quilt graph [--all] [--reduce] [--lines[=num]] [--edge-labels=files] [-T ps] [-P patch]\n" if [ x$1 = x-h ] then @@ -49,6 +49,9 @@ patch. Label graph edges with the file names that the adjacent patches modify. +-P patch + Create a graph for specified patch. + -T ps Directly produce a PostScript output file. " exit 0 @@ -57,7 +60,7 @@ patch. fi } -options=`getopt -o T:h --long all,reduce,lines::,edge-labels: -- "$@"` +options=`getopt -o P:T:h --long all,reduce,lines::,edge-labels: -- "$@"` if [ $? -ne 0 ] then @@ -69,7 +72,12 @@ eval set -- "$options" while true do case "$1" in - -T) if [ "$2" != ps ]; then + -P) + opt_patch="$2" + shift 2 ;; + + -T) + if [ "$2" != ps ]; then usage fi opt_format=ps @@ -104,14 +112,14 @@ do esac done -if [ $# -gt 1 -o \( $# -ne 0 -a -n "$opt_all" \) ] +if [ $# -gt 0 -o -z "$opt_patch$opt_all" ] then usage fi if [ -z "$opt_all" ] then - patch=$(find_applied_patch "$1") || exit 1 + patch=$(find_applied_patch "$opt_patch") || exit 1 fi options= Index: quilt/quilt/header.in =================================================================== --- quilt.orig/quilt/header.in +++ quilt/quilt/header.in @@ -21,13 +21,16 @@ fi usage() { - printf $"Usage: quilt header [-a|-r|-e] [--backup] [--strip-diffstat] [--strip-trailing-whitespace] [patch]\n" + printf $"Usage: quilt header [-a|-r|-e] [--backup] [--strip-diffstat] [--strip-trailing-whitespace] [-P patch]\n" if [ x$1 = x-h ] then printf $" Print or change the header of the topmost or specified patch. +-P patch + Change the header of the specified patch. + -a, -r, -e Append to (-a) or replace (-r) the exiting patch header, or edit (-e) the header in \$EDITOR (%s). If none of these options is @@ -68,7 +71,7 @@ maybe_strip_diffstat() fi } -options=`getopt -o areh --long backup,strip-trailing-whitespace,strip-diffstat -- "$@"` +options=`getopt -o P:areh --long backup,strip-trailing-whitespace,strip-diffstat -- "$@"` if [ $? -ne 0 ] then @@ -80,6 +83,9 @@ eval set -- "$options" while true do case "$1" in + -P) + opt_patch="$2" + shift 2 ;; -a) opt_append=1 shift ;; @@ -112,12 +118,12 @@ in *) usage ;; esac -if [ $# -gt 1 ] +if [ $# -gt 0 ] then usage fi -patch=$(find_patch_in_series "$1") || exit 1 +patch=$(find_patch_in_series "$opt_patch") || exit 1 patch_file=$(patch_file_name $patch) Index: quilt/quilt/next.in =================================================================== --- quilt.orig/quilt/next.in +++ quilt/quilt/next.in @@ -19,12 +19,15 @@ fi usage() { - printf $"Usage: quilt next [patch]\n" + printf $"Usage: quilt next [-P patch]\n" if [ x$1 = x-h ] then printf $" Print the name of the next patch after the specified or topmost patch in the series file. + +-P patch + Print the name of the patch after this patch. " exit 0 else @@ -32,7 +35,7 @@ the series file. fi } -options=`getopt -o h -- "$@"` +options=`getopt -o P:h -- "$@"` if [ $? -ne 0 ] then @@ -44,6 +47,9 @@ eval set -- "$options" while true do case "$1" in + -P) + opt_patch="$2" + shift 2 ;; -h) usage -h ;; --) @@ -52,12 +58,12 @@ do esac done -if [ $# -gt 1 ] +if [ $# -gt 0 ] then usage fi -next=$(find_unapplied_patch "$1") || exit +next=$(find_unapplied_patch "$opt_patch") || exit if [ -n "$next" ] then Index: quilt/quilt/pop.in =================================================================== --- quilt.orig/quilt/pop.in +++ quilt/quilt/pop.in @@ -19,7 +19,7 @@ fi usage() { - printf $"Usage: quilt pop [-afRqv] [num|patch]\n" + printf $"Usage: quilt pop [-afRqv] [num|-P patch]\n" if [ x$1 = x-h ] then printf $" @@ -30,6 +30,9 @@ patches until the specified patch end up names may include the patches/ prefix, which means that filename completion can be used. +-P patch + Remove patches above specified patch. + -a Remove all applied patches. -f Force remove. The state before the patch(es) were applied will @@ -177,7 +180,7 @@ remove_patch() return $status } -options=`getopt -o fRqvah -- "$@"` +options=`getopt -o P:fRqvah -- "$@"` if [ $? -ne 0 ] then @@ -189,6 +192,9 @@ eval set -- "$options" while true do case "$1" in + -P) + opt_patch="$2" + shift 2 ;; -f) opt_force=1 unset opt_remove @@ -225,8 +231,11 @@ then then number=$1 else - stop_at_patch=$(find_applied_patch "$1") || exit 1 + usage fi +elif [ -n "$opt_patch" ] +then + stop_at_patch=$(find_applied_patch "$opt_patch") || exit 1 else [ -n "$opt_all" ] || number=1 fi Index: quilt/quilt/previous.in =================================================================== --- quilt.orig/quilt/previous.in +++ quilt/quilt/previous.in @@ -19,12 +19,15 @@ fi usage() { - printf $"Usage: quilt previous [patch]\n" + printf $"Usage: quilt previous [-P patch]\n" if [ x$1 = x-h ] then printf $" Print the name of the previous patch before the specified or topmost patch in the series file. + +-P patch + Print the name of the patch before this specified patch. " exit 0 else @@ -32,7 +35,7 @@ patch in the series file. fi } -options=`getopt -o h -- "$@"` +options=`getopt -o P:h -- "$@"` if [ $? -ne 0 ] then @@ -44,6 +47,9 @@ eval set -- "$options" while true do case "$1" in + -P) + opt_patch="$2" + shift 2 ;; -h) usage -h ;; --) @@ -52,12 +58,12 @@ do esac done -if [ $# -gt 1 ] +if [ $# -gt 0 ] then usage fi -patch=$(find_patch_in_series "$1") || exit 1 +patch=$(find_patch_in_series "$opt_patch") || exit 1 previous=$(applied_before "$patch" | tail -n 1) if [ -n "$previous" ] Index: quilt/quilt/push.in =================================================================== --- quilt.orig/quilt/push.in +++ quilt/quilt/push.in @@ -21,7 +21,7 @@ setup_colors usage() { - printf $"Usage: quilt push [-afqv] [--leave-rejects] [--interactive] [--color[=always|auto|never]] [num|patch]\n" + printf $"Usage: quilt push [-afqv] [--leave-rejects] [--interactive] [--color[=always|auto|never]] [num|-P patch]\n" if [ x$1 = x-h ] then printf $" @@ -32,6 +32,9 @@ all patches up to and including the spec include the patches/ prefix, which means that filename completion can be used. +-P patch + Apply all patches upto and including this specified patch. + -a Apply all patches in the series file. -f Force apply, even if the patch has rejects. @@ -267,7 +270,7 @@ list_patches() fi } -options=`getopt -o fqvah --long leave-rejects,interactive,color:: -- "$@"` +options=`getopt -o P:fqvah --long leave-rejects,interactive,color:: -- "$@"` if [ $? -ne 0 ] then @@ -279,6 +282,9 @@ eval set -- "$options" while true do case "$1" in + -P) + opt_patch="$2" + shift 2 ;; -f) opt_force=1 shift ;; @@ -329,8 +335,11 @@ then then number=$1 else - stop_at_patch="$1" + usage fi +elif [ -n "$opt_patch" ] +then + stop_at_patch="$opt_patch" else [ -z "$opt_all" ] && number=1 fi Index: quilt/quilt/refresh.in =================================================================== --- quilt.orig/quilt/refresh.in +++ quilt/quilt/refresh.in @@ -19,7 +19,7 @@ fi usage() { - printf $"Usage: quilt refresh [-p n] [-f] [--no-timestamps] [--no-index] [--diffstat] [--sort] [--backup] [--strip-trailing-whitespace] [patch]\n" + printf $"Usage: quilt refresh [-p n] [-f] [--no-timestamps] [--no-index] [--diffstat] [--sort] [--backup] [--strip-trailing-whitespace] [-P patch]\n" if [ x$1 = x-h ] then @@ -36,6 +36,9 @@ recent patches will be ignored, and only been modified by any more recent patches will end up in the specified patch. +-P patch + Refresh this specific patch. + -p n Create a -p n style patch (-p0 or -p1 supported). -u, -U num, -c, -C num @@ -78,9 +81,9 @@ die () exit $status } -options=`getopt -o p:uU:cC:fh --long no-timestamps,diffstat,backup,sort \ - --long no-index \ - --long strip-trailing-whitespace -- "$@"` +options=`getopt -o P:p:uU:cC:fh --long no-timestamps,diffstat,backup,sort \ + --long no-index \ + --long strip-trailing-whitespace -- "$@"` if [ $? -ne 0 ] then @@ -93,6 +96,9 @@ opt_format=-u while true do case "$1" in + -P) + opt_patch="$2" + shift 2 ;; -p) opt_strip_level=$2 shift 2 ;; @@ -131,14 +137,14 @@ do esac done -if [ $# -gt 1 ] +if [ $# -gt 0 ] then usage fi QUILT_DIFF_OPTS="$QUILT_DIFF_OPTS $opt_format" -patch=$(find_applied_patch "$1") || exit 1 +patch=$(find_applied_patch "$opt_patch") || exit 1 if [ -z "$opt_strip_level" ] then Index: quilt/quilt/unapplied.in =================================================================== --- quilt.orig/quilt/unapplied.in +++ quilt/quilt/unapplied.in @@ -19,12 +19,15 @@ fi usage() { - printf $"Usage: quilt unapplied [patch]\n" + printf $"Usage: quilt unapplied [-P patch]\n" if [ x$1 = x-h ] then printf $" Print a list of patches that are not applied, or all patches that follow the specified patch in the series file. + +-P patch + Print all patches that follow this one. " exit 0 else @@ -32,7 +35,7 @@ the specified patch in the series file. fi } -options=`getopt -o h -- "$@"` +options=`getopt -o P:h -- "$@"` if [ $? -ne 0 ] then @@ -44,6 +47,9 @@ eval set -- "$options" while true do case "$1" in + -P) + opt_patch="$2" + shift 2 ;; -h) usage -h ;; --) @@ -52,12 +58,12 @@ do esac done -if [ $# -gt 1 ] +if [ $# -gt 0 ] then usage -elif [ $# -eq 1 ] +elif [ -n "$opt_patch" ] then - start=$(find_patch_in_series "$1") || exit 1 + start=$(find_patch_in_series "$opt_patch") || exit 1 patch=$(patch_after "$start") [ -n "$start" -a -z "$patch" ] && exit