summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2015-01-08 13:15:13 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-01-08 22:34:37 +0000
commit66e1b520d77f9c7512b7f1cf920cf9bea8d3ce3e (patch)
tree80189d7b1e1a40a7d7b5a6c9add39b2a7afcf820
parent3e73af423fa55da10073add2503fb1ef361e1956 (diff)
downloadast2050-yocto-poky-66e1b520d77f9c7512b7f1cf920cf9bea8d3ce3e.zip
ast2050-yocto-poky-66e1b520d77f9c7512b7f1cf920cf9bea8d3ce3e.tar.gz
bitbake: toaster: branch name priority resolution
Adding a Layer_Version function that gets back the branch name that should be used/displayed for finding the targeted git branch name. Change the commit id to use the branch name instead of the last-updated commit hash from the layer source. [YOCTO #7031] (Bitbake rev: 1a52202f7f3719f5421289aaf0fc8eba0bf4c7ce) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/toaster/orm/models.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 6fbbeed..5eff955 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -740,7 +740,7 @@ class LayerIndexLayerSource(LayerSource):
lv.up_date = lbi['updated']
lv.up_branch = Branch.objects.get(layer_source = self, up_id = lbi['branch'])
lv.branch = lbi['actual_branch']
- lv.commit = lbi['vcs_last_rev']
+ lv.commit = lbi['actual_branch']
lv.dirpath = lbi['vcs_subdir']
lv.save()
@@ -960,6 +960,12 @@ class Layer_Version(models.Model):
key = lambda x: _get_ls_priority(x.layer_source),
reverse = True)
+ def get_vcs_reference(self):
+ if self.commit is not None and len(self.commit) > 0:
+ return self.commit
+ if self.branch is not None and len(self.branch) > 0:
+ return self.branch
+ return self.up_branch.name
def __unicode__(self):
return str(self.layer) + " (" + self.commit +")"
OpenPOWER on IntegriCloud