summaryrefslogtreecommitdiffstats
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)
downloadpoky-f310816acbc4c9491fdf4c8917829b07a9669ba0.tar.gz
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 f53be8b20b..08cb61fc28 100644
--- a/bitbake-dev/lib/bb/fetch/hg.py
+++ b/bitbake-dev/lib/bb/fetch/hg.py
@@ -57,6 +57,14 @@ class Hg(Fetch):
57 57
58 if 'rev' in ud.parm: 58 if 'rev' in ud.parm:
59 ud.revision = ud.parm['rev'] 59 ud.revision = ud.parm['rev']
60 else:
61 tag = Fetch.srcrev_internal_helper(ud, d)
62 if tag is True:
63 ud.revision = self.latest_revision(url, ud, d)
64 elif tag:
65 ud.revision = tag
66 else:
67 ud.revision = self.latest_revision(url, ud, d)
60 68
61 ud.localfile = data.expand('%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision), d) 69 ud.localfile = data.expand('%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision), d)
62 70
@@ -148,3 +156,23 @@ class Hg(Fetch):
148 except OSError: 156 except OSError:
149 pass 157 pass
150 raise t, v, tb 158 raise t, v, tb
159
160 def suppports_srcrev(self):
161 return True
162
163 def _latest_revision(self, url, ud, d):
164 """
165 Compute tip revision for the url
166 """
167 output = runfetchcmd(self._buildhgcommand(ud, d, "info"), d)
168 return output.strip()
169
170 def _build_revision(self, url, ud, d):
171 return ud.revision
172
173 def _revision_key(self, url, ud, d):
174 """
175 Return a unique key for the url
176 """
177 return "hg:" + ud.moddir
178
diff --git a/bitbake/lib/bb/fetch/hg.py b/bitbake/lib/bb/fetch/hg.py
index 2b0438a26d..b5fd8fecd7 100644
--- a/bitbake/lib/bb/fetch/hg.py
+++ b/bitbake/lib/bb/fetch/hg.py
@@ -158,16 +158,12 @@ class Hg(Fetch):
158 raise t, v, tb 158 raise t, v, tb
159 159
160 def suppports_srcrev(self): 160 def suppports_srcrev(self):
161 import bb
162 bb.error("here")
163 return True 161 return True
164 162
165 def _latest_revision(self, url, ud, d): 163 def _latest_revision(self, url, ud, d):
166 """ 164 """
167 Compute tip revision for the url 165 Compute tip revision for the url
168 """ 166 """
169 import bb
170 bb.error(self._buildhgcommand(ud, d, "info"))
171 output = runfetchcmd(self._buildhgcommand(ud, d, "info"), d) 167 output = runfetchcmd(self._buildhgcommand(ud, d, "info"), d)
172 return output.strip() 168 return output.strip()
173 169