summaryrefslogblamecommitdiffstats
path: root/test/merge.test
blob: a3fa6794f8c24d7e2a91d993ba5fbe02a20f90c5 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11

                                                     
                  
                            






                       


























                                



                                   

                                                           
                                                                       






                                                                             
 
                                                                            
                                                                       







                                                                             
 
                                                                  








                                                                             
                                                             











                                                                             
Test the patch merging functionality of `quilt diff'.

	$ rm -rf d
	$ mkdir -p d/patches
	$ cd d

	$ cat > abc.txt
	< a
	< b
	< c

	$ cat > patches/series
	< a.diff
	< b.diff
	< c.diff

	$ cat > patches/a.diff
	< --- merge.orig/abc.txt
	< +++ merge/abc.txt
	< @@ -1 +1 @@
	< -a
	< +a+

	$ cat > patches/b.diff
	< --- merge.orig/abc.txt
	< +++ merge/abc.txt
	< @@ -2 +2 @@
	< -b
	< +b+

	$ cat > patches/c.diff
	< --- merge.orig/abc.txt
	< +++ merge/abc.txt
	< @@ -3 +3 @@
	< -c
	< +c+

	$ quilt push -qa
	> Applying patch %{P}a.diff
	> Applying patch %{P}b.diff
	> Applying patch %{P}c.diff
	> Now at patch %{P}c.diff

	$ quilt diff -P b.diff | grep -v "^\\(---\\|+++\\)"
	> Warning: more recent patches modify files in patch %{P}b.diff
	> Index: d/abc.txt
	> ===================================================================
	> @@ -1,3 +1,3 @@
	>  a+
	> -b
	> +b+
	>  c

	$ quilt diff --combine a.diff -P b.diff | grep -v "^\\(---\\|+++\\)"
	> Warning: more recent patches modify files in patch %{P}b.diff
	> Index: d/abc.txt
	> ===================================================================
	> @@ -1,3 +1,3 @@
	> -a
	> -b
	> +a+
	> +b+
	>  c

	$ quilt diff --combine b.diff | grep -v "^\\(---\\|+++\\)"
	> Index: d/abc.txt
	> ===================================================================
	> @@ -1,3 +1,3 @@
	>  a+
	> -b
	> -c
	> +b+
	> +c+

	$ quilt diff --combine - | grep -v "^\\(---\\|+++\\)"
	> Index: d/abc.txt
	> ===================================================================
	> @@ -1,3 +1,3 @@
	> -a
	> -b
	> -c
	> +a+
	> +b+
	> +c+

	$ cd ..
	$ rm -rf d