diff options
Diffstat (limited to 'bitbake/lib/toaster/orm/models.py')
| -rw-r--r-- | bitbake/lib/toaster/orm/models.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 6fbbeed8f3..5eff955453 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py | |||
| @@ -740,7 +740,7 @@ class LayerIndexLayerSource(LayerSource): | |||
| 740 | lv.up_date = lbi['updated'] | 740 | lv.up_date = lbi['updated'] |
| 741 | lv.up_branch = Branch.objects.get(layer_source = self, up_id = lbi['branch']) | 741 | lv.up_branch = Branch.objects.get(layer_source = self, up_id = lbi['branch']) |
| 742 | lv.branch = lbi['actual_branch'] | 742 | lv.branch = lbi['actual_branch'] |
| 743 | lv.commit = lbi['vcs_last_rev'] | 743 | lv.commit = lbi['actual_branch'] |
| 744 | lv.dirpath = lbi['vcs_subdir'] | 744 | lv.dirpath = lbi['vcs_subdir'] |
| 745 | lv.save() | 745 | lv.save() |
| 746 | 746 | ||
| @@ -960,6 +960,12 @@ class Layer_Version(models.Model): | |||
| 960 | key = lambda x: _get_ls_priority(x.layer_source), | 960 | key = lambda x: _get_ls_priority(x.layer_source), |
| 961 | reverse = True) | 961 | reverse = True) |
| 962 | 962 | ||
| 963 | def get_vcs_reference(self): | ||
| 964 | if self.commit is not None and len(self.commit) > 0: | ||
| 965 | return self.commit | ||
| 966 | if self.branch is not None and len(self.branch) > 0: | ||
| 967 | return self.branch | ||
| 968 | return self.up_branch.name | ||
| 963 | 969 | ||
| 964 | def __unicode__(self): | 970 | def __unicode__(self): |
| 965 | return str(self.layer) + " (" + self.commit +")" | 971 | return str(self.layer) + " (" + self.commit +")" |
