]> code.ossystems Code Review - openembedded-core.git/commitdiff
bb.fetch2.hg: add hg urldata_init
authorYu Ke <ke.yu@intel.com>
Mon, 27 Dec 2010 02:35:19 +0000 (10:35 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 10 Jan 2011 20:21:59 +0000 (20:21 +0000)
move the hg specific urldata init from localpath to urldata_init
so that it can be called early

Signed-off-by: Yu Ke <ke.yu@intel.com>
bitbake/lib/bb/fetch2/hg.py

index 9e91bec1861ae81b12d5e8f378a55a55531d67a9..80a155108c8fdb2409526a351cc81041c98360c4 100644 (file)
@@ -43,11 +43,10 @@ class Hg(Fetch):
         """
         return ud.type in ['hg']
 
-    def forcefetch(self, url, ud, d):
-        revTag = ud.parm.get('rev', 'tip')
-        return revTag == "tip"
-
-    def localpath(self, url, ud, d):
+    def urldata_init(self, ud, d):
+        """
+        init hg specific variable within url data
+        """
         if not "module" in ud.parm:
             raise MissingParameterError("hg method needs a 'module' parameter")
 
@@ -58,6 +57,11 @@ class Hg(Fetch):
         ud.pkgdir = os.path.join(data.expand('${HGDIR}', d), ud.host, relpath)
         ud.moddir = os.path.join(ud.pkgdir, ud.module)
 
+    def forcefetch(self, url, ud, d):
+        revTag = ud.parm.get('rev', 'tip')
+        return revTag == "tip"
+
+    def localpath(self, url, ud, d):
         if 'rev' in ud.parm:
             ud.revision = ud.parm['rev']
         else: