Skip to contentSkip to conversation

HG clone using subrepositories with username and password in url

PATCH Volker Vogelhuber 2 participants 2 messages Aug 27, 2014

lore
Share & tools
lore
#0 lore raw

In case one uses mercurial subrepositories, updating to a specific revision may need an additional authentication for the subrepository. So the attached patch adds the missing authentication parameters to the hg update call.

From 45f7226b02e0911f7a612ab208b2139cbd03ec56 Mon Sep 17 00:00:00 2001
From: Volker Vogelhuber <[email protected]>
Date: Wed, 27 Aug 2014 12:41:35 +0200
Subject: [PATCH 1/1] Fixed authentication during update in case of using
subrepositories

---
 bitbake/lib/bb/fetch2/hg.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
bitbake/lib/bb/fetch2/hg.py +4 -1
index cf21481..ab7b5f8 100644
@@ -120,7 +120,10 @@ class Hg(FetchMethod):
             else:
                 cmd = "%s pull" % (basecmd)
         elif command == "update":
-            cmd = "%s update -C %s" % (basecmd, " ".join(options))
+            if ud.user and ud.pswd:
+                cmd = "%s --config auth.default.prefix=* --config auth.default.username=%s --config auth.default.password=%s --config \"auth.default.schemes=%s\" update -C %s" % (basecmd, ud.user, ud.pswd, proto, " ".join(options))
+            else:
+                cmd = "%s update -C %s" % (basecmd, " ".join(options))
         else:
             raise FetchError("Invalid hg command %s" % command, ud.url)
 
Signature · 1 line
1.9.1