Skip to content
Snippets Groups Projects
Commit 3542e201177b authored by Vincent Hatakeyama's avatar Vincent Hatakeyama
Browse files

:sparkles: add option to set the repo path of the sources copy

TG-237
parent de9c4651e443
No related branches found
No related tags found
1 merge request!59TG-237 Add an option to specify the cloned source repository
......@@ -2,6 +2,11 @@
History
=======
11.1.0
------
Add the possibility to indicate a different path for the copied sources.
11.0.1
------
......
......@@ -115,6 +115,7 @@
- ``modules``: list of directories and files to include (also used by another script)
- ``dependencies``: list of directories and files to include (also used by another script)
- ``other_sources``: list of directories and files to include (only used by this script, used for README, ReleaseNotes, script directories, etc.)
- ``duplicate_repo``: target repository, if none are specified, uses the same URL and append `_sources` to it.
No change are made to the name of the directories/files included.
......
......@@ -160,7 +160,12 @@
# those keys are single string values, no expand
for key in ("db_user", "db_password", "load-language"):
for key in (
"db_user",
"db_password",
"load-language",
"duplicate_repo",
):
setattr(self, key_format(key), section.get(key, None))
def read_expanded(key: str, default_value=None):
......
......@@ -15,5 +15,5 @@
_logger = logging.getLogger(__name__)
__version__ = "1.0.0"
__version__ = "1.1.0"
__date__ = "2020-06-19"
......@@ -19,5 +19,5 @@
__date__ = "2020-06-19"
__updated__ = "2020-06-30"
__updated__ = "2021-10-01"
def __parser():
......@@ -31,7 +31,7 @@
program_license = """%s
Created by Vincent Hatakeyama on %s.
Copyright 2018, 2020 XCG Consulting. All rights reserved.
Copyright 2018, 2020, 2021 XCG Consulting. All rights reserved.
Licensed under the MIT License
......@@ -86,4 +86,5 @@
if b"tip" in tags:
tags.remove(b"tip")
_logger.info("Current tags %s", ", ".join(u(tag) for tag in tags))
# XXX get topics?
# find the duplicate repository URL
......@@ -89,6 +90,10 @@
# find the duplicate repository URL
remote_path = hg.paths(b(path))
duplicate_path = b("{}_sources".format(u(remote_path)))
c = Config()
if c.duplicate_repo:
duplicate_path = b(c.duplicate_repo)
else:
remote_path = hg.paths(b(path))
duplicate_path = b("{}_sources".format(u(remote_path)))
_logger.info("Clone path %s", u(duplicate_path))
# clone the duplicate repository
duplicate_destination = b"sources"
......@@ -122,7 +127,6 @@
"Branch %s not found in duplicate, updating to tip", u(branch)
)
# rsync content inside the other directory
c = Config()
cmd = (
[
"rsync",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment