~ubuntu-dev/ubuntu/lucid/quilt/lucid-201002101907

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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
This test is very similar to one.test, except that it uses a symlinked .pc
directory.

	$ rm -rf d pc
	$ mkdir -p d/patches pc
	$ cd d
	$ ln -s ../pc .pc
	$ mkdir dir
	$ echo "This is file one." > dir/file1
	$ quilt new patch1.diff
	> Patch %{P}patch1.diff is now on top

	$ quilt add dir/file1
	> File dir/file1 added to patch %{P}patch1.diff

	$ quilt add file2
	> File file2 added to patch %{P}patch1.diff

	$ quilt diff
	$ quilt diff -z
	$ quilt refresh
	> Nothing in patch %{P}patch1.diff

	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ echo "This is file two." > file2
	$ quilt diff
	> Index: d/file2
	> ===================================================================
	> --- /dev/null
	> +++ d/file2
	> @@ -0,0 +1 @@
	> +This is file two.

	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ quilt diff -z
	> Index: d/file2
	> ===================================================================
	> --- /dev/null
	> +++ d/file2
	> @@ -0,0 +1 @@
	> +This is file two.

	$ quilt refresh
	> Refreshed patch %{P}patch1.diff

	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ quilt diff -z
	$ echo "Another line has been added." >> dir/file1
	$ quilt diff -z
	> Index: d/dir/file1
	> ===================================================================
	> --- d.orig/dir/file1
	> +++ d/dir/file1
	> @@ -1 +1,2 @@
	>  This is file one.
	> +Another line has been added.

	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ quilt diff -z dir/file1
	> Index: d/dir/file1
	> ===================================================================
	> --- d.orig/dir/file1
	> +++ d/dir/file1
	> @@ -1 +1,2 @@
	>  This is file one.
	> +Another line has been added.

	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ quilt refresh
	> Refreshed patch %{P}patch1.diff

	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ quilt new patch2.diff
	> Patch %{P}patch2.diff is now on top

	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ quilt add dir/file3
	> File dir/file3 added to patch %{P}patch2.diff

	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ echo "This is file three." > dir/file3
	$ quilt refresh
	> Refreshed patch %{P}patch2.diff

	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ quilt add -P patch1 dir/file3
	> File dir/file3 modified by patch %{P}patch2.diff

	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ quilt pop -R
	> Removing patch %{P}patch2.diff
	> Removing dir/file3
	>
	> Now at patch %{P}patch1.diff

	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ quilt add file4
	> File file4 added to patch %{P}patch1.diff

	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ echo "This is file 4." > file4
	$ quilt refresh
	> Refreshed patch %{P}patch1.diff

	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ quilt push
	> Applying patch %{P}patch2.diff
	>~ patching file `?dir/file3'?
	>
	> Now at patch %{P}patch2.diff

	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ quilt new subdir/patch3.diff
	> Patch %{P}subdir/patch3.diff is now on top

	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ quilt add file4
	> File file4 added to patch %{P}subdir/patch3.diff

	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ rm file4
	$ quilt diff
	> Index: d/file4
	> ===================================================================
	> --- d.orig/file4
	> +++ /dev/null
	> @@ -1 +0,0 @@
	> -This is file 4.

	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ quilt add -P patch2 file4
	> File file4 modified by patch %{P}subdir/patch3.diff

	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ quilt refresh
	> Refreshed patch %{P}subdir/patch3.diff

	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ echo "Another line here, too." >> dir/file3
	$ quilt refresh patch2
	> Refreshed patch %{P}patch2.diff

	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ echo "Another line added." >> file2
	$ quilt diff -z -P patch1
	> Index: d/file2
	> ===================================================================
	> --- d.orig/file2
	> +++ d/file2
	> @@ -1 +1,2 @@
	>  This is file two.
	> +Another line added.
	> Warning: more recent patches modify files in patch %{P}patch1.diff
	
	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ quilt refresh patch1
	> More recent patches modify files in patch %{P}patch1.diff. Enforce refresh with -f.
	
	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ quilt refresh -f patch1
	> Refreshed patch %{P}patch1.diff
	
	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ echo "Another line here, too." >> dir/file3
	$ quilt pop -R
	> Removing patch %{P}subdir/patch3.diff
	> Restoring file4
	>
	> Now at patch %{P}patch2.diff

	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ quilt refresh patch2
	> Refreshed patch %{P}patch2.diff

	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ quilt pop -qaR
	> Removing patch %{P}patch2.diff
	> Removing patch %{P}patch1.diff
	> No patches applied

	$ test -L .pc || echo ".pc isn't a symlink anymore"
	$ cd ..
#	$ rm -rf d pc