D12360: hglib: make sure configs can be passed to clone command

Mathiasdm (Mathias De Maré) phabricator at mercurial-scm.org
Wed Mar 9 14:08:24 UTC 2022


Mathiasdm created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12360

AFFECTED FILES
  hglib/__init__.py

CHANGE DETAILS

diff --git a/hglib/__init__.py b/hglib/__init__.py
--- a/hglib/__init__.py
+++ b/hglib/__init__.py
@@ -31,6 +31,12 @@
                            pull=pull, uncompressed=uncompressed,
                            e=ssh, remotecmd=remotecmd, insecure=insecure)
 
+    # insert configs at the front so they don't interfere with positional args
+    cmdconfigs = []
+    for config in configs:
+        cmdconfigs.extend(["--config", config])
+    args = cmdconfigs + args
+
     args.insert(0, HGPATH)
     proc = util.popen(args)
     out, err = proc.communicate()



To: Mathiasdm, #hg-reviewers
Cc: mercurial-patches, mercurial-devel


More information about the Mercurial-devel mailing list