Skip to content

Added --localtime to command line options #130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified bin/svn2git
100644 → 100755
Empty file.
8 changes: 8 additions & 0 deletions lib/svn2git/migration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down