summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2009-10-20 11:29:07 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2009-10-20 11:29:07 +0100
commitf310816acbc4c9491fdf4c8917829b07a9669ba0 (patch)
treef484fd1f09520ea06b379110a8c7bcbaea54beaa
parentd4fe9e79cfba3d328468999f0b26acd43f24fd32 (diff)
downloadopenembedded-core-f310816acbc4c9491fdf4c8917829b07a9669ba0.tar.gz
openembedded-core-f310816acbc4c9491fdf4c8917829b07a9669ba0.tar.bz2
openembedded-core-f310816acbc4c9491fdf4c8917829b07a9669ba0.tar.xz
openembedded-core-f310816acbc4c9491fdf4c8917829b07a9669ba0.zip
bitbake: hg fetcher - sync bitbake-dev and remove debug
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
-rw-r--r--bitbake-dev/lib/bb/fetch/hg.py28
-rw-r--r--bitbake/lib/bb/fetch/hg.py4
2 files changed, 28 insertions, 4 deletions
diff --git a/bitbake-dev/lib/bb/fetch/hg.py b/bitbake-dev/lib/bb/fetch/hg.py
index f53be8b20..08cb61fc2 100644
--- a/bitbake-dev/lib/bb/fetch/hg.py
+++ b/bitbake-dev/lib/bb/fetch/hg.py
@@ -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
+
diff --git a/bitbake/lib/bb/fetch/hg.py b/bitbake/lib/bb/fetch/hg.py
index 2b0438a26..b5fd8fecd 100644
--- a/bitbake/lib/bb/fetch/hg.py
+++ b/bitbake/lib/bb/fetch/hg.py
@@ -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()