Compare commits

..

1 Commits

Author SHA1 Message Date
13999ae042 adding link for dws tool guide 2023-01-23 12:33:13 +00:00
3 changed files with 8 additions and 99 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2,4 +2,3 @@ GitPython
ruamel.yaml
requests
jinja2
dirsync

View File

@ -18,9 +18,9 @@ import argparse
import logging
import os
import pathlib
import shutil
import subprocess
import warnings
from dirsync import sync
from git import Repo
from git import SymbolicReference
@ -111,21 +111,13 @@ def process_repositories(args, service):
new_branch.set_tracking_branch(remote_ref)
new_branch.checkout()
source_path = pathlib.Path(copy_from, doc["rst_location"])
target_path = pathlib.Path(copy_to, doc["rst_location"])
sync(
source_path,
target_path,
'sync',
purge=True,
create=True,
content=True,
ignore=['conf.py']
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,
)
repo_to.index.add([doc["rst_location"]])
for obj in repo_to.index.diff(None).iter_change_type('D'):
repo_to.index.remove([obj.b_path])
if len(repo_to.index.diff("HEAD")) == 0:
# Nothing to commit
logging.debug("No changes.")