quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Quilt-dev] [PATCH 3/3 v2] push: Add --refresh option


From: Jean Delvare
Subject: [Quilt-dev] [PATCH 3/3 v2] push: Add --refresh option
Date: Thu, 02 Oct 2014 11:29:05 +0200

Add an option to automatically refresh each patch after is was
successfully applied.
---
Changes since v1:
 * Fix quoting of quilt_command parameters.

 quilt/push.in          |   11 +++++++++--
 test/auto-refresh.test |   22 ++++++++++++++++++++++
 2 files changed, 31 insertions(+), 2 deletions(-)

--- a/quilt/push.in
+++ b/quilt/push.in
@@ -21,7 +21,7 @@ setup_colors
 
 usage()
 {
-       printf $"Usage: quilt push [-afqv] [--merge[=merge|diff3]] 
[--leave-rejects] [--color[=always|auto|never]] [num|patch]\n"
+       printf $"Usage: quilt push [-afqv] [--merge[=merge|diff3]] 
[--leave-rejects] [--color[=always|auto|never]] [--refresh] [num|patch]\n"
        if [ x$1 = x-h ]
        then
                printf $"
@@ -53,6 +53,9 @@ be used.
 
 --color[=always|auto|never]
        Use syntax coloring (auto activates it only if the output is a tty).
+
+--refresh
+       Automatically refresh every patch after it was successfully applied.
 "
                exit 0
        else
@@ -294,7 +297,7 @@ check_duplicate_patches()
        return 1
 }
 
-options=`getopt -o fqvam::h --long fuzz:,merge::,leave-rejects,color:: -- "$@"`
+options=`getopt -o fqvam::h --long fuzz:,merge::,leave-rejects,color::,refresh 
-- "$@"`
 
 if [ $? -ne 0 ]
 then
@@ -352,6 +355,9 @@ do
                        usage ;;
                esac
                shift 2 ;;
+       --refresh)
+               opt_refresh=1
+               shift ;;
        --)
                shift
                break ;;
@@ -412,6 +418,7 @@ do
        then
                exit 1
        fi
+       [ -z "$opt_refresh" ] || quilt_command refresh $QUILT_REFRESH_ARGS
        [ -n "$opt_quiet" ] || echo
 done \
 | cleanup_patch_output \
--- a/test/auto-refresh.test
+++ b/test/auto-refresh.test
@@ -25,3 +25,25 @@ $ quilt pop -a --refresh
 > Restoring a
 >
 > No patches applied
+
+$ quilt push -a --refresh
+> Applying patch patches/a.patch
+> patching file a
+> Patch patches/a.patch is unchanged
+>
+> Applying patch patches/b.patch
+> patching file b
+> Patch patches/b.patch is unchanged
+>
+> Now at patch patches/b.patch
+
+$ quilt pop -a --refresh
+> Patch patches/b.patch is unchanged
+> Removing patch patches/b.patch
+> Restoring b
+>
+> Patch patches/a.patch is unchanged
+> Removing patch patches/a.patch
+> Restoring a
+>
+> No patches applied

-- 
Jean Delvare
SUSE L3 Support




reply via email to

[Prev in Thread] Current Thread [Next in Thread]