# HG changeset patch
# User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr>
# Date 1633075363 -7200
#      Fri Oct 01 10:02:43 2021 +0200
# Node ID 3542e201177bd71717f0b07d8dc3fc220cbc5a87
# Parent  de9c4651e4437b48fd26a92e7422f7f5027f735e
✨ add option to set the repo path of the sources copy

TG-237

diff --git a/NEWS.rst b/NEWS.rst
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -2,6 +2,11 @@
 History
 =======
 
+11.1.0
+------
+
+Add the possibility to indicate a different path for the copied sources.
+
 11.0.1
 ------
 
diff --git a/README.rst b/README.rst
--- a/README.rst
+++ b/README.rst
@@ -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.
 
diff --git a/odoo_scripts/config.py b/odoo_scripts/config.py
--- a/odoo_scripts/config.py
+++ b/odoo_scripts/config.py
@@ -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):
diff --git a/odoo_scripts/update_duplicate_sources.py b/odoo_scripts/update_duplicate_sources.py
--- a/odoo_scripts/update_duplicate_sources.py
+++ b/odoo_scripts/update_duplicate_sources.py
@@ -15,9 +15,9 @@
 
 _logger = logging.getLogger(__name__)
 
-__version__ = "1.0.0"
+__version__ = "1.1.0"
 __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,9 +86,14 @@
     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
-    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",