Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:nirvdrum/svn2git

  • Loading branch information...
commit 97e17ff78bb0c04b5f7a328fa4d28e0d03cc42e2 2 parents a59cb83 + a02c141
@nirvdrum nirvdrum authored
Showing with 13 additions and 3 deletions.
  1. +1 −1  README.markdown
  2. +12 −2 lib/svn2git/migration.rb
View
2  README.markdown
@@ -153,7 +153,7 @@ repository which name on its own line. This would allow you to easily
redirect the output of this command sequence to ~/.svn2git/authors and have
a very good starting point for your mapping.
- $ svn log | grep -E "r[0-9]+ \| [a-z]+ \|" | awk '{print $3}' | sort | uniq
+ $ svn log | grep -E "r[0-9]+ \| [a-z0-9]+ \|" | awk '{print $3}' | sort | uniq
Debugging
---------
View
14 lib/svn2git/migration.rb
@@ -36,6 +36,7 @@ def parse(args)
# Set up reasonable defaults for options.
options = {}
options[:verbose] = false
+ options[:metadata] = false
options[:rootistrunk] = false
options[:trunk] = 'trunk'
options[:branches] = 'branches'
@@ -88,6 +89,10 @@ def parse(args)
options[:tags] = nil
end
+ opts.on('-m', '--metadata', 'Include metadata in git logs (git-svn-id)') do
+ options[:metadata] = true
+ end
+
opts.on('--authors AUTHORS_FILE', "Path to file containing svn-to-git authors mapping (default: #{DEFAULT_AUTHORS_FILE})") do |authors|
options[:authors] = authors
end
@@ -120,18 +125,23 @@ def clone!
trunk = @options[:trunk]
branches = @options[:branches]
tags = @options[:tags]
+ metadata = @options[:metadata]
rootistrunk = @options[:rootistrunk]
authors = @options[:authors]
exclude = @options[:exclude]
if rootistrunk
# Non-standard repository layout. The repository root is effectively 'trunk.'
- run_command("git svn init --no-metadata --trunk=#{@url}")
+ cmd = "git svn init "
+ cmd += "--no-metadata " unless metadata
+ cmd += "--trunk=#{@url}"
+ run_command(cmd)
else
- cmd = "git svn init --no-metadata "
+ cmd = "git svn init "
# Add each component to the command that was passed as an argument.
+ cmd += "--no-metadata " unless metadata
cmd += "--trunk=#{trunk} " unless trunk.nil?
cmd += "--tags=#{tags} " unless tags.nil?
cmd += "--branches=#{branches} " unless branches.nil?
Please sign in to comment.
Something went wrong with that request. Please try again.