Browse Source

bitbake: fetch2/hg: Fix username/password handling

We should only add user/password options if they're specified as in the
fetch case. Patch from Volker Vogelhuber <v.vogelhuber@digitalendoscopy.de>

(Bitbake rev: 303e6256947f4df4f283b75b7ccfdffa72864d67)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Richard Purdie 10 years ago
parent
commit
c79b7f06af
1 changed files with 4 additions and 1 deletions
  1. 4 1
      bitbake/lib/bb/fetch2/hg.py

+ 4 - 1
bitbake/lib/bb/fetch2/hg.py

@@ -123,7 +123,10 @@ class Hg(FetchMethod):
             else:
                 cmd = "%s pull" % (basecmd)
         elif command == "update":
-            cmd = "%s update --config auth.default.prefix=* --config auth.default.username=%s --config auth.default.password=%s --config \"auth.default.schemes=%s\" -C %s" % (basecmd, ud.user, ud.pswd, proto, " ".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)