All of lore.kernel.org
 help / color / mirror / Atom feed
* Allow mercurial fetcher to follow tip
@ 2009-09-04  3:31 Peter Chubb
  0 siblings, 0 replies; only message in thread
From: Peter Chubb @ 2009-09-04  3:31 UTC (permalink / raw)
  To: openembedded-devel


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.

Signed-off-by: Peter Chubb <peter.chubb@nicta.com.au>

--- bitbake/lib/bb/fetch/hg.py~	2009-08-18 11:12:41.000000000 +1000
+++ bitbake/lib/bb/fetch/hg.py	2009-09-04 13:19:37.000000000 +1000
@@ -34,13 +34,21 @@
 from bb.fetch import runfetchcmd
 
 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")
@@ -108,7 +116,7 @@
         """Fetch url"""
 
         # try to use the tarball stash
-        if Fetch.try_mirror(d, ud.localfile):
+        if not self.forcefetch(loc, ud, d) and Fetch.try_mirror(d, ud.localfile):
             bb.msg.debug(1, bb.msg.domain.Fetcher, "%s already exists or was mirrored, skipping hg checkout." % ud.localpath)
             return
 

--
Dr Peter Chubb        www.nicta.com.au      peter DOT chubb AT nicta.com.au
http://www.ertos.nicta.com.au           ERTOS within National ICT Australia
From Imagination to Impact                       Imagining the (ICT) Future



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-09-04  3:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-04  3:31 Allow mercurial fetcher to follow tip Peter Chubb

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.