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

login
register
mail settings
Submitter phabricator
Date March 9, 2022, 2:08 p.m.
Message ID <differential-rev-PHID-DREV-rnfwuqha4g2kfory2xrq-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50702/
State New
Headers show

Comments

phabricator - March 9, 2022, 2:08 p.m.
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




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

Patch

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()