Bug 11515

Summary: test 'commit' first in get_vcs_reference
Product: [Build System, Metadata & Runtime] Toaster Reporter: David Reyna <david.reyna>
Component: toasterAssignee: David Reyna <david.reyna>
Status: RESOLVED FIXED QA Contact: Libertad <libertad.gonzalez.de.la.cruz>
Severity: normal    
Priority: Medium CC: jessica.zhang, stanciux.mihail
Version: 2.3   
Target Milestone: 2.4 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

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