quilt-dev
[Top][All Lists]
Advanced

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

Re: [Quilt-dev] [PATCH] Add drop option to pop command


From: Josh Boyer
Subject: Re: [Quilt-dev] [PATCH] Add drop option to pop command
Date: Mon, 11 Jul 2005 23:05:03 -0500

On Sun, 2005-07-10 at 16:10 -0500, Josh Boyer wrote:
> As suggested a while ago, my proposed quilt drop command was so similar
> to quilt pop that I've implemented it's functionality as an option to
> pop instead.  Below is the patch.
> 
> Questions/comments always welcome.  If this is more acceptable for
> inclusion, that's great.  And if not, that's ok too.  I can always use
> quilt to keep it applied to my local copy ;).

Argh.  Below is a corrected patch.  Please ignore the first one, it
contained a bug that basically always dropped a patch.

If a new release is coming soon, please take a quick glance.

thx,
josh

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 [-adfRqv] [num|patch]\n"
        if [ x$1 = x-h ]
        then
                printf $"
@@ -32,6 +32,8 @@ completion can be used.
 
 -a     Remove all applied patches.
 
+-d     Drop patch(es).  (Leaves them appiled to the source tree)
+
 -f     Force remove. The state before the patch(es) were applied will
        be restored from backup files.
 
@@ -176,15 +178,23 @@ remove_patch()
        if [ $status -eq 0 ]
        then
                rm -f "$QUILT_PC/$patch/.timestamp"
-               if [ -z "$(shopt -s nullglob ; echo "$QUILT_PC/$patch/"*)" ]
+               if [ -n "$opt_drop" ]
                then
-                       printf $"Patch %s appears to be empty, removing\n" \
-                              "$(print_patch $patch)"
-                       status=0
-               else
-                       printf $"Removing patch %s\n" "$(print_patch $patch)"
-                       @LIB@/backup-files $silent -r -t -B $QUILT_PC/$patch/ -
+                       printf $"Dropping patch %s\n" "$(print_patch $patch)"
+                       @LIB@/backup-files $silent -x -B $QUILT_PC/$patch/ -
                        status=$?
+                       remove_from_series $patch
+               else
+                       if [ -z "$(shopt -s nullglob ; echo 
"$QUILT_PC/$patch/"*)" ]
+                       then
+                               printf $"Patch %s appears to be empty, 
removing\n" \
+                               "$(print_patch $patch)"
+                               status=0
+                       else
+                               printf $"Removing patch %s\n" "$(print_patch 
$patch)"
+                               @LIB@/backup-files $silent -r -t -B 
$QUILT_PC/$patch/ -
+                               status=$?
+                       fi
                fi
                remove_from_db $patch
                rm -f $QUILT_PC/$patch~refresh
@@ -193,7 +203,7 @@ remove_patch()
        return $status
 }
 
-options=`getopt -o fRqvah -- "$@"`
+options=`getopt -o fRqvahd -- "$@"`
 
 if [ $? -ne 0 ]
 then
@@ -222,6 +232,10 @@ do
        -a)
                opt_all=1
                shift ;;
+       -d)
+               opt_drop=1
+               unset opt_remove
+               shift ;;
        -h)
                usage -h ;;
         --)






reply via email to

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