1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
This test enforces that files touched by a patch have the exact same
mtime when pushing and poping the patch.
(To run, type `./run push_timeskew.test' in this directory.)
$ mkdir patches d
$ quilt new patch1
> Patch %{P}patch1 is now on top
$ cd d
$ mkdir dir
$ echo "This is file one." > dir/file1
$ quilt add dir/file1
> File d/dir/file1 added to patch %{_P}patch1
$ echo "This is file two." > dir/file2
$ quilt add dir/file2
> File d/dir/file2 added to patch %{_P}patch1
$ echo "More content to file one." >> dir/file1
$ echo "More content to file two." >> dir/file2
$ quilt refresh
> Refreshed patch %{_P}patch1
$ quilt pop -q
> Removing patch %{_P}patch1
> No patches applied
$ test dir/file1 -nt dir/file2 && echo "timeskew!"
$ test dir/file2 -nt dir/file1 && echo "timeskew!"
$ quilt push -q
> Applying patch %{_P}patch1
> Now at patch %{_P}patch1
$ test dir/file1 -nt dir/file2 && echo "timeskew!"
$ test dir/file2 -nt dir/file1 && echo "timeskew!"
# And now, enforces that this timestamp fixup don't create unwanted files
$ quilt new patch2.diff
> Patch %{_P}patch2.diff is now on top
$ echo "some content" > dir/file_removed
$ quilt add dir/file_removed
> File d/dir/file_removed added to patch %{_P}patch2.diff
$ quilt add dir/file_created
> File d/dir/file_created added to patch %{_P}patch2.diff
$ rm dir/file_removed
$ echo "some content" > dir/file_created
$ quilt refresh
> Refreshed patch %{_P}patch2.diff
$ quilt diff --no-timestamps --no-index -p ab
> --- /dev/null
> +++ b/d/dir/file_created
> @@ -0,0 +1 @@
> +some content
> --- a/d/dir/file_removed
> +++ /dev/null
> @@ -1 +0,0 @@
> -some content
$ quilt pop
> Removing patch %{_P}patch2.diff
> Removing d/dir/file_created
> Restoring d/dir/file_removed
>
> Now at patch %{_P}patch1
$ test -e dir/file_created && echo "Created file should not exist when patch is poped!"
$ test ! -e dir/file_removed && echo "Deleted file should exist when patch is poped!"
$ quilt push
> Applying patch %{_P}patch2.diff
> patching file d/dir/file_created
> patching file d/dir/file_removed
>
> Now at patch %{_P}patch2.diff
$ test ! -e dir/file_created && echo "Created file should exist when patch is pushed!"
$ test -e dir/file_removed && echo "Deleted file should not exist when patch is pushed!"
|