quilt-dev
[Top][All Lists]
Advanced

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

[Quilt-dev] [PATCH] push: Fix handling of "quilt push 0"


From: Jean Delvare
Subject: [Quilt-dev] [PATCH] push: Fix handling of "quilt push 0"
Date: Fri, 24 Oct 2014 11:02:31 +0200

"quilt push 0" returns the following cryptic message:
Now at patch patches/quilt

So add the same check we already have in command pop and detect when
nothing needs to be done, returning the more sane message:
No patch applied
---
 quilt/push.in   |    5 +++++
 test/three.test |   10 ++++++++++
 2 files changed, 15 insertions(+)

--- quilt.orig/quilt/push.in    2014-10-16 10:17:41.105955215 +0200
+++ quilt/quilt/push.in 2014-10-16 10:17:41.144956083 +0200
@@ -405,6 +405,11 @@ then
 fi
 
 patches=$(list_patches)
+if [ -z "$patches" ]
+then
+       printf $"No patch applied\n" >&2
+       exit 2
+fi
 
 # In theory, these patches can't be already applied. However in the case
 # of a generated or manually tweaked series file, this could happen and
--- quilt.orig/test/three.test  2014-10-16 10:16:15.044040251 +0200
+++ quilt/test/three.test       2014-10-16 10:18:30.808062546 +0200
@@ -214,3 +214,13 @@
        > Removing patch patches/patch2.diff
        > Removing patch patches/patch1.diff
        > No patches applied
+
+       $ quilt push 0
+       > No patch applied
+       $ echo %{?}
+       > 2
+
+       $ quilt pop 0
+       > No patch removed
+       $ echo %{?}
+       > 2


-- 
Jean Delvare
SUSE L3 Support



reply via email to

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