diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2009-10-19 17:46:09 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2009-10-19 17:46:09 +0100 |
commit | 717d71b8e9a5c516ba9b3cc4dadd4d3897ffa9bd (patch) | |
tree | c445cda31ea276beed67f91bd10f75efabbe7615 /bitbake/lib/bb | |
parent | 96fc6f45bcf4368e5992f5a78cecd403b0f42b96 (diff) | |
download | poky-717d71b8e9a5c516ba9b3cc4dadd4d3897ffa9bd.tar.gz |
bitbake: Add hg fetcher auto revisioning, patch from Carl Simonson <simonsonc@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/fetch/hg.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/bitbake/lib/bb/fetch/hg.py b/bitbake/lib/bb/fetch/hg.py index 7643e159ec..2b0438a26d 100644 --- a/bitbake/lib/bb/fetch/hg.py +++ b/bitbake/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,27 @@ 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 | import bb | ||
162 | bb.error("here") | ||
163 | return True | ||
164 | |||
165 | def _latest_revision(self, url, ud, d): | ||
166 | """ | ||
167 | Compute tip revision for the url | ||
168 | """ | ||
169 | import bb | ||
170 | bb.error(self._buildhgcommand(ud, d, "info")) | ||
171 | output = runfetchcmd(self._buildhgcommand(ud, d, "info"), d) | ||
172 | return output.strip() | ||
173 | |||
174 | def _build_revision(self, url, ud, d): | ||
175 | return ud.revision | ||
176 | |||
177 | def _revision_key(self, url, ud, d): | ||
178 | """ | ||
179 | Return a unique key for the url | ||
180 | """ | ||
181 | return "hg:" + ud.moddir | ||
182 | |||