You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2020/07/19 12:07:16 UTC

[whimsy] branch master updated: ensure single-threaded SVN updates

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 6e47c40  ensure single-threaded SVN updates
6e47c40 is described below

commit 6e47c400e59bb3bdba9578723b18b16f39645c1b
Author: Sebb <se...@apache.org>
AuthorDate: Sun Jul 19 13:07:08 2020 +0100

    ensure single-threaded SVN updates
---
 Rakefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Rakefile b/Rakefile
index b6c397b..5688fd6 100644
--- a/Rakefile
+++ b/Rakefile
@@ -111,6 +111,7 @@ task :config do
   require 'whimsy/asf/config'
   require 'whimsy/asf/git'
   require 'whimsy/asf/svn'
+  require 'whimsy/lockfile'
 end
 
 namespace :svn do
@@ -171,6 +172,8 @@ namespace :svn do
           if Dir.exist? name
             isSymlink = File.symlink?(name) # we don't want to change such checkouts
             Dir.chdir(name) {
+             # ensure single-threaded SVN updates
+             LockFile.lockfile(Dir.pwd, nil, File::LOCK_EX) do # ignore the return parameter
               system('svn', 'cleanup')
               unless isSymlink # Don't change depth for symlinks
                 curdepth = ASF::SVN.getInfoAsHash('.')['Depth'] || 'infinity' # not available as separate item
@@ -219,8 +222,10 @@ namespace :svn do
               end
 
               puts outerr # show what happened last
-            }
+             end # lockfile
+            } # chdir
           else # directory does not exist
+            # Don't bother locking here -- it should be very rarely needed
             system('svn', 'checkout', "--depth=#{depth}", svnpath, name)
              if files
                system('svn', 'update', *files, {chdir: name})