]> code.ossystems Code Review - openembedded-core.git/commitdiff
bitbake: hg fetcher - sync bitbake-dev and remove debug
authorRichard Purdie <rpurdie@linux.intel.com>
Tue, 20 Oct 2009 10:29:07 +0000 (11:29 +0100)
committerRichard Purdie <rpurdie@linux.intel.com>
Tue, 20 Oct 2009 10:29:07 +0000 (11:29 +0100)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
bitbake-dev/lib/bb/fetch/hg.py
bitbake/lib/bb/fetch/hg.py

index f53be8b20bc69f0ce80ea12aebb3c972321513cb..08cb61fc286e28289bc6498a95d88e362c95e5b1 100644 (file)
@@ -57,6 +57,14 @@ class Hg(Fetch):
 
         if 'rev' in ud.parm:
             ud.revision = ud.parm['rev']
+        else:
+            tag = Fetch.srcrev_internal_helper(ud, d)
+            if tag is True:
+                ud.revision = self.latest_revision(url, ud, d)
+            elif tag:
+                ud.revision = tag
+            else:
+                ud.revision = self.latest_revision(url, ud, d)
 
         ud.localfile = data.expand('%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision), d)
 
@@ -148,3 +156,23 @@ class Hg(Fetch):
             except OSError:
                 pass
             raise t, v, tb
+
+    def suppports_srcrev(self):
+        return True
+
+    def _latest_revision(self, url, ud, d):
+        """
+        Compute tip revision for the url
+        """
+        output = runfetchcmd(self._buildhgcommand(ud, d, "info"), d)
+        return output.strip()
+
+    def _build_revision(self, url, ud, d):
+        return ud.revision
+
+    def _revision_key(self, url, ud, d):
+        """
+        Return a unique key for the url
+        """
+        return "hg:" + ud.moddir
+
index 2b0438a26d4f9381c48b8cde2065273153309d37..b5fd8fecd74194683fe0f8875bb3325046b2fd05 100644 (file)
@@ -158,16 +158,12 @@ class Hg(Fetch):
             raise t, v, tb
 
     def suppports_srcrev(self):
-        import bb
-        bb.error("here")
         return True
 
     def _latest_revision(self, url, ud, d):
         """
         Compute tip revision for the url
         """
-        import bb
-        bb.error(self._buildhgcommand(ud, d, "info"))
         output = runfetchcmd(self._buildhgcommand(ud, d, "info"), d)
         return output.strip()