summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2004-06-06 18:42:14 +0000
committerAndreas Gruenbacher <agruen@suse.de>2004-06-06 18:42:14 +0000
commitbf2a07ca502272ae28762b3fa9b0dd68db8dc7f0 (patch)
treec558b836e59a85047d00f8363b6dc54a68529341
parent258c42fe9367b321b686492441346347390db664 (diff)
downloadquilt-bf2a07ca502272ae28762b3fa9b0dd68db8dc7f0.tar.gz
- Preserve the order of files in patches in the diff and refresh
commands. Files added to a patch appear at the end of a patch. The files command also lists the files in the order in which they appear in patches. - Update to version 0.33.
-rw-r--r--TODO8
-rw-r--r--configure.ac4
-rw-r--r--quilt.changes9
-rw-r--r--quilt/diff.in2
-rw-r--r--quilt/files.in2
-rw-r--r--quilt/refresh.in2
-rw-r--r--scripts/patchfns.in42
-rw-r--r--test/reorder.test11
8 files changed, 66 insertions, 14 deletions
diff --git a/TODO b/TODO
index 17cac6d..4b730dd 100644
--- a/TODO
+++ b/TODO
@@ -19,10 +19,6 @@ General:
Documentation:
- - Document recently added settings in .quiltrc
-
- - How to import a new version of a patch?
-
- How to import a complete directory, before doing
wild changes?
@@ -49,7 +45,7 @@ rpatch:
- If not removing the topmost patch, add checks if any files are
hidden by later patches. If so, refuse to remove patch! (Note
- that poppatch takes care of that currently.)
+ that pop takes care of that currently.)
apatch:
@@ -62,7 +58,7 @@ quilt diff:
- The number of context lines cannot be overridden in QUILT_DIFF_OPTS:
GNU diff uses three context lines as soon as -u or -U3 is on the
- command line, no matter which order of arguments are specified.
+ command line, no matter which other arguments are specified.
quit edit:
diff --git a/configure.ac b/configure.ac
index 7ab0daf..539dc30 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,8 +1,8 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT([quilt],[0.32],[quilt-dev@nongnu.org])
+AC_INIT([quilt],[0.33],[quilt-dev@nongnu.org])
AC_CONFIG_AUX_DIR(config)
AC_PREREQ(2.53)
-AC_REVISION ($Revision: 1.26 $)
+AC_REVISION ($Revision: 1.27 $)
PACKAGE_RELEASE=1
AC_SUBST(PACKAGE_RELEASE)
diff --git a/quilt.changes b/quilt.changes
index f21cab5..bb712c4 100644
--- a/quilt.changes
+++ b/quilt.changes
@@ -1,4 +1,13 @@
-------------------------------------------------------------------
+Sun Jun 6 20:16:44 CEST 2004 - agruen@suse.de
+
+- Preserve the order of files in patches in the diff and refresh
+ commands. Files added to a patch appear at the end of a patch.
+ The files command also lists the files in the order in which
+ they appear in patches.
+- Update to version 0.33.
+
+-------------------------------------------------------------------
Sun Jun 6 12:21:11 CEST 2004 - agruen@suse.de
- dependency-graph: Fix for --lines option in patcher mode;
diff --git a/quilt/diff.in b/quilt/diff.in
index 465c010..6eb2156 100644
--- a/quilt/diff.in
+++ b/quilt/diff.in
@@ -221,7 +221,7 @@ fi
for patch in ${patches[@]}
do
- for file in $(files_in_patch $patch | sort)
+ for file in $(files_in_patch_ordered $patch)
do
if [ ${#opt_files[@]} -gt 0 ] && \
! in_array "$file" "${opt_files[@]#./}"
diff --git a/quilt/files.in b/quilt/files.in
index 9166ebb..dc906c7 100644
--- a/quilt/files.in
+++ b/quilt/files.in
@@ -88,7 +88,7 @@ then
fi
fi
-for file in $(files_in_patch $patch | sort)
+for file in $(files_in_patch_ordered $patch)
do
status=" "
if [ -s $(backup_file_name $patch $file) ]
diff --git a/quilt/refresh.in b/quilt/refresh.in
index 8162715..aac2c26 100644
--- a/quilt/refresh.in
+++ b/quilt/refresh.in
@@ -123,7 +123,7 @@ trap "die 1" SIGTERM
tmpfile=$(gen_tempfile)
-for file in $(files_in_patch $patch | sort)
+for file in $(files_in_patch_ordered $patch)
do
old_file=$(backup_file_name $patch $file)
next_patch=$(next_patch_for_file $patch $file)
diff --git a/scripts/patchfns.in b/scripts/patchfns.in
index 10775ba..154c544 100644
--- a/scripts/patchfns.in
+++ b/scripts/patchfns.in
@@ -479,6 +479,48 @@ files_in_patch()
fi
}
+filenames_in_patch()
+{
+ local patch=$1
+ local patch_file=$(patch_file_name $patch)
+ if [ -e "$patch_file" ]
+ then
+ local strip=$(patch_strip_level $patch)
+ @AWK@ '
+ ($1 == "+++" || $1 == "---" || $1 == "***") && \
+ $3 != "----" && $3 != "****" \
+ { sub(/\t.*/, "")
+ sub(/^... /, "")
+ for (n=0 ; n<'"$strip"'; n++)
+ sub(/^([^/]+\/)/, "")
+ print $0 }' $patch_file
+ fi
+}
+
+files_in_patch_ordered()
+{
+ local patch=$1
+
+ ( files_in_patch $patch
+ echo "-"
+ filenames_in_patch $patch
+ ) | awk '
+ $1 == "-" { out=1 ; next }
+ !out { files[$0]=1 }
+ out { if ($0 in files && !($0 in printed)) {
+ print $0
+ printed[$0]=1
+ }
+ }
+ END {
+ for (file in files) {
+ if (!(file in printed))
+ print file
+ }
+ }
+ '
+}
+
touched_by_patch()
{
local strip=$1 patch=$2
diff --git a/test/reorder.test b/test/reorder.test
index b592932..8e45572 100644
--- a/test/reorder.test
+++ b/test/reorder.test
@@ -19,6 +19,7 @@ Regression test: Quilt did reorder files in patches.
$ cat > patches/series
< test.diff -p0
+
$ quilt push -q
> Applying test.diff
> Now at patch test.diff
@@ -28,7 +29,6 @@ Regression test: Quilt did reorder files in patches.
> No patches applied
$ echo one > h
- $ sleep 2
$ cat >> patches/test.diff
< --- h.orig
< +++ h
@@ -41,15 +41,20 @@ Regression test: Quilt did reorder files in patches.
> Now at patch test.diff
$ quilt files
- > f
> g
+ > f
> h
+ $ grep "^+++ " patches/test.diff
+ > +++ g
+ > +++ f
+ > +++ h
+
$ quilt refresh
> Refreshed patch test.diff
$ grep "^+++ " patches/test.diff
- > +++ f
> +++ g
+ > +++ f
> +++ h
$ cd ..