Index: Makefile.in =================================================================== RCS file: /cvsroot/quilt/quilt/Makefile.in,v retrieving revision 1.27 diff -u -r1.27 Makefile.in --- Makefile.in 21 Oct 2003 11:33:11 -0000 1.27 +++ Makefile.in 21 Oct 2003 17:24:31 -0000 @@ -57,7 +57,7 @@ QUILT_IN := add applied delete diff files import new next patches \ pop previous push refresh remove series setup top unapplied \ - fork + fork snapshot QUILT_SRC := $(QUILT_IN:%=%.in) QUILT := $(QUILT_IN) Index: quilt/diff.in =================================================================== RCS file: /cvsroot/quilt/quilt/quilt/diff.in,v retrieving revision 1.22 diff -u -r1.22 diff.in --- quilt/diff.in 26 Jul 2003 11:06:55 -0000 1.22 +++ quilt/diff.in 21 Oct 2003 17:24:31 -0000 @@ -87,7 +87,7 @@ exit $status } -options=`getopt -o p:P:c:Rzh --long diff: -- "$@"` +options=`getopt -o p:P:c:Rzh --long diff:,snapshot -- "$@"` if [ $? -ne 0 ] then @@ -116,8 +116,12 @@ shift ;; -h) usage -h ;; + --snapshot) + opt_snapshot=1 + snap_dir=.pc/.snap0 + shift ;; --diff) - opt_diff=$2 + opt_diff="$2" shift 2 ;; --) shift @@ -159,6 +163,21 @@ die 1 fi +if [ -n "$opt_snapshot" -a address@hidden -eq 0 ] +then + # Add all files in the snapshot into the file list (they may all + # have changed). + while read file + do + address@hidden"-" + file="${file#$snap_dir/}" + address@hidden"$file" + done \ + < <(find $snap_dir -type f) + # Also look at all patches that are currently applied. + opt_combine="$(applied_patches | head -n 1)" +fi + if [ -n "$opt_combine" ] then if ! refresh_patches_per_file @@ -188,6 +207,7 @@ then continue fi + in_array "$file" "address@hidden" && continue address@hidden"$first" address@hidden"$file" done \ @@ -200,11 +220,12 @@ then continue fi + in_array "$file" "address@hidden" && continue address@hidden"$file" done fi -if [ address@hidden -gt 0 ] +if [ address@hidden -gt 0 -a -z "$opt_snapshot" ] then for file in "address@hidden" do @@ -271,6 +292,16 @@ file="${files[$i]}" first_patch=${patches[$i]:-$last_patch} + if [ -n "$opt_snapshot" -a -e "$snap_dir/$file" ] + then + old_file="$snap_dir/$file" + elif [ -z "$opt_relative" ] + then + old_file="$(backup_file_name $first_patch $file)" + else + old_file="$workdir/$file" + fi + next_patch=$(next_patch_for_file $last_patch $file) if [ -z "$next_patch" ] then @@ -280,13 +311,7 @@ files_were_shadowed=1 fi - if [ -z "$opt_relative" ] - then - old_file=$(backup_file_name $first_patch $file) - do_diff $file $old_file $new_file - else - do_diff $file "$workdir/$file" $new_file - fi + do_diff "$file" "$old_file" "$new_file" if [ $? -ne 0 ] then