From f684ff18a2b9565823a41750af369dee392f6142 Mon Sep 17 00:00:00 2001 From: Yu Ke Date: Mon, 27 Dec 2010 10:35:19 +0800 Subject: bb.fetch2.hg: add hg urldata_init move the hg specific urldata init from localpath to urldata_init so that it can be called early Signed-off-by: Yu Ke --- bitbake/lib/bb/fetch2/hg.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'bitbake/lib/bb/fetch2') diff --git a/bitbake/lib/bb/fetch2/hg.py b/bitbake/lib/bb/fetch2/hg.py index 9e91bec18..80a155108 100644 --- a/bitbake/lib/bb/fetch2/hg.py +++ b/bitbake/lib/bb/fetch2/hg.py @@ -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: -- cgit v1.2.3