[bitbake-devel] [PATCH 4/5] toaster: branch name priority resolution

Alex DAMIAN alexandru.damian at intel.com
Thu Jan 8 13:15:13 UTC 2015


From: Alexandru DAMIAN <alexandru.damian at intel.com>

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]

Signed-off-by: Alexandru DAMIAN <alexandru.damian at intel.com>
---
 lib/toaster/orm/models.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/toaster/orm/models.py b/lib/toaster/orm/models.py
index 6fbbeed..5eff955 100644
--- a/lib/toaster/orm/models.py
+++ b/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 +")"
-- 
1.9.1




More information about the bitbake-devel mailing list