diff hglib/__init__.py @ 218:934608d4fcba

hglib: make sure configs can be passed to clone command Differential Revision: https://phab.mercurial-scm.org/D12360
author Mathias De Mare <mathias.de_mare@nokia.com>
date Wed, 09 Mar 2022 15:08:11 +0100
parents 820d7c1e470a
children
line wrap: on
line diff
--- a/hglib/__init__.py	Tue Mar 14 13:02:48 2023 +0100
+++ b/hglib/__init__.py	Wed Mar 09 15:08:11 2022 +0100
@@ -31,6 +31,13 @@
                            pull=pull, uncompressed=uncompressed,
                            e=ssh, remotecmd=remotecmd, insecure=insecure)
 
+    # insert configs at the front so they don't interfere with positional args
+    if configs:
+        cmdconfigs = []
+        for config in configs:
+            cmdconfigs.extend(["--config", config])
+        args = cmdconfigs + args
+
     args.insert(0, HGPATH)
     proc = util.popen(args)
     out, err = proc.communicate()