Bug 11515 - test 'commit' first in get_vcs_reference
Summary: test 'commit' first in get_vcs_reference
Status: RESOLVED FIXED
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: 2.3
Hardware: x86 Multiple
: Medium normal
Target Milestone: 2.4 M2
Assignee: David Reyna
QA Contact: Libertad
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2017-05-17 03:54 UTC by David Reyna
Modified: 2017-08-07 19:27 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Reyna 2017-05-17 03:54:59 UTC
The 'commit' value should be tested and used first when resolving the ref for a layer, since that is an explicit override in each layer index 'layeritem' record.

If should take precedence over more-global 'branch' and 'release' values, instead of being last.

Proposed patch is:

     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
         if self.release is not None:
             return self.release.name
-        if self.commit is not None and len(self.commit) > 0:
-            return self.commit
         return 'N/A'
Comment 1 David Reyna 2017-08-07 19:27:32 UTC
commit b4b2e6d4dfa4bac7aec100bae4bca36e371e4ed9