quilt-dev
[Top][All Lists]
Advanced

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

[Quilt-dev] [PATCH] push: patch's --merge option has an optional argumen


From: Bert Wesarg
Subject: [Quilt-dev] [PATCH] push: patch's --merge option has an optional argument now
Date: Sat, 2 Jan 2010 13:33:32 +0100

Since version 2.6.1 the patch utility knows an optional argument for
--merge. Regognize this and pass it on to patch.

Signed-off-by: Bert Wesarg <address@hidden>

---
 quilt/push.in |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/quilt/push.in b/quilt/push.in
index d89f927..66980c6 100644
--- a/quilt/push.in
+++ b/quilt/push.in
@@ -21,7 +21,7 @@ setup_colors
 
 usage()
 {
-       printf $"Usage: quilt push [-afqv] [--merge] [--leave-rejects] 
[--color[=always|auto|never]] [num|patch]\n"
+       printf $"Usage: quilt push [-afqv] [--merge[=merge|diff3]] 
[--leave-rejects] [--color[=always|auto|never]] [num|patch]\n"
        if [ x$1 = x-h ]
        then
                printf $"
@@ -44,7 +44,7 @@ be used.
 --fuzz=N
        Set the maximum fuzz factor (default: 2).
 
--m, --merge
+-m, --merge[=merge|diff3]
        Merge the patch file into the original files (see patch(1)).
 
 --leave-rejects
@@ -274,7 +274,7 @@ list_patches()
        fi
 }
 
-options=`getopt -o fqvamh --long fuzz:,merge,leave-rejects,color:: -- "$@"`
+options=`getopt -o fqvamh --long fuzz:,merge::,leave-rejects,color:: -- "$@"`
 
 if [ $? -ne 0 ]
 then
@@ -305,8 +305,17 @@ do
                opt_fuzz=$2
                shift 2 ;;
        -m | --merge)
-               opt_merge=1
-               shift 1 ;;
+               case "$2" in
+               "" | merge)
+                       opt_merge=1
+                       opt_merge_arg= ;;
+               diff3)
+                       opt_merge=1
+                       opt_merge_arg="=diff3" ;;
+               *)
+                       usage ;;
+               esac
+               shift 2 ;;
        --leave-rejects)
                opt_leave_rejects=1
                shift ;;
@@ -357,7 +366,7 @@ more_patch_args=
        more_patch_args="$more_patch_args -f"
 if [ -n "$opt_merge" ]
 then
-       more_patch_args="$more_patch_args --merge"
+       more_patch_args="$more_patch_args --merge$opt_merge_arg"
 fi
 [ -n "$opt_fuzz" ] && more_patch_args="$more_patch_args -F$opt_fuzz"
 
-- 
tg: (2f0c184..) bw/merge-has-opt-arg (depends on: master)




reply via email to

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