File: push_timeskew.test

package info (click to toggle)
quilt 0.65-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,980 kB
  • sloc: sh: 5,898; perl: 1,256; lisp: 492; makefile: 430
file content (86 lines) | stat: -rw-r--r-- 2,343 bytes parent folder | download | duplicates (5)
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!"