SHA256
1
0
forked from pool/quilt
quilt/pop-add-auto-refresh.patch
Jean Delvare 6732de62cf - Update upstream references.
- quilt-el-fix-tramp-support.patch: quilt-el: Fix tramp support.
- quilt-el-fix-patch-select-completion.patch: quilt-el: Fix patch
  select completion.
- hackweek-11-13-setup-let-normalize_path-deal-with-dot.patch:
  setup: Let normalize_path deal with ".".
- hackweek-11-14-setup-fix-link-creation.patch: setup: Fix link
  creation.

OBS-URL: https://build.opensuse.org/package/show/devel:tools:scm/quilt?expand=0&rev=94
2015-01-28 10:58:31 +00:00

90 lines
1.8 KiB
Diff

From: Jean Delvare <jdelvare@suse.de>
Subject: pop: Add --refresh option
Upstream: Committed (7189482be1393c7b9e6170410d820f1867e8ec93)
Add an option to automatically refresh each patch before it gets
unapplied.
---
quilt/pop.in | 11 +++++++++--
test/auto-refresh.test | 27 +++++++++++++++++++++++++++
2 files changed, 36 insertions(+), 2 deletions(-)
--- a/quilt/pop.in
+++ b/quilt/pop.in
@@ -19,7 +19,7 @@ fi
usage()
{
- printf $"Usage: quilt pop [-afRqv] [num|patch]\n"
+ printf $"Usage: quilt pop [-afRqv] [--refresh] [num|patch]\n"
if [ x$1 = x-h ]
then
printf $"
@@ -41,6 +41,9 @@ completion can be used.
-q Quiet operation.
-v Verbose operation.
+
+--refresh
+ Automatically refresh every patch before it gets unapplied.
"
exit 0
else
@@ -163,7 +166,7 @@ remove_patch()
return $status
}
-options=`getopt -o fRqvah -- "$@"`
+options=`getopt -o fRqvah --long refresh -- "$@"`
if [ $? -ne 0 ]
then
@@ -194,6 +197,9 @@ do
shift ;;
-h)
usage -h ;;
+ --refresh)
+ opt_refresh=1
+ shift ;;
--)
shift
break ;;
@@ -239,6 +245,7 @@ fi
for patch in $patches
do
+ [ -z "$opt_refresh" ] || quilt_command refresh $QUILT_REFRESH_ARGS
if ! remove_patch "$patch"
then
exit 1
--- /dev/null
+++ b/test/auto-refresh.test
@@ -0,0 +1,27 @@
+$ mkdir patches
+
+$ echo a > a
+$ echo b > b
+
+$ quilt new a.patch
+> Patch patches/a.patch is now on top
+$ quilt add a
+> File a added to patch patches/a.patch
+$ echo A > a
+
+$ quilt new b.patch
+> Patch patches/b.patch is now on top
+$ quilt add b
+> File b added to patch patches/b.patch
+$ echo B > b
+
+$ quilt pop -a --refresh
+> Refreshed patch patches/b.patch
+> Removing patch patches/b.patch
+> Restoring b
+>
+> Refreshed patch patches/a.patch
+> Removing patch patches/a.patch
+> Restoring a
+>
+> No patches applied