Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 97e17ff

Browse files
committed
Merge branch 'master' of github.com:nirvdrum/svn2git
2 parents a59cb83 + a02c141 commit 97e17ff

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

README.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ repository which name on its own line. This would allow you to easily
153153
redirect the output of this command sequence to ~/.svn2git/authors and have
154154
a very good starting point for your mapping.
155155

156-
$ svn log | grep -E "r[0-9]+ \| [a-z]+ \|" | awk '{print $3}' | sort | uniq
156+
$ svn log | grep -E "r[0-9]+ \| [a-z0-9]+ \|" | awk '{print $3}' | sort | uniq
157157

158158
Debugging
159159
---------

lib/svn2git/migration.rb

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def parse(args)
3636
# Set up reasonable defaults for options.
3737
options = {}
3838
options[:verbose] = false
39+
options[:metadata] = false
3940
options[:rootistrunk] = false
4041
options[:trunk] = 'trunk'
4142
options[:branches] = 'branches'
@@ -88,6 +89,10 @@ def parse(args)
8889
options[:tags] = nil
8990
end
9091

92+
opts.on('-m', '--metadata', 'Include metadata in git logs (git-svn-id)') do
93+
options[:metadata] = true
94+
end
95+
9196
opts.on('--authors AUTHORS_FILE', "Path to file containing svn-to-git authors mapping (default: #{DEFAULT_AUTHORS_FILE})") do |authors|
9297
options[:authors] = authors
9398
end
@@ -120,18 +125,23 @@ def clone!
120125
trunk = @options[:trunk]
121126
branches = @options[:branches]
122127
tags = @options[:tags]
128+
metadata = @options[:metadata]
123129
rootistrunk = @options[:rootistrunk]
124130
authors = @options[:authors]
125131
exclude = @options[:exclude]
126132

127133
if rootistrunk
128134
# Non-standard repository layout. The repository root is effectively 'trunk.'
129-
run_command("git svn init --no-metadata --trunk=#{@url}")
135+
cmd = "git svn init "
136+
cmd += "--no-metadata " unless metadata
137+
cmd += "--trunk=#{@url}"
138+
run_command(cmd)
130139

131140
else
132-
cmd = "git svn init --no-metadata "
141+
cmd = "git svn init "
133142

134143
# Add each component to the command that was passed as an argument.
144+
cmd += "--no-metadata " unless metadata
135145
cmd += "--trunk=#{trunk} " unless trunk.nil?
136146
cmd += "--tags=#{tags} " unless tags.nil?
137147
cmd += "--branches=#{branches} " unless branches.nil?

0 commit comments

Comments
 (0)