# HG changeset patch # User Chris Cannam # Date 1433239111 -3600 # Node ID 322d7b57e5f0e59144a337a2b985ccf28daa0222 # Parent 22d57b0e0a77cdde11f2d41df2ee534bfc9e8147 Making this work through the api is too complicated for now; this will do OK diff -r 22d57b0e0a77 -r 322d7b57e5f0 extra/soundsoftware/create-repo-authormaps.rb --- a/extra/soundsoftware/create-repo-authormaps.rb Thu May 21 17:31:06 2015 +0100 +++ b/extra/soundsoftware/create-repo-authormaps.rb Tue Jun 02 10:58:31 2015 +0100 @@ -18,7 +18,7 @@ # This script does that, if given the two directory names as arguments # to the -s and -o options. In the above example: # -# create-repo-authormaps.rb -s /var/hg -o /var/repo-export/authormap +# script/rails runner create-repo-authormaps.rb -s /var/hg -o /var/repo-export/authormap # # Note that this script will overwrite any existing authormap # files. (That's why the output files are given an authormap_ prefix, @@ -56,17 +56,20 @@ end unless File.directory?($repos_base) - log("input directory '#{$repos_base}' doesn't exist", :exit => true) + puts "input directory '#{$repos_base}' doesn't exist" + exit 1 end unless File.directory?($out_base) - log("output directory '#{$out_base}' doesn't exist", :exit => true) + puts "output directory '#{$out_base}' doesn't exist" + exit 1 end projects = Project.find(:all) if projects.nil? - log('No projects found', :exit => true) + puts 'No projects found' + exit 1 end projects.each do |proj| @@ -78,7 +81,7 @@ repo_url = repo.url repo_url = repo_url.gsub(/^file:\/*/, "/"); if repo_url != File.join($repos_base, proj.identifier) - log('Project #{proj.identifier} has repo in unsupported location #{repo_url}, skipping') + puts 'Project #{proj.identifier} has repo in unsupported location #{repo_url}, skipping' next end