summaryrefslogtreecommitdiffstats
path: root/test/fold.test
blob: fa84a39c994fa2c603102588b23bb3f028a12b69 (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
	$ rm -rf d
	$ mkdir -p d/patches
	$ cd d

	$ cat > patches/series
	< patch1.diff
	
	$ cat > patches/patch1.diff
	< --- q.orig/file1.txt
	< +++ q/file1.txt
	< @@ -0,0 +1 @@
	< +This is file1.txt.
	< --- q.orig/file2.txt
	< +++ q/file2.txt
	< @@ -0,0 +1 @@
	< +This is file2.txt.

	$ quilt push -q
	> Applying patch %{P}patch1.diff
	> Now at patch %{P}patch1.diff

	$ quilt files
	> file1.txt
	> file2.txt

	$ quilt fold -q
	< --- q.orig/file2.txt
	< +++ q/file2.txt
	< @@ -1 +0,0 @@
	< -This is file2.txt.
	< --- q.orig/dir/file3.txt  
	< +++ q/dir/file3.txt
	< @@ -0,0 +1 @@
	< +This is file3.txt.

	$ quilt diff
	> Index: d/file1.txt
	> ===================================================================
	> --- /dev/null
	> +++ d/file1.txt
	> @@ -0,0 +1 @@
	> +This is file1.txt.
	> Index: d/dir/file3.txt
	> ===================================================================
	> --- /dev/null
	> +++ d/dir/file3.txt
	> @@ -0,0 +1 @@
	> +This is file3.txt.

	$ cd dir
	$ quilt fold -q
	< --- dir.orig/file3.txt  
	< +++ dir/file3.txt
	< @@ -1 +1 @@
	< -This is file3.txt.
	< +This is file3.txt, now modified.

	$ cd ..
	$ quilt diff
	> Index: d/file1.txt
	> ===================================================================
	> --- /dev/null
	> +++ d/file1.txt
	> @@ -0,0 +1 @@
	> +This is file1.txt.
	> Index: d/dir/file3.txt
	> ===================================================================
	> --- /dev/null
	> +++ d/dir/file3.txt
	> @@ -0,0 +1 @@
	> +This is file3.txt, now modified.

	$ cd ..
	$ rm -rf d