]> git.e2factory.org Git - e2factory.git/commitdiff
source plugins: transition has_working_copy() from scm interface to source class
authorTobias Ulmer <tu@emlix.com>
Fri, 13 Jan 2017 16:25:01 +0000 (17:25 +0100)
committerTobias Ulmer <tu@emlix.com>
Fri, 13 Jan 2017 16:25:01 +0000 (17:25 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
plugins/cvs.lua
plugins/files.lua
plugins/git.lua
plugins/gitrepo.lua
plugins/svn.lua

index ab2651e32267fda3eb50773ac5c8fa45e7affeca..a23d1bf1619522184abc3cc39af8347c7a56aebd 100644 (file)
@@ -264,6 +264,10 @@ function cvs.cvs_source:display()
     return d
 end
 
+function cvs.cvs_source:has_working_copy()
+    return true
+end
+
 --- Build the cvsroot string.
 -- @param info Info table.
 -- @param sourcename Source name.
@@ -410,7 +414,7 @@ function cvs.working_copy_available(info, sourcename)
 end
 
 function cvs.has_working_copy(info, sourcename)
-    return true
+    return source.sources[sourcename]:has_working_copy()
 end
 
 function cvs.toresult(info, sourcename, sourceset, directory)
index 651dcd74e91ee80f87385631eea9d1263eaacf30..2dc029a6b28da566806645a79bd8d388d97b1d9c 100644 (file)
@@ -278,6 +278,10 @@ function files.files_source:display()
     return d
 end
 
+function files.files_source:has_working_copy()
+    return false
+end
+
 --- cache files for a source
 -- @param info the info structure
 -- @param sourcename name of the source
@@ -317,7 +321,7 @@ function files.working_copy_available(info, sourcename)
 end
 
 function files.has_working_copy(info, sourcename)
-    return false
+    return source.sources[sourcename]:has_working_copy()
 end
 
 --- Handle file:copy() in a way that appears intuitive to the user. Returns
index 949f80a72ccf9cff59c26d9fcdfbdf60d7b0317b..f168be194bc761b105595ca077fab9b1c9cc542d 100644 (file)
@@ -256,6 +256,10 @@ function git.git_source:display()
     return d
 end
 
+function git.git_source:has_working_copy()
+    return true
+end
+
 --- Return the git commit ID of the specified source configuration. Specific to
 -- sources of type git, useful for writing plugins.
 -- @param info Info table.
@@ -613,8 +617,8 @@ function git.working_copy_available(info, sourcename)
     return true
 end
 
-function git.has_working_copy(info, sname)
-    return true
+function git.has_working_copy(info, sourcename)
+    return source.sources[sourcename]:has_working_copy()
 end
 
 --- turn server:location into a git-style url
index 8334697269cf7b33de851edb68f8ab5c4e3c9d00..977d14e197ad9914376f24028aa3a82e85ea7482 100644 (file)
@@ -205,6 +205,10 @@ function gitrepo_source:display()
     return d
 end
 
+function gitrepo_source:has_working_copy()
+    return true
+end
+
 --------------------------------------------------------------------------------
 
 --- Check if a working copy for a git repository is available
@@ -229,7 +233,7 @@ end
 function gitrepo.has_working_copy(info, sourcename)
     assertIsTable(info)
     assertIsStringN(sourcename)
-    return true
+    return source.sources[sourcename]:has_working_copy()
 end
 
 --- Fetch a gitrepo source. Adapted from git plugin.
index eafe4696b8fc83218d0150a5a4fb81a1e814026a..fb10abcc8a2293b1007f180a41f27ee486999ad2 100644 (file)
@@ -350,6 +350,10 @@ function svn.svn_source:display()
     return d
 end
 
+function svn.svn_source:has_working_copy()
+    return true
+end
+
 function svn.fetch_source(info, sourcename)
     local rc, re
     local e = err.new("fetching source failed: %s", sourcename)
@@ -452,8 +456,8 @@ function svn.check_workingcopy(info, sourcename)
     return true
 end
 
-function svn.has_working_copy(info, sname)
-    return true
+function svn.has_working_copy(info, sourcename)
+    return source.sources[sourcename]:has_working_copy()
 end
 
 function svn.toresult(info, sourcename, sourceset, directory)