From 489d17596d2c532f2d8db3ef8c0f122ca49bb466 Mon Sep 17 00:00:00 2001 From: Peter Chubb Date: Thu, 3 Sep 2009 17:31:40 +0000 Subject: Allow mercurial fetcher to follow tip There are occasions when developing when I want a package always to grab the latest copy of a package. Witht eh CVS fetcher you can do this by setting the `date' tag to `now'. This patch adds similar functionality to the mercurial fetcher: if the revision to fetch is `tip' then always grab from the server, and don't use the cached tarball. Oh, and I fixed a typo in the Class comment. (Bitbake rev: 01b85608d8a37f8af66dfd80133e950120679079) Signed-off-by: Peter Chubb Signed-off-by: Chris Larson Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch/hg.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'bitbake/lib/bb') diff --git a/bitbake/lib/bb/fetch/hg.py b/bitbake/lib/bb/fetch/hg.py index f70611017..ca3a084bb 100644 --- a/bitbake/lib/bb/fetch/hg.py +++ b/bitbake/lib/bb/fetch/hg.py @@ -36,13 +36,20 @@ from bb.fetch import runfetchcmd from bb.fetch import logger class Hg(Fetch): - """Class to fetch a from mercurial repositories""" + """Class to fetch from mercurial repositories""" def supports(self, url, ud, d): """ Check to see if a given url can be fetched with mercurial. """ return ud.type in ['hg'] + def forcefetch(self, url, ud, d): + if 'rev' in ud.parm: + revTag = ud.parm['rev'] + else: + revTag = "tip" + return revTag == "tip" + def localpath(self, url, ud, d): if not "module" in ud.parm: raise MissingParameterError("hg method needs a 'module' parameter") -- cgit v1.2.3