[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Quilt-dev] [PATCH] Add drop option to pop command
From: |
Josh Boyer |
Subject: |
[Quilt-dev] [PATCH] Add drop option to pop command |
Date: |
Sun, 10 Jul 2005 16:10:12 -0500 |
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 ;).
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 ;;
--)
- [Quilt-dev] [PATCH] Add drop option to pop command,
Josh Boyer <=