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

Skip to content

Commit cf63ff3

Browse files
committed
Add support for --revision option
Support the --revision REV argument, which allows the user to restrict the set of svn revisions pulled during the initial clone. This argument is passed directly to the 'git svn clone' command. This option is ignore if the --rebase option is specified.
1 parent a02c141 commit cf63ff3

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

lib/svn2git/migration.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def parse(args)
4242
options[:branches] = 'branches'
4343
options[:tags] = 'tags'
4444
options[:exclude] = []
45+
options[:revision] = nil
4546

4647
if File.exists?(File.expand_path(DEFAULT_AUTHORS_FILE))
4748
options[:authors] = DEFAULT_AUTHORS_FILE
@@ -105,6 +106,10 @@ def parse(args)
105106
options[:verbose] = true
106107
end
107108

109+
opts.on('--revision REV', 'Start fetch from specified revision') do |revision|
110+
options[:revision] = revision
111+
end
112+
108113
opts.separator ""
109114

110115
# No argument, shows at tail. This will print an options summary.
@@ -129,6 +134,7 @@ def clone!
129134
rootistrunk = @options[:rootistrunk]
130135
authors = @options[:authors]
131136
exclude = @options[:exclude]
137+
revision = @options[:revision]
132138

133139
if rootistrunk
134140
# Non-standard repository layout. The repository root is effectively 'trunk.'
@@ -154,6 +160,7 @@ def clone!
154160
run_command("git config svn.authorsfile #{authors}") unless authors.nil?
155161

156162
cmd = "git svn fetch"
163+
cmd += " --revision=#{revision}" unless revision.nil?
157164
unless exclude.empty?
158165
# Add exclude paths to the command line; some versions of git support
159166
# this for fetch only, later also for init.

0 commit comments

Comments
 (0)