Replacing shutil copytree by dirsync
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				gl/check check status: failure (5ab104636bcde6c097b56db7ef293b6e593eb2d6)
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	gl/check check status: failure (5ab104636bcde6c097b56db7ef293b6e593eb2d6)
				
			This commit is contained in:
		@ -2,3 +2,4 @@ GitPython
 | 
			
		||||
ruamel.yaml
 | 
			
		||||
requests
 | 
			
		||||
jinja2
 | 
			
		||||
dirsync
 | 
			
		||||
 | 
			
		||||
@ -21,6 +21,7 @@ import pathlib
 | 
			
		||||
import shutil
 | 
			
		||||
import subprocess
 | 
			
		||||
import warnings
 | 
			
		||||
from dirsync import sync
 | 
			
		||||
 | 
			
		||||
from git import Repo
 | 
			
		||||
from git import SymbolicReference
 | 
			
		||||
@ -111,12 +112,9 @@ def process_repositories(args, service):
 | 
			
		||||
        new_branch.set_tracking_branch(remote_ref)
 | 
			
		||||
        new_branch.checkout()
 | 
			
		||||
 | 
			
		||||
        shutil.copytree(
 | 
			
		||||
            pathlib.Path(copy_from, doc["rst_location"]),
 | 
			
		||||
            pathlib.Path(copy_to, doc["rst_location"]),
 | 
			
		||||
            ignore=lambda a, b: ["conf.py"],
 | 
			
		||||
            dirs_exist_ok=True,
 | 
			
		||||
        )
 | 
			
		||||
        source_path = pathlib.Path(copy_from, doc["rst_location"])
 | 
			
		||||
        target_path = pathlib.Path(copy_to, doc["rst_location"])
 | 
			
		||||
        sync(source_path, target_path, purge=True, create=True, exclude=['conf.py'])
 | 
			
		||||
        repo_to.index.add([doc["rst_location"]])
 | 
			
		||||
        if len(repo_to.index.diff("HEAD")) == 0:
 | 
			
		||||
            # Nothing to commit
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user