Sfoglia il codice sorgente

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 <peter.chubb@nicta.com.au>
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Peter Chubb 15 anni fa
parent
commit
489d17596d
1 ha cambiato i file con 8 aggiunte e 1 eliminazioni
  1. 8 1
      bitbake/lib/bb/fetch/hg.py

+ 8 - 1
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")