diff options
author | Chris Larson <chris_larson@mentor.com> | 2011-04-04 09:36:10 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-05-06 15:49:17 +0100 |
commit | 7fc020aa15d918b215575576d91160afae7f4d70 (patch) | |
tree | ed9b029c8b2dfd355396de9183517e852333612b /bitbake/lib/bb/fetch/git.py | |
parent | fc801b907361cfdb7e329eefac7a0c991e86c736 (diff) | |
download | poky-7fc020aa15d918b215575576d91160afae7f4d70.tar.gz |
persist_data: raise KeyError on missing elements
(Bitbake rev: a4f62433845c29f98c6a9746d5d2847bf9506ea5)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch/git.py')
-rw-r--r-- | bitbake/lib/bb/fetch/git.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/bitbake/lib/bb/fetch/git.py b/bitbake/lib/bb/fetch/git.py index 6b565e3eb5..35908ca8d4 100644 --- a/bitbake/lib/bb/fetch/git.py +++ b/bitbake/lib/bb/fetch/git.py | |||
@@ -246,18 +246,20 @@ class Git(Fetch): | |||
246 | revs = persisted['BB_URI_HEADREVS'] | 246 | revs = persisted['BB_URI_HEADREVS'] |
247 | 247 | ||
248 | key = self.generate_revision_key(url, ud, d, branch=True) | 248 | key = self.generate_revision_key(url, ud, d, branch=True) |
249 | rev = revs[key] | 249 | |
250 | if rev is None: | 250 | try: |
251 | return revs[key] | ||
252 | except KeyError: | ||
251 | # Compatibility with old key format, no branch included | 253 | # Compatibility with old key format, no branch included |
252 | oldkey = self.generate_revision_key(url, ud, d, branch=False) | 254 | oldkey = self.generate_revision_key(url, ud, d, branch=False) |
253 | rev = revs[oldkey] | 255 | try: |
254 | if rev is not None: | 256 | rev = revs[oldkey] |
255 | del revs[oldkey] | 257 | except KeyError: |
256 | else: | ||
257 | rev = self._latest_revision(url, ud, d) | 258 | rev = self._latest_revision(url, ud, d) |
259 | else: | ||
260 | del revs[oldkey] | ||
258 | revs[key] = rev | 261 | revs[key] = rev |
259 | 262 | return rev | |
260 | return str(rev) | ||
261 | 263 | ||
262 | def sortable_revision(self, url, ud, d): | 264 | def sortable_revision(self, url, ud, d): |
263 | """ | 265 | """ |