From d5f6f8898e8ef887eafe0e593118f08ec0e75353 Mon Sep 17 00:00:00 2001 From: Adam Byrtek Date: Sat, 15 Aug 2009 00:00:19 +0200 Subject: [PATCH 7/8] More consistent naming of the new checkout parameter. --- lib/source_control/bazaar.rb | 8 ++++---- lib/source_control/git.rb | 8 ++++---- lib/source_control/mercurial.rb | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/source_control/bazaar.rb b/lib/source_control/bazaar.rb index edb9f8a..8dc1ad1 100644 --- a/lib/source_control/bazaar.rb +++ b/lib/source_control/bazaar.rb @@ -12,13 +12,13 @@ module SourceControl raise "don't know how to handle '#{options.keys.first}'" if options.length > 0 end - def checkout(revision = nil, stdout = $stdout, new_path = path) + def checkout(revision = nil, stdout = $stdout, checkout_path = path) raise 'Repository location is not specified' unless @repository - raise "#{new_path} is not empty, cannot branch a project into it" unless (Dir.entries(new_path) - ['.', '..']).empty? - FileUtils.rm_rf(new_path) + raise "#{checkout_path} is not empty, cannot branch a project into it" unless (Dir.entries(checkout_path) - ['.', '..']).empty? + FileUtils.rm_rf(checkout_path) - args = [@repository, new_path] + args = [@repository, checkout_path] args << ['-r', revision.number] if revision bzr('branch', args, :execute_in_project_directory => false) end diff --git a/lib/source_control/git.rb b/lib/source_control/git.rb index 5da1631..f7bbdf3 100644 --- a/lib/source_control/git.rb +++ b/lib/source_control/git.rb @@ -15,14 +15,14 @@ module SourceControl raise "don't know how to handle '#{options.keys.first}'" if options.length > 0 end - def checkout(revision = nil, stdout = $stdout, new_path = path) + def checkout(revision = nil, stdout = $stdout, checkout_path = path) raise 'Repository location is not specified' unless @repository - raise "#{new_path} is not empty, cannot clone a project into it" unless (Dir.entries(new_path) - ['.', '..']).empty? - FileUtils.rm_rf(new_path) + raise "#{checkout_path} is not empty, cannot clone a project into it" unless (Dir.entries(checkout_path) - ['.', '..']).empty? + FileUtils.rm_rf(checkout_path) # need to read from command output, because otherwise tests break - git('clone', [@repository, new_path], :execute_in_project_directory => false) + git('clone', [@repository, checkout_path], :execute_in_project_directory => false) if @branch git('branch', ['--track', @branch, "origin/#@branch"]) diff --git a/lib/source_control/mercurial.rb b/lib/source_control/mercurial.rb index dd83a05..d548b1d 100644 --- a/lib/source_control/mercurial.rb +++ b/lib/source_control/mercurial.rb @@ -13,14 +13,14 @@ module SourceControl raise "don't know how to handle '#{options.keys.first}'" if options.length > 0 end - def checkout(revision = nil, stdout = $stdout, new_path = path) + def checkout(revision = nil, stdout = $stdout, checkout_path = path) raise 'Repository location is not specified' unless @repository - raise "#{new_path} is not empty, cannot clone a project into it" unless (Dir.entries(new_path) - ['.', '..']).empty? - FileUtils.rm_rf(new_path) + raise "#{checkout_path} is not empty, cannot clone a project into it" unless (Dir.entries(checkout_path) - ['.', '..']).empty? + FileUtils.rm_rf(checkout_path) # need to read from command output, because otherwise tests break - hg('clone', [@repository, new_path], :execute_in_project_directory => false) do |io| + hg('clone', [@repository, checkout_path], :execute_in_project_directory => false) do |io| begin while line = io.gets stdout.puts line -- 1.6.3.3