Rakefiles: renamed `staging` repository to `origin` repository
authorJan Vrany <jan.vrany@fit.cvut.cz>
Wed, 24 Jul 2019 10:02:21 +0000
changeset 268 da6c28844912
parent 267 cd10def8fdc4
child 269 e6ccd5be9bcb
Rakefiles: renamed `staging` repository to `origin` repository This is a better name because it is not necesarily staging in terms of test pipeline. It's merely the repository from which the local copy has been cloned. Hence I think origin is a better name.
rakelib/rbspec.rb
rakelib/scm.rb
specs/repositories.rbspec
--- a/rakelib/rbspec.rb	Wed Jul 24 10:45:26 2019 +0100
+++ b/rakelib/rbspec.rb	Wed Jul 24 10:02:21 2019 +0000
@@ -495,8 +495,9 @@
     # instead
     property :upstream, :class => String
 
-    # defines staging repository
-    property :staging, :class => String
+    # defines the origin from which the reposutory is initially cloned.
+    # This is Mercurial's 'default' (or git's 'origin')
+    property :origin, :class => String
 
     property :separator, :default => '.'
 
--- a/rakelib/scm.rb	Wed Jul 24 10:45:26 2019 +0100
+++ b/rakelib/scm.rb	Wed Jul 24 10:02:21 2019 +0000
@@ -40,7 +40,7 @@
   end
 
   # Make sure CVS_RSH environment variable is properly set. Prefer MSYS2 ssh.exe
-  # over plink.exe. For details, see `hglib.rb`, method `sshconf()`  
+  # over plink.exe. For details, see `hglib.rb`, method `sshconf()`
   module_function
 
   def ensure_cvs_rsh_set
@@ -50,8 +50,8 @@
     ssh_in_path = which('ssh') ? true : false
     plink_in_path = which('plink') ? true : false
     if Gem.win_platform?
-      # If CVS_RSH is not set or is set to plink.exe, try to change to 
-      # MSYS2 ssh.exe as it gives better performance on (fast) LANs.      
+      # If CVS_RSH is not set or is set to plink.exe, try to change to
+      # MSYS2 ssh.exe as it gives better performance on (fast) LANs.
       if /^.*[pP]link(\.exe)?"?\s*(-ssh)?\s*(-2)?$/ =~ ssh_configured
         ssh_in_path ? (ssh = 'ssh') : (ssh = %q{"c:\msys64\usr\bin\ssh.exe"} if File.exist? %q{c:\msys64\usr\bin\ssh.exe})
 
@@ -134,12 +134,12 @@
     hg = HG::Repository.new(wc)
     begin
       paths = hg.paths
-      if repository.staging
-        unless paths.has_key? 'staging'
-          paths['staging'] = "#{repository.staging}/#{directory.gsub('/', separator)}"
+      if repository.origin
+        unless paths.has_key? 'origin'
+          paths['origin'] = "#{repository.origin}/#{directory.gsub('/', separator)}"
           hg.paths = paths
         end
-        hg.pull('staging')
+        hg.pull('origin')
       end
       if repository.upstream
         unless paths.has_key? 'upstream'
@@ -275,16 +275,16 @@
     if repository.upstream
       paths['upstream'] = "#{repository.upstream}/#{directory.gsub('/', separator)}"
     end
-    if repository.staging
-      paths['staging'] = "#{repository.staging}/#{directory.gsub('/', separator)}"
+    if repository.origin
+      paths['origin'] = "#{repository.origin}/#{directory.gsub('/', separator)}"
     end
-    paths['default'] = paths['staging'] || paths['upstream'] || paths['canonical']
+    paths['default'] = paths['origin'] || paths['upstream'] || paths['canonical']
 
     begin
       hg = HG::Repository.init(root / directory)
       # Configure path aliases.
       #
-      # Set the repository as non-publishing, This way when cloning from a staging
+      # Set the repository as non-publishing, This way when cloning from 'origin'
       # repo changes in draft phase would remain drafs. This is  essential to
       # employ evolve extension and being able to fix & evolve changes in clones
       # (on a CI server, for instance) and being able to push back without need to
@@ -297,7 +297,7 @@
           paths: paths
       )
 
-      hg.pull('staging') if repository.staging
+      hg.pull('origin') if repository.origin
       hg.pull('upstream') if repository.upstream
 
       begin
--- a/specs/repositories.rbspec	Wed Jul 24 10:45:26 2019 +0100
+++ b/specs/repositories.rbspec	Wed Jul 24 10:02:21 2019 +0000
@@ -26,7 +26,7 @@
     if (not cloned_from_bitbucket) and (not cloned_from_swing)
       upstream  "https://swing.fit.cvut.cz/hg"
     end
-    staging   origin_forest_url
+    origin   origin_forest_url
   end
 
   # Only core developer and/or Jenkins have access to