> > This should probably end up in a failure as it causes issues when
> > trying to pop all. push all shouldn't work.
> 
> Maybe you could propose a patch fixing the problem?

Here's a try. This attempts to:
- give a better error message when the added patch doesn't exist
- ignore empty patches upon removal as to make pop -a work (consistent
with adding).


I haven't tested that quilt still works... I just made it work on my testcase:

rm -rf patches .pc
mkdir patches
cat > patches/series << EOF
patch1.diff
patch2.diff
EOF
quilt push -a
quilt pop -a


which results in the following output:

[EMAIL PROTECTED]> ./test.sh 
Applying patch patch1.diff
Patch patches/patch1.diff does not exist
Patch patch1.diff appears to be empty, applied

Applying patch patch2.diff
Patch patches/patch2.diff does not exist
Patch patch2.diff appears to be empty, applied

Now at patch patch2.diff
Removing patch patch2.diff
Patch patch2.diff appears to be empty, removed

Removing patch patch1.diff
Patch patch1.diff appears to be empty, removed

No patches applied
Index: quilt/pop.in
===================================================================
RCS file: /cvsroot/quilt/quilt/quilt/pop.in,v
retrieving revision 1.29
diff -u -r1.29 pop.in
--- quilt/pop.in	2 Feb 2005 00:32:48 -0000	1.29
+++ quilt/pop.in	21 Jun 2005 20:35:37 -0000
@@ -181,6 +181,13 @@
 		status=$?
 		remove_from_db $patch
 		rm -f $QUILT_PC/$patch~refresh
+
+                if [ "$(shopt -s nullglob ; echo "$QUILT_PC/$patch/"*)" = "" ]
+                then
+                        printf $"Patch %s appears to be empty, removed\n" \
+                               "$(print_patch $patch)"
+                        status=0 
+                fi
 	fi
 	trap - SIGINT
 	return $status
Index: quilt/push.in
===================================================================
RCS file: /cvsroot/quilt/quilt/quilt/push.in,v
retrieving revision 1.34
diff -u -r1.34 push.in
--- quilt/push.in	12 May 2005 13:03:59 -0000	1.34
+++ quilt/push.in	21 Jun 2005 20:35:37 -0000
@@ -91,6 +91,12 @@
 	local patch=$1
 	local patch_file=$(patch_file_name $patch) output
 
+        if ! [ -f $patch_file ]
+        then
+                printf $"Patch %s does not exist\n" "$patch_file"
+                return 0
+        fi
+
 	if ! [ -s $patch_file ]
 	then
 		printf $"Patch %s appears to be empty\n" "$patch_file"
_______________________________________________
Quilt-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/quilt-dev

Reply via email to