From f310816acbc4c9491fdf4c8917829b07a9669ba0 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 20 Oct 2009 11:29:07 +0100 Subject: bitbake: hg fetcher - sync bitbake-dev and remove debug Signed-off-by: Richard Purdie --- bitbake-dev/lib/bb/fetch/hg.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'bitbake-dev/lib/bb/fetch/hg.py') 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 + -- cgit v1.2.3 git/2012/05/openembedded-core.git/log/meta/classes/devshell.bbclass'>logtreecommitdiff
blob: 9327b55d0af914c5646b8dc54f98f938d33ab314 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22