summaryrefslogtreecommitdiffstats
path: root/test/one.test
blob: d72858f5dfebb2db059513170b756f44dace2a31 (plain) (blame)
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
This is a minimal test script that runs a few quilt commands
and verifies their output. Much needs to be done; particularly
it sould be possible to run the tests using the built instead
of the installed quilt with `make check'.

(To run, type `./run one.test' in this directory.)

	$ mkdir d
	$ cd d
	$ mkdir dir
	$ echo "This is file one." > dir/file1
	$ quilt new patch1.diff
	> Patch patch1 is now on top

	$ quilt add dir/file1
	> File dir/file1 added to patch patch1

	$ quilt add file2
	> File file2 added to patch patch1

	$ quilt diff
	$ quilt diff -z
	$ quilt refresh
	> Nothing in patch patch1

	$ echo "This is file two." > file2
	$ quilt diff | sed -e "s/\\t.*//"
	> Index: d/file2
	> ===================================================================
	> --- d.orig/file2
	> +++ d/file2
	> @@ -0,0 +1 @@
	> +This is file two.

	$ quilt diff -z | sed -e "s/\\t.*//"
	> Index: d/file2
	> ===================================================================
	> --- d.orig/file2
	> +++ d/file2
	> @@ -0,0 +1 @@
	> +This is file two.

	$ quilt refresh
	> Refreshed patch patch1

	$ quilt diff -z
	$ echo "Another line has been added." >> dir/file1
	$ quilt diff -z | sed -e "s/\\t.*//"
	> Index: d/dir/file1
	> ===================================================================
	> --- d.orig/dir/file1
	> +++ d/dir/file1
	> @@ -1 +1,2 @@
	>  This is file one.
	> +Another line has been added.

	$ quilt refresh
	> Refreshed patch patch1

	$ quilt new patch2.diff
	> Patch patch2 is now on top

	$ quilt add dir/file3
	> File dir/file3 added to patch patch2

	$ echo "This is file three." > dir/file3
	$ quilt refresh
	> Refreshed patch patch2

	$ quilt add -p patch1 dir/file3
	> File dir/file3 modified by patch patch2

	$ quilt pop -R
	> Removing patch2
	> Removing dir/file3
	>
	> Now at patch patch1

	$ quilt add file4
	> File file4 added to patch patch1

	$ echo "This is file 4." > file4
	$ quilt refresh
	> Refreshed patch patch1

	$ quilt push
	> Applying patch2
	> patching file dir/file3
	>
	> Now at patch patch2

	$ quilt new subdir/patch3.diff
	> Patch subdir/patch3 is now on top

	$ quilt add file4
	> File file4 added to patch subdir/patch3

	$ rm file4
	$ quilt diff | sed -e "s/\\t.*//"
	> Index: d/file4
	> ===================================================================
	> --- d.orig/file4
	> +++ d/file4
	> @@ -1 +0,0 @@
	> -This is file 4.

	$ quilt add -p patch2 file4
	> File file4 modified by patch subdir/patch3

	$ quilt refresh
	> Refreshed patch subdir/patch3

	$ echo "Another line here, too." >> dir/file3
	$ quilt refresh patch2
	> Refreshed patch patch2

	$ echo "Another line added." >> file2
	$ quilt diff -z -P patch1 | sed -e "s/\\t.*//"
	> Index: d/file2
	> ===================================================================
	> --- d.orig/file2
	> +++ d/file2
	> @@ -1 +1,2 @@
	>  This is file two.
	> +Another line added.
	> More recent patches modify files in patch1.
	
	$ quilt refresh patch1
	> More recent patches modify files in patch1. Enforce refresh with -f.
	
	$ quilt refresh -f patch1
	> Refreshed patch patch1
	
	$ echo "Another line here, too." >> dir/file3
	$ quilt pop -R
	> Removing subdir/patch3
	> Restoring file4
	>
	> Now at patch patch2

	$ quilt refresh patch2
	> Refreshed patch patch2

	$ quilt pop -qaR
	> Removing patch2
	> Removing patch1
	> No patches applied

	$ cd ..
	$ rm -rf d