summaryrefslogblamecommitdiffstats
path: root/test/one.test
blob: b565b20ae3f4de377de8d5778df471b8bfec4aab (plain) (tree)
1
2
3
4
5
6
7
8
9






                                                              
                  
                            
              


                                              
                                             

                             
                                                       

                         
                                                   



                       
                                          
 
                                          
                    
                        
                                                                             
                       
                     


                            
                       
                        
                                                                             
                       
                     



                            
                                         


                                                          
                       
                            
                                                                             

                              



                                       
                                 



                                                                             




                                       
                                         

                               
                                             

                             
                                                       


                                                
                                         
 
                                       
                                                          

                      
                                        
                            
         
                                      

                         
                                                   


                                        
                                         

                    
                                        
                                      
         
                                      

                                      
                                                    

                         
                                                          
 
                     
                    
                        
                                                                             
                          
                       


                          
                                   
                                                             

                       
                                                


                                                     
                                         

                                             
                                 
                        
                                                                             

                          


                              
                                                                            

                              
                                                                                             

                                 
                                         


                                                     
                                               
                         
         
                                      

                              
                                         

                        

                                        

                            

                  
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.)

	$ rm -rf d
	$ mkdir -p d/patches
	$ cd d
	$ 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

	$ echo "This is file two." > file2
	$ quilt diff
	> Index: d/file2
	> ===================================================================
	> --- /dev/null
	> +++ d/file2
	> @@ -0,0 +1 @@
	> +This is file two.

	$ quilt diff -z
	> Index: d/file2
	> ===================================================================
	> --- /dev/null
	> +++ d/file2
	> @@ -0,0 +1 @@
	> +This is file two.

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

	$ 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.

	$ 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.

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

	$ quilt new patch2.diff
	> Patch %{P}patch2.diff is now on top

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

	$ echo "This is file three." > dir/file3
	$ quilt refresh
	> Refreshed patch %{P}patch2.diff

	$ quilt add -P patch1 dir/file3
	> File dir/file3 modified by patch %{P}patch2.diff

	$ quilt pop -R
	> Removing patch %{P}patch2.diff
	> Removing dir/file3
	>
	> Now at patch %{P}patch1.diff

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

	$ echo "This is file 4." > file4
	$ quilt refresh
	> Refreshed patch %{P}patch1.diff

	$ quilt push
	> Applying patch %{P}patch2.diff
	>~ patching file `?dir/file3'?
	>
	> Now at patch %{P}patch2.diff

	$ quilt new subdir/patch3.diff
	> Patch %{P}subdir/patch3.diff is now on top

	$ quilt add file4
	> File file4 added to patch %{P}subdir/patch3.diff

	$ rm -f file4
	$ quilt diff
	> Index: d/file4
	> ===================================================================
	> --- d.orig/file4
	> +++ /dev/null
	> @@ -1 +0,0 @@
	> -This is file 4.

	$ quilt add -P patch2 file4
	> File file4 modified by patch %{P}subdir/patch3.diff

	$ quilt refresh
	> Refreshed patch %{P}subdir/patch3.diff

	$ echo "Another line here, too." >> dir/file3
	$ quilt refresh patch2
	> Refreshed patch %{P}patch2.diff

	$ 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
	
	$ quilt refresh patch1
	> More recent patches modify files in patch %{P}patch1.diff. Enforce refresh with -f.
	
	$ quilt refresh -f patch1
	> Refreshed patch %{P}patch1.diff
	
	$ echo "Another line here, too." >> dir/file3
	$ quilt pop -R
	> Removing patch %{P}subdir/patch3.diff
	> Restoring file4
	>
	> Now at patch %{P}patch2.diff

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

	$ quilt pop -qaR
	> Removing patch %{P}patch2.diff
	> Removing patch %{P}patch1.diff
	> No patches applied

	$ cd ..
	$ rm -rf d