[bitbake-devel] [PATCH] add basic branch support to fetch2/hg

Meric Sentunali merics at wirespring.com
Fri Jan 16 19:30:09 UTC 2015


following patch adds basic support to make AUTOREV work for a specific
branch for mercurial.

Signed-off-by: Meric Sentunali <merics at wirespring.com>
---
 bitbake/lib/bb/fetch2/hg.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/bitbake/lib/bb/fetch2/hg.py b/bitbake/lib/bb/fetch2/hg.py
index 5760fcd..ef00729 100644
--- a/bitbake/lib/bb/fetch2/hg.py
+++ b/bitbake/lib/bb/fetch2/hg.py
@@ -51,6 +51,7 @@ class Hg(FetchMethod):
             raise MissingParameterError('module', ud.url)

         ud.module = ud.parm["module"]
+        ud.branch = ud.parm.get('branch', 'default')

         # Create paths to mercurial checkouts
         relpath = self._strip_leading_slashes(ud.path)
@@ -98,7 +99,7 @@ class Hg(FetchMethod):
                 hgroot = ud.user + "@" + host + ud.path

         if command == "info":
-            return "%s identify -i %s://%s/%s" % (basecmd, proto, hgroot,
ud.module)
+            return "%s identify -i -r %s %s://%s/%s" % (basecmd,
ud.branch, proto, hgroot, ud.module)

         options = [];

@@ -113,7 +114,7 @@ class Hg(FetchMethod):
             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\" clone %s %s://%s/%s %s" % (basecmd, ud.user,
ud.pswd, proto, " ".join(options), proto, hgroot, ud.module, ud.module)
             else:
-                cmd = "%s clone %s %s://%s/%s %s" % (basecmd, "
".join(options), proto, hgroot, ud.module, ud.module)
+                cmd = "%s clone %s %s://%s/%s %s" % (basecmd, "
".join(options), proto, hgroot, ud.module, ud.module)
         elif command == "pull":
             # do not pass options list; limiting pull to rev causes the
local
             # repo not to contain it and immediately following "update"
command
-- 
2.1.0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20150116/c8636718/attachment-0002.html>


More information about the bitbake-devel mailing list