checkout: accept wc_path optional argument
This commit is contained in:
parent
d96141f57d
commit
96010f2590
@ -12,10 +12,14 @@ module Svi
|
|||||||
svn_info(".")
|
svn_info(".")
|
||||||
end
|
end
|
||||||
|
|
||||||
def checkout(url)
|
def checkout(url, options = {})
|
||||||
checkout_directory = []
|
wc_path =
|
||||||
if url =~ %r{/([^/]+)/trunk$}
|
if options[:wc_path]
|
||||||
checkout_directory << $1
|
options[:wc_path]
|
||||||
|
elsif url =~ %r{/([^/]+)/trunk$}
|
||||||
|
$1
|
||||||
|
else
|
||||||
|
url.split("/").last
|
||||||
end
|
end
|
||||||
last_checkout_message = ""
|
last_checkout_message = ""
|
||||||
checked_out_paths = []
|
checked_out_paths = []
|
||||||
@ -33,7 +37,7 @@ module Svi
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
start_time = Time.new
|
start_time = Time.new
|
||||||
SvnRunner.run_svn("checkout", [url] + checkout_directory, allow_interactive: true) do |line|
|
SvnRunner.run_svn("checkout", [url, wc_path], allow_interactive: true) do |line|
|
||||||
if line =~ /^A.{4}(.*)$/
|
if line =~ /^A.{4}(.*)$/
|
||||||
path = $1
|
path = $1
|
||||||
checked_out_paths << path
|
checked_out_paths << path
|
||||||
|
@ -64,8 +64,8 @@ EOS
|
|||||||
$stderr.puts "Error: must specify URL"
|
$stderr.puts "Error: must specify URL"
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
url, = args
|
url, wc_path = args
|
||||||
@application.checkout(url)
|
@application.checkout(url, wc_path: wc_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
def cmd_status(params)
|
def cmd_status(params)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user