forked from infra/otc-metadata
Compare commits
1 Commits
main
...
gtema-patc
Author | SHA1 | Date | |
---|---|---|---|
84baf725f2 |
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,2 @@
|
|||||||
GitPython
|
GitPython
|
||||||
ruamel.yaml
|
ruamel
|
||||||
requests
|
|
||||||
jinja2
|
|
||||||
dirsync
|
|
||||||
|
@ -46,7 +46,7 @@ def process_services(args, services):
|
|||||||
has_wiki=False,
|
has_wiki=False,
|
||||||
default_delete_branch_after_merge=True,
|
default_delete_branch_after_merge=True,
|
||||||
allow_merge_commit=False,
|
allow_merge_commit=False,
|
||||||
allow_squash_merge=True,
|
allow_squash_merge=False,
|
||||||
allow_rebase_merge=False,
|
allow_rebase_merge=False,
|
||||||
default_merge_style="squash",
|
default_merge_style="squash",
|
||||||
branch_protections=[],
|
branch_protections=[],
|
||||||
|
@ -18,9 +18,9 @@ import argparse
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import warnings
|
import warnings
|
||||||
from dirsync import sync
|
|
||||||
|
|
||||||
from git import Repo
|
from git import Repo
|
||||||
from git import SymbolicReference
|
from git import SymbolicReference
|
||||||
@ -111,21 +111,13 @@ def process_repositories(args, service):
|
|||||||
new_branch.set_tracking_branch(remote_ref)
|
new_branch.set_tracking_branch(remote_ref)
|
||||||
new_branch.checkout()
|
new_branch.checkout()
|
||||||
|
|
||||||
source_path = pathlib.Path(copy_from, doc["rst_location"])
|
shutil.copytree(
|
||||||
target_path = pathlib.Path(copy_to, doc["rst_location"])
|
pathlib.Path(copy_from, doc["rst_location"]),
|
||||||
sync(
|
pathlib.Path(copy_to, doc["rst_location"]),
|
||||||
source_path,
|
ignore=lambda a, b: ["conf.py"],
|
||||||
target_path,
|
dirs_exist_ok=True,
|
||||||
'sync',
|
|
||||||
purge=True,
|
|
||||||
create=True,
|
|
||||||
content=True,
|
|
||||||
ignore=['conf.py']
|
|
||||||
)
|
)
|
||||||
repo_to.index.add([doc["rst_location"]])
|
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:
|
if len(repo_to.index.diff("HEAD")) == 0:
|
||||||
# Nothing to commit
|
# Nothing to commit
|
||||||
logging.debug("No changes.")
|
logging.debug("No changes.")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user