]> git.e2factory.org Git - e2factory.git/commitdiff
source: make sourceset argument non-optional, add to display()
authorTobias Ulmer <tu@emlix.com>
Mon, 27 Feb 2017 12:44:30 +0000 (13:44 +0100)
committerTobias Ulmer <tu@emlix.com>
Mon, 27 Feb 2017 20:05:39 +0000 (21:05 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
local/e2-ls-project.lua
local/source.lua
plugins/files.lua

index be1fe62813b621f6ac475022cdcc73ef1f6e6527..7b33a0b57d0713d58cec58926dc779081732e71f 100644 (file)
@@ -249,7 +249,7 @@ local function e2_ls_project(arg)
             s2 = "|"
         end
         p2(s1, s2, sourcename)
-        local t, re = source.sources[sourcename]:display()
+        local t, re = source.sources[sourcename]:display(build_mode.source_set())
         if not t then
             error(re)
         end
index da9a7290b9459804b6b47cfb60eda0251ffa49d8..5aa7028f8b07f37114bfd8bab2102aded67a8203 100644 (file)
@@ -131,10 +131,11 @@ end
 
 --- Abstract display method. Every child class must overwrite this
 -- method with an implementation. Calling this method throws an error.
+-- @param sourceset Source set (ex: "tag", "branch", ...)
 -- @return Array of strings containing free form information about source.
-function source.basic_source:display()
-    error(err.new("called display() of source base class, type %s name %s",
-        self._type, self._name))
+function source.basic_source:display(sourceset)
+    error(err.new("called display(%s) of source base class, type %s name %s",
+        tostring(sourceset), self._type, self._name))
 end
 
 --- Check whether the working copy is available. Sources that don't have a
index b41e1022f7acd6e8c27cf58b4d092fd3f079f72a..ca83423c299da1152ffa1846ffd2368ca709b2e3 100644 (file)
@@ -388,10 +388,12 @@ end
 
 --- create a table of lines for display
 -- @return a table
-function files.files_source:display()
+function files.files_source:display(sourceset)
+    assertIsStringN(sourceset)
+
     local s, sid, d, licences
 
-    self:sourceid()
+    self:sourceid(sourceset)
 
     d = {}
     table.insert(d, string.format("type       = %s", self:get_type()))