[PATCH 1 of 7] hglib: make sure configs can be passed to clone command

Mathias De Mare mathias.de_mare at nokia.com
Tue Mar 14 08:26:33 UTC 2023


# HG changeset patch
# User Mathias De Mare <mathias.de_mare at nokia.com>
# Date 1646834891 -3600
#      Wed Mar 09 15:08:11 2022 +0100
# Node ID 2876df3b730bb565d4f64764dd900b2ddb47a19c
# Parent  68588c652ac6949c2e21531488aa138ecaab2442
hglib: make sure configs can be passed to clone command

Differential Revision: https://phab.mercurial-scm.org/D12360

diff --git a/hglib/__init__.py b/hglib/__init__.py
--- a/hglib/__init__.py
+++ b/hglib/__init__.py
@@ -31,6 +31,13 @@ def clone(source=None, dest=None, noupda
                            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()



More information about the Mercurial-devel mailing list