diff --git a/bin/svn2git b/bin/svn2git old mode 100644 new mode 100755 diff --git a/lib/svn2git/migration.rb b/lib/svn2git/migration.rb index 30c078c..46b0204 100644 --- a/lib/svn2git/migration.rb +++ b/lib/svn2git/migration.rb @@ -45,6 +45,7 @@ def parse(args) options[:exclude] = [] options[:revision] = nil options[:username] = nil + options[:localtime] = nil if File.exists?(File.expand_path(DEFAULT_AUTHORS_FILE)) options[:authors] = DEFAULT_AUTHORS_FILE @@ -117,6 +118,10 @@ def parse(args) options[:exclude] << regex end + opts.on('--localtime', 'Use localtime for git migration') do + options[:localtime] = true + end + opts.on('-v', '--verbose', 'Be verbose in logging -- useful for debugging issues') do options[:verbose] = true end @@ -148,12 +153,14 @@ def clone! exclude = @options[:exclude] revision = @options[:revision] username = @options[:username] + localtime = @options[:localtime] if rootistrunk # Non-standard repository layout. The repository root is effectively 'trunk.' cmd = "git svn init --prefix=svn/ " cmd += "--username=#{username} " unless username.nil? cmd += "--no-metadata " unless metadata + if nominimizeurl cmd += "--no-minimize-url " end @@ -181,6 +188,7 @@ def clone! run_command("git config --local svn.authorsfile #{authors}") unless authors.nil? cmd = "git svn fetch " + cmd += "--localtime" if localtime unless revision.nil? range = revision.split(":") range[1] = "HEAD" unless range[1]