summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/main.tex79
-rw-r--r--doc/quilt.pdfbin175080 -> 180811 bytes
-rw-r--r--lib/backup-files.c108
-rw-r--r--quilt.changes17
-rw-r--r--quilt/add.in13
-rw-r--r--quilt/fork.in41
-rw-r--r--quilt/snapshot.in33
-rw-r--r--scripts/patchfns.in21
-rwxr-xr-xscripts/rpatch.in3
-rw-r--r--test/example1.test138
-rw-r--r--test/snapshot.test7
-rw-r--r--test/snapshot2.test8
12 files changed, 354 insertions, 114 deletions
diff --git a/doc/main.tex b/doc/main.tex
index ac7ace5..035024b 100644
--- a/doc/main.tex
+++ b/doc/main.tex
@@ -1,5 +1,5 @@
%\documentclass[a4paper]{article}
-\documentclass[letter]{article}
+\documentclass{article}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{fancyvrb}
@@ -293,9 +293,9 @@ editor. If \textsf{EDITOR} is not set, \prog{vi} is used.)
\begin{small}
\begin{Verbatim}
\sh{$ quilt new flower.diff}
-Patch flower is now on top
+Patch flower.diff is now on top
\sh{$ quilt edit Oberon.txt}
-File Oberon.txt added to patch flower
+File Oberon.txt added to patch flower.diff
\end{Verbatim}
\end{small}
@@ -368,9 +368,9 @@ we remove the patch from the stack with \quilt{pop}:
\begin{small}
\begin{Verbatim}
\sh{$ quilt refresh}
-Refreshed patch flower
+Refreshed patch flower.diff
\sh{$ quilt pop}
-Removing flower
+Removing flower.diff
Restoring Oberon.txt
No patches applied
@@ -397,11 +397,11 @@ the following result:
\begin{small}
\begin{Verbatim}
\sh{$ quilt push}
-Applying flower
+Applying flower.diff
patching file Oberon.txt
Hunk #1 FAILED at 2.
1 out of 1 hunk FAILED -- rejects in file Oberon.txt
-Patch flower does not apply (enforce with -f)
+Patch flower.diff does not apply (enforce with -f)
\end{Verbatim}
\end{small}
@@ -418,22 +418,22 @@ however. Here is what happens when force-applying \textsf{flower.diff}:
\begin{small}
\begin{Verbatim}
\sh{$ quilt push -f}
-Applying flower
+Applying flower.diff
patching file Oberon.txt
Hunk #1 FAILED at 2.
1 out of 1 hunk FAILED -- saving rejects to file Oberon.txt.rej
-Applied flower (forced; needs refresh)
+Applied flower.diff (forced; needs refresh)
\end{Verbatim}
\end{small}
-After re-adding the line of verse from \textsf{flower.diff} to
+After re-adding the lines of verse from \textsf{flower.diff} to
\textsf{Oberon.txt}, we update the patch with \quilt{refresh}.
\begin{small}
\begin{Verbatim}
\sh{$ quilt edit Oberon.txt}
\sh{$ quilt refresh}
-Refreshed patch flower
+Refreshed patch flower.diff
\end{Verbatim}
\end{small}
@@ -468,11 +468,11 @@ With our previous example, we get the following results:
\begin{small}
\begin{Verbatim}
\sh{$ quilt top}
-flower
+flower.diff
\sh{$ quilt files}
Oberon.txt
\sh{$ quilt patches Oberon.txt}
-flower
+flower.diff
\end{Verbatim}
\end{small}
@@ -527,10 +527,26 @@ creating a copy of a patch (which must not be applied), and updating the
patch name in the series file.
The \quilt{fork} command simplifies this: it creates a copy of the
-next patch in the series (the one that \quilt{next} reports), and
-updates the series file. Unless a patch name is explicitly specified,
-\quilt{fork} will generate the following sequence of patch names:
-\textsf{patch.diff}, \textsf{patch-2.diff}, \textsf{patch-3.diff}, \dots
+topmost patch in the series, and updates the series file. Unless a patch
+name is explicitly specified, \quilt{fork} will generate the following
+sequence of patch names: \textsf{patch.diff}, \textsf{patch-2.diff},
+\textsf{patch-3.diff},\dots
+
+\subsection{Dependencies}
+\label{sec:dependencies}
+
+When the number of patches in a project grows large, it becomes
+increasingly difficult to find the right place for adding a new patch in
+the patch series. At a certain point, patches will get inserted at the
+end of the patch series, because finding the right place has become too
+complicated. In the long run this leads to more and more mess.
+
+To help keep the big picture, the \quilt{graph} command generates
+\textit{dot} graphs showing the dependencies between patches. The ouput
+of this command can be visualized using the tools from AT\&T Research's
+Graph Visualization Project (GraphViz, \url{http://www.graphviz.org/}).
+The \quilt{graph} command can generate various different kinds of
+graphs.
\subsection{Advanced Diffing}
@@ -618,24 +634,39 @@ the series file in this case.
\section{Customizing Quilt}
-The following settings influence how \textit{quilt} behaves:
+The following settings influence how quilt behaves:
\begin{description}
-\item[\textsf{QUILT\_PATCHES}]
-The location of patch files (see Section~\ref{sec:basic}).
-This setting defaults to ``\textsf{patches}''.
+\item[\textsf{QUILT\_BACKUP}]
+When set to ``\textsf{yes}'', the \quilt{refresh} command will create
+backup files when refreshing patches. The backup files have
+``\textsc{\~}'' appended to the patch file names.
\item[\textsf{QUILT\_DIFF\_OPTS}]
-Additional options that \textsf{quilt} shall pass to \prog{GNU diff}
-when generating patches. A useful setting for C source code is
+Additional options that quilt shall pass to \prog{GNU diff} when
+generating patches. A useful setting for C source code is
``\textsf{-p}'', which causes \prog{GNU diff} to show in the resulting
patch which function a change is in.
+\item[\textsf{QUILT\_NO\_DIFF\_TIMESTAMPS}]
+When set to ``\textsf{yes}'', the \quilt{diff} and \quilt{refresh}
+commands will not include file timestamps in patches.
+
+\item[\textsf{QUILT\_PATCH\_OPTS}]
+Additional options that quilt shall pass to \prog{GNU patch} when
+applying patches. (For example, some versions of \prog{GNU patch}
+support the ``\textsf{--unified-reject-files}'' option for generating
+reject files in unified diff style.
+
+\item[\textsf{QUILT\_PATCHES}]
+The location of patch files (see Section~\ref{sec:basic}). This setting
+defaults to ``\textsf{patches}''.
+
\end{description}
These settings can either be defined in the environment, or in the file
-\textsf{.quiltrc} in a user's home directory. \textsf{.quiltrc} is a
+\textsf{.quiltrc} in user home directories. \textsf{.quiltrc} is a
\prog{bash} script.
\section{Pitfalls and Known Problems}
diff --git a/doc/quilt.pdf b/doc/quilt.pdf
index b0addbb..cdbd25f 100644
--- a/doc/quilt.pdf
+++ b/doc/quilt.pdf
Binary files differ
diff --git a/lib/backup-files.c b/lib/backup-files.c
index 43449e5..15fce90 100644
--- a/lib/backup-files.c
+++ b/lib/backup-files.c
@@ -30,6 +30,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
+#include <stdlib.h>
#include <errno.h>
#include <string.h>
@@ -37,8 +38,9 @@ const char *progname;
enum { what_backup, what_restore, what_remove };
-const char *opt_prefix="", *opt_suffix="", *opt_file=NULL;
-int opt_silent=0, opt_what=what_backup, opt_ignore_missing=0;
+const char *opt_prefix="", *opt_suffix="", *opt_file;
+int opt_silent, opt_what=what_backup, opt_ignore_missing;
+int opt_nolinks;
#define LINE_LENGTH 1024
@@ -46,7 +48,7 @@ int opt_silent=0, opt_what=what_backup, opt_ignore_missing=0;
void
usage(void)
{
- printf("Usage: %s [-B prefix] [-z suffix] [-f {filelist|-}] [-s] [-r|-x] filename ...\n"
+ printf("Usage: %s [-B prefix] [-z suffix] [-f {filelist|-}] [-s] [-r|-x] [-L] filename ...\n"
"\n"
"\tCreate hard linked backup copies of a list of files\n"
"\tread from standard input.\n"
@@ -55,7 +57,8 @@ usage(void)
"\t-x\tRemove backup files and empty parent directories\n"
"\t-B\tPath name prefix for backup files\n"
"\t-z\tPath name suffix for backup files\n"
- "\t-s\tSilent operation; only print error messages\n\n",
+ "\t-s\tSilent operation; only print error messages\n"
+ "\t-L\tEnsure that when finished, the source file has a link count of 1\n\n",
progname);
}
@@ -99,12 +102,23 @@ remove_parents(char *filename)
}
static int
-link_or_copy(const char *from, struct stat *st, const char *to)
+copy(int from_fd, int to_fd)
{
char buffer[4096];
- int from_fd, to_fd, error = 1;
size_t len;
+ while ((len = read(from_fd, buffer, sizeof(buffer))) > 0) {
+ if ((write(to_fd, buffer, len)) == -1)
+ return 1;
+ }
+ return (len != 0);
+}
+
+static int
+link_or_copy(const char *from, struct stat *st, const char *to)
+{
+ int from_fd, to_fd, error = 1;
+
if (link(from, to) == 0)
return 0;
if (errno != EXDEV && errno != EPERM && errno != EMLINK) {
@@ -123,15 +137,8 @@ link_or_copy(const char *from, struct stat *st, const char *to)
close(from_fd);
return 1;
}
- while ((len = read(from_fd, buffer, sizeof(buffer))) > 0) {
- if ((write(to_fd, buffer, len)) == -1) {
- perror(to);
- unlink(to);
- goto out;
- }
- }
- if (len != 0) {
- perror(from);
+ if (copy(from_fd, to_fd)) {
+ fprintf(stderr, "%s -> %s: %s\n", from, to, strerror(errno));
unlink(to);
goto out;
}
@@ -144,6 +151,57 @@ out:
return error;
}
+static int
+ensure_nolinks(const char *filename)
+{
+ struct stat st;
+
+ if (stat(filename, &st) != 0) {
+ perror(filename);
+ return 1;
+ }
+ if (st.st_nlink > 1) {
+ char *tmpname = malloc(1 + strlen(filename) + 7 + 1), *c;
+ int from_fd = -1, to_fd = -1;
+ int error = 1;
+
+ if (!tmpname)
+ goto fail;
+ from_fd = open(filename, O_RDONLY);
+ if (from_fd == -1)
+ goto fail;
+
+ /* Temp file name is "path/to/.file.XXXXXX" */
+ strcpy(tmpname, filename);
+ strcat(tmpname, ".XXXXXX");
+ c = strrchr(tmpname, '/');
+ if (c == NULL)
+ c = tmpname;
+ else
+ c++;
+ memmove(c + 1, c, strlen(c));
+ *c = '.';
+
+ to_fd = mkstemp(tmpname);
+ if (to_fd == -1)
+ goto fail;
+ if (copy(from_fd, to_fd))
+ goto fail;
+ if (rename(tmpname, filename))
+ goto fail;
+
+ error = 0;
+ fail:
+ if (error)
+ perror(filename);
+ free(tmpname);
+ close(from_fd);
+ close(to_fd);
+ return error;
+ } else
+ return 0;
+}
+
int
process_file(char *file)
{
@@ -178,8 +236,12 @@ process_file(char *file)
} else {
if (!opt_silent)
printf("Copying %s\n", file);
- if (link_or_copy(file, &st, backup) != 0)
+ if (link_or_copy(file, &st, backup))
return 1;
+ if (opt_nolinks) {
+ if (ensure_nolinks(file))
+ return 1;
+ }
}
return 0;
} else if (opt_what == what_restore) {
@@ -204,8 +266,12 @@ process_file(char *file)
if (!opt_silent)
printf("Restoring %s\n", file);
unlink(file);
- if (link_or_copy(backup, &st, file) != 0)
+ if (link_or_copy(backup, &st, file))
return 1;
+ if (opt_nolinks) {
+ if (ensure_nolinks(file))
+ return 1;
+ }
}
if (!(st.st_mode & S_IWUSR)) {
/* Change mode of backup file so that we
@@ -225,14 +291,14 @@ process_file(char *file)
return 1;
}
- int
+int
main(int argc, char *argv[])
{
int opt, status=0;
progname = argv[0];
- while ((opt = getopt(argc, argv, "rxB:z:f:shF")) != -1) {
+ while ((opt = getopt(argc, argv, "rxB:z:f:shFL")) != -1) {
switch(opt) {
case 'r':
opt_what = what_restore;
@@ -262,6 +328,10 @@ main(int argc, char *argv[])
opt_silent = 1;
break;
+ case 'L':
+ opt_nolinks = 1;
+ break;
+
case 'h':
default:
usage();
diff --git a/quilt.changes b/quilt.changes
index 12cb138..6275ffd 100644
--- a/quilt.changes
+++ b/quilt.changes
@@ -1,13 +1,24 @@
-------------------------------------------------------------------
-Sat Mar 13 15:16:49 CET 2004 - agruen@suse.de
+Sun Mar 14 00:25:27 CET 2004 - agruen@suse.de
- Add `quilt graph' command for generating a dependency graph
between patches. This requires the graphviz package for
removing transitive edges (optional) and for rendering the
graph. Please note that the graph command itself is minimal,
while the underlying scripts/dependency-graph is more flexible.
-- Fix an open issue in the patchname filter in
- scripts/dependency-graph.
+- Complete one more detail in scripts/dependency-graph.
+- Revert `quilt fork' to how it originally worked: fork the
+ *topmost* patch, not the next unapplied patch. Adapt the
+ test suite accordingly.
+- Add flag to backup-files.c to make sure that files in the
+ working tree have a link count of at most one. Use this where
+ appropriate.
+- Fix a bug in `quilt snapshot': Taking snapshots caused files
+ to get link counts bigger than one, so modifying them could
+ cause multiple files to get modified. Speed up the command,
+ too.
+- Update the documentation. Add example1.test from the
+ documentation.
-------------------------------------------------------------------
Wed Mar 10 10:46:56 CET 2004 - agruen@suse.de
diff --git a/quilt/add.in b/quilt/add.in
index ed601f1..faea58e 100644
--- a/quilt/add.in
+++ b/quilt/add.in
@@ -101,7 +101,7 @@ do
continue
fi
- if ! @LIB@/backup-files -s -B $QUILT_PC/$patch/ $SUBDIR$file
+ if ! @LIB@/backup-files -s -L -B $QUILT_PC/$patch/ $SUBDIR$file
then
echo $"Failed to back up file $SUBDIR$file" >&2
status=1
@@ -110,17 +110,6 @@ do
if [ -e $SUBDIR$file ]
then
- if [ "$(ls -dl $SUBDIR$file | @AWK@ '{print $2}')" -gt 1 ]
- then
- # We have a file with several hard links.
- # As the file may likely be modified by hand
- # now, create a copy to make sure nothing
- # happens to the original file.
- tmpfile=$(gen_tempfile $SUBDIR$file) &&
- cp -fp $SUBDIR$file $tmpfile &&
- mv -f $tmpfile $SUBDIR$file
- rm -f $tmpfile
- fi
# The original tree may be read-only.
chmod u+w $SUBDIR$file
fi
diff --git a/quilt/fork.in b/quilt/fork.in
index 985d5e4..f33a94c 100644
--- a/quilt/fork.in
+++ b/quilt/fork.in
@@ -23,7 +23,7 @@ usage()
if [ x$1 = x-h ]
then
echo $"
-Fork the next patch. If new_name is missing, the name of the
+Fork the topmost patch. If new_name is missing, the name of the
forked patch will be the current patch name, followed by \"-2\".
If the patch name already ends in a dash-and-number, the number is
further incremented (e.g., patch.diff, patch-2.diff, patch-3.diff)."
@@ -58,46 +58,51 @@ then
usage
fi
-next_patch="$(patches_after $(top_patch) | head -n 1)"
-if [ -z "$next_patch" ]
+top_patch=$(top_patch)
+if [ -z "$top_patch" ]
then
- echo $"All patches applied" >&2
+ echo $"No patches applied" >&2
exit 1
fi
if [ $# -eq 1 ]
then
- patch="$1"
+ new_patch="$1"
else
- set -- $(echo "$next_patch" \
+ set -- $(echo "$top_patch" \
| @SED@ -e 's: :\ :g' -e 's:-\([0-9]\+\)$: \1:')
if [ $# -eq 1 ]; then
- patch="$1-2"
+ new_patch="$1-2"
else
- patch="$1-$[$2+1]"
+ new_patch="$1-$[$2+1]"
fi
- base=$(echo $next_patch \
+ base=$(echo $top_patch \
| @SED@ -e 's:\(\|\.diff\?\|\.patch\)\(\|\.gz\|\.bz2\)$::')
- patch="$patch${next_patch#$base}"
+ new_patch="$new_patch${top_patch#$base}"
fi
-patch=${patch#$QUILT_PATCHES/}
+new_patch=${new_patch#$QUILT_PATCHES/}
-if patch_in_series $patch || \
- [ -e "$(patch_file_name $patch)" ]
+if patch_in_series $new_patch || \
+ [ -d "$QUILT_PC/$new_patch" ] || \
+ [ -e "$(patch_file_name $new_patch)" ]
then
- echo $"Patch $patch exists already, please choose a new name"
+ echo $"Patch $new_patch exists already, please choose a new name"
exit 1
fi
-if ! rename_in_series "$next_patch" "$patch" || \
- ! cp -p "$(patch_file_name $next_patch)" "$(patch_file_name $patch)"
+if ! rename_in_db "$top_patch" "$new_patch" || \
+ ! rename_in_series "$top_patch" "$new_patch" || \
+ ! mv "$QUILT_PC/$top_patch" "$QUILT_PC/$new_patch" || \
+ ( [ -e "$(patch_file_name $top_patch)" ] && \
+ ! cp -p "$(patch_file_name $top_patch)" \
+ "$(patch_file_name $new_patch)" )
then
- echo $"Fork of $next_patch to $patch failed" >&2
+ echo $"Fork of $top_patch to $new_patch failed" >&2
exit 1
fi
-echo $"Fork of $next_patch created as $patch"
+echo $"Fork of $top_patch created as $new_patch"
### Local Variables:
### mode: shell-script
diff --git a/quilt/snapshot.in b/quilt/snapshot.in
index 00445ff..172a3df 100644
--- a/quilt/snapshot.in
+++ b/quilt/snapshot.in
@@ -75,28 +75,17 @@ then
fi
# Save current working state
-for patch in $(applied_patches | tac)
-do
- for file in $(files_in_patch $patch)
- do
- if ! [ -e "$QUILT_PC/$snap_subdir/$file" ]
- then
- mkdir -p "$QUILT_PC/$snap_subdir/$(dirname $file)"
- if [ -e "$file" ]
- then
- ln "$file" "$QUILT_PC/$snap_subdir/$file"
- else
- touch "$QUILT_PC/$snap_subdir/$file"
- fi
- fi
- done
-done
-
-# Now we may have some zero-size files that have no permissions
-# (which represent files that the patch creates). Those may have
-# been created in the meantime, but patch would refuse to touch
-# them: We must remove them here.
-find $QUILT_PC/$snap_subdir -type f -size 0 -exec rm -f '{}' ';'
+for patch in $(applied_patches); do
+ files_in_patch $patch
+done \
+| awk ' # filter out duplicates
+ { if (seen[$0])
+ next
+ seen[$0] = 1
+ }
+ { print }
+' \
+| @LIB@/backup-files -s -L -f - -B "$QUILT_PC/$snap_subdir/"
### Local Variables:
### mode: shell-script
diff --git a/scripts/patchfns.in b/scripts/patchfns.in
index 38d08a9..5f5bcde 100644
--- a/scripts/patchfns.in
+++ b/scripts/patchfns.in
@@ -267,6 +267,27 @@ rename_in_series()
rm -f $tmpfile
}
+rename_in_db()
+{
+ local from=$1 to=$2
+ local tmpfile
+ tmpfile=$(gen_tempfile) || return 1
+ /usr/bin/gawk '
+ /^'"$(quote_re $from)"'$/ \
+ { sub(/'"$(quote_re $from)"'/, "'"${to//\"/\\\"}"'")
+ print
+ good=1 }
+ END { exit(! good) }
+ ' $DB > $tmpfile
+ if [ $? -eq 0 ]
+ then
+ mv -f $tmpfile $DB
+ else
+ rm -f $tmpfile
+ return 1
+ fi
+}
+
backup_file_name()
{
local patch=$1
diff --git a/scripts/rpatch.in b/scripts/rpatch.in
index e3882a9..9b5d6e7 100755
--- a/scripts/rpatch.in
+++ b/scripts/rpatch.in
@@ -130,7 +130,8 @@ rpatch()
then
echo $"Removing $patch"
rm -f "$QUILT_PC/$patch/.timestamp"
- @LIB@/backup-files $silent -f $pc_file -B $QUILT_PC/$patch/ -r
+ @LIB@/backup-files $silent -r -L -f $pc_file \
+ -B $QUILT_PC/$patch/
status=$?
remove_from_db $patch
rm -f $QUILT_PC/$patch~refresh
diff --git a/test/example1.test b/test/example1.test
new file mode 100644
index 0000000..031f334
--- /dev/null
+++ b/test/example1.test
@@ -0,0 +1,138 @@
+The text used here was taken from:
+http://the-tech.mit.edu/Shakespeare/midsummer/full.html
+
+ $ mkdir example1
+ $ cd example1
+ $ cat > Oberon.txt
+ < Yet mark'd I where the bolt of Cupid fell:
+ < It fell upon a little western flower,
+ < Before milk-white, now purple with love's wound,
+ < And girls call it love-in-idleness.
+
+ $ quilt new flower.diff
+ > Patch flower.diff is now on top
+
+ $ quilt add Oberon.txt
+ > File Oberon.txt added to patch flower.diff
+
+ $ cat >> Oberon.txt
+ < The juice of it on sleeping eye-lids laid
+ < Will make a man or woman madly dote
+ < Upon the next live creature that it sees.
+
+Or ``quilt edit Oberon.txt''
+
+ $ quilt refresh
+ > Refreshed patch flower.diff
+
+ $ cat patches/flower.diff | sed -e "s/\\t.*//"
+ > Index: example1/Oberon.txt
+ > ===================================================================
+ > --- example1.orig/Oberon.txt
+ > +++ example1/Oberon.txt
+ > @@ -2,3 +2,6 @@
+ > It fell upon a little western flower,
+ > Before milk-white, now purple with love's wound,
+ > And girls call it love-in-idleness.
+ > +The juice of it on sleeping eye-lids laid
+ > +Will make a man or woman madly dote
+ > +Upon the next live creature that it sees.
+
+ $ sed -e "4aFetch me that flower; the herb I shew'd thee once:" Oberon.txt > Oberon.new
+ $ mv Oberon.new Oberon.txt
+ $ quilt diff -z | sed -e "s/\\t.*//"
+ > Index: example1/Oberon.txt
+ > ===================================================================
+ > --- example1.orig/Oberon.txt
+ > +++ example1/Oberon.txt
+ > @@ -2,6 +2,7 @@
+ > It fell upon a little western flower,
+ > Before milk-white, now purple with love's wound,
+ > And girls call it love-in-idleness.
+ > +Fetch me that flower; the herb I shew'd thee once:
+ > The juice of it on sleeping eye-lids laid
+ > Will make a man or woman madly dote
+ > Upon the next live creature that it sees.
+
+ $ quilt diff | sed -e "s/\\t.*//"
+ > Index: example1/Oberon.txt
+ > ===================================================================
+ > --- example1.orig/Oberon.txt
+ > +++ example1/Oberon.txt
+ > @@ -2,3 +2,7 @@
+ > It fell upon a little western flower,
+ > Before milk-white, now purple with love's wound,
+ > And girls call it love-in-idleness.
+ > +Fetch me that flower; the herb I shew'd thee once:
+ > +The juice of it on sleeping eye-lids laid
+ > +Will make a man or woman madly dote
+ > +Upon the next live creature that it sees.
+
+ $ quilt refresh
+ > Refreshed patch flower.diff
+
+ $ quilt top
+ > flower.diff
+
+ $ quilt files
+ > Oberon.txt
+
+ $ quilt patches Oberon.txt
+ > flower.diff
+ $ quilt pop -f
+ > Removing flower.diff
+ > Restoring Oberon.txt
+ >
+ > No patches applied
+
+ $ sed -e "s/girls/maidens/" Oberon.txt > Oberon.new
+ $ mv Oberon.new Oberon.txt
+ $ quilt push
+ > Applying flower.diff
+ > patching file Oberon.txt
+ > Hunk #1 FAILED at 2.
+ > 1 out of 1 hunk FAILED -- rejects in file Oberon.txt
+ > Patch flower.diff does not apply (enforce with -f)
+
+ $ quilt push -f
+ > Applying flower.diff
+ > patching file Oberon.txt
+ > Hunk #1 FAILED at 2.
+ > 1 out of 1 hunk FAILED -- saving rejects to file Oberon.txt.rej
+ > Applied flower.diff (forced; needs refresh)
+
+ $ cat >> Oberon.txt
+ < Fetch me that flower; the herb I shew'd thee once:
+ < The juice of it on sleeping eye-lids laid
+ < Will make a man or woman madly dote
+ < Upon the next live creature that it sees.
+
+ $ quilt refresh
+ > Refreshed patch flower.diff
+
+ $ cat Oberon.txt
+ > Yet mark'd I where the bolt of Cupid fell:
+ > It fell upon a little western flower,
+ > Before milk-white, now purple with love's wound,
+ > And maidens call it love-in-idleness.
+ > Fetch me that flower; the herb I shew'd thee once:
+ > The juice of it on sleeping eye-lids laid
+ > Will make a man or woman madly dote
+ > Upon the next live creature that it sees.
+
+ $ cat patches/flower.diff
+ > Index: example1/Oberon.txt
+ > ===================================================================
+ > --- example1.orig/Oberon.txt
+ > +++ example1/Oberon.txt
+ > @@ -2,3 +2,7 @@
+ > It fell upon a little western flower,
+ > Before milk-white, now purple with love's wound,
+ > And maidens call it love-in-idleness.
+ > +Fetch me that flower; the herb I shew'd thee once:
+ > +The juice of it on sleeping eye-lids laid
+ > +Will make a man or woman madly dote
+ > +Upon the next live creature that it sees.
+
+ $ cd ..
+ $ rm -rf example1
diff --git a/test/snapshot.test b/test/snapshot.test
index 1c0abf6..f70003e 100644
--- a/test/snapshot.test
+++ b/test/snapshot.test
@@ -16,17 +16,10 @@
$ quilt refresh
> Refreshed patch snapshot
$ quilt snapshot
- $ quilt pop -q
- > Removing snapshot
- > No patches applied
$ quilt fork
> Fork of snapshot created as snapshot-2
- $ quilt push -q
- > Applying snapshot-2
- > Now at patch snapshot-2
-
$ quilt remove g.txt
> File g.txt removed from patch snapshot-2
diff --git a/test/snapshot2.test b/test/snapshot2.test
index b0d91e7..0f993cc 100644
--- a/test/snapshot2.test
+++ b/test/snapshot2.test
@@ -17,17 +17,9 @@
$ quilt refresh
> Refreshed patch snapshot
$ quilt snapshot
- $ quilt pop -q
- > Removing snapshot
- > No patches applied
-
$ quilt fork
> Fork of snapshot created as snapshot-2
- $ quilt push -q
- > Applying snapshot-2
- > Now at patch snapshot-2
-
$ quilt remove g.txt
> File d/g.txt removed from patch snapshot-2