From f1ed0cb50fa7fdefcff51dc255c304a0d5cb31c3 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sat, 24 Feb 2018 21:09:59 -0500 Subject: [PATCH] checkout: specify checkout directory if URL ends with /trunk --- lib/svi.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/svi.rb b/lib/svi.rb index 5bd922b..bf8e80c 100644 --- a/lib/svi.rb +++ b/lib/svi.rb @@ -8,6 +8,10 @@ module Svi class << self def checkout(url) + checkout_directory = [] + if url =~ %r{/([^/]+)/trunk$} + checkout_directory << $1 + end last_checkout_message = "" checked_out_paths = [] clear_message = lambda do @@ -23,7 +27,7 @@ module Svi last_checkout_message = "" end end - SvnRunner.run_svn("checkout", [url], allow_interactive: true) do |line| + SvnRunner.run_svn("checkout", [url] + checkout_directory, allow_interactive: true) do |line| if line =~ /^A.{4}(.*)$/ path = $1 checked_out_paths << path