? fix
? import-fix.diff
? quilt/scripts/.patchfns.in.swp
Index: quilt.changes
===================================================================
RCS file: /sources/quilt/quilt/quilt.changes,v
retrieving revision 1.484
diff -u -r1.484 quilt.changes
--- quilt.changes	31 Jan 2007 18:47:09 -0000	1.484
+++ quilt.changes	31 Jan 2007 19:40:27 -0000
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Wed Jan 31 11:37:58 PST 2007 - address@hidden
+
+- quilt import: From Brandon Philips <address@hidden>: When
+  reimporting an existing patch, update the patch strip level in
+  the series file where necessary.
+
+-------------------------------------------------------------------
 Wed Jan 31 10:46:32 PST 2007 - address@hidden
 
 - Update the German translation.
Index: quilt/import.in
===================================================================
RCS file: /sources/quilt/quilt/quilt/import.in,v
retrieving revision 1.40
diff -u -r1.40 import.in
--- quilt/import.in	1 Jun 2006 10:01:21 -0000	1.40
+++ quilt/import.in	31 Jan 2007 19:40:27 -0000
@@ -102,6 +102,7 @@
 
 eval set -- "$options"
 
+opt_strip=1
 while true
 do
         case "$1" in
@@ -134,8 +135,6 @@
 	exit 1
 fi
 
-[ -n "$opt_strip" ] && patch_args="-p$opt_strip"
-
 for patch_file in "$@"
 do
 	if [ -n "$opt_patch" ]
@@ -178,6 +177,9 @@
 		fi
 		printf $"Replacing patch %s with new version\n" \
 		       "$(print_patch $patch)" >&2
+
+		[ "$opt_strip" = "$(patch_strip_level "$patch_file")" ] \
+			|| change_db_strip_level "-p$opt_strip" "$patch_file"
 	elif [ -e "$dest" ]
 	then
 		printf $"Importing patch %s\n" "$(print_patch $patch)"
@@ -201,6 +203,9 @@
 
 	[ "$merged_patch_file" != "$patch_file" ] && rm -f "$merged_patch_file"
 
+	patch_args=
+	[ "$opt_strip" = 1 ] || patch_args="-p$opt_strip"
+
 	if ! patch_in_series $patch &&
 	   ! insert_in_series $patch "$patch_args"
 	then