]> code.ossystems Code Review - openembedded-core.git/commitdiff
Allow mercurial fetcher to follow tip
authorPeter Chubb <peter.chubb@nicta.com.au>
Thu, 3 Sep 2009 17:31:40 +0000 (17:31 +0000)
committerRichard Purdie <rpurdie@linux.intel.com>
Tue, 4 Jan 2011 14:46:38 +0000 (14:46 +0000)
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 <peter.chubb@nicta.com.au>
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
bitbake/lib/bb/fetch/hg.py

index f70611017b6a5e0d491ab72b29dd8cc4ab567435..ca3a084bb66e33e1e5529f534a2215f7cb232d5e 100644 (file)
@@ -36,13 +36,20 @@ from bb.fetch import runfetchcmd
 from bb.fetch import logger
 
 class Hg(Fetch):
-    """Class to fetch 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")