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 <ke.yu@intel.com>
This commit is contained in:
Yu Ke 2010-12-27 10:35:19 +08:00 committed by Richard Purdie
parent 7420e70f4f
commit f684ff18a2
1 changed files with 9 additions and 5 deletions

View 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: