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

Skip to content

Commit 170ad88

Browse files
committed
Add --fetch option
In rebase mode, specifying the --fetch option will cause a call to 'git svn fetch' to pull in new branches from the svn repository
1 parent a20d833 commit 170ad88

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

lib/svn2git/migration.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def initialize(args)
2222

2323
def run!
2424
if @options[:rebase]
25+
do_fetch if @options[:fetch]
2526
get_branches
2627
else
2728
clone!
@@ -43,6 +44,7 @@ def parse(args)
4344
options[:tags] = 'tags'
4445
options[:exclude] = []
4546
options[:revision] = nil
47+
options[:fetch] = nil
4648

4749
if File.exists?(File.expand_path(DEFAULT_AUTHORS_FILE))
4850
options[:authors] = DEFAULT_AUTHORS_FILE
@@ -110,6 +112,10 @@ def parse(args)
110112
options[:revision] = revision
111113
end
112114

115+
opts.on('--fetch', 'Before rebasing, do a git svn --fetch to pull in new branches (only valid when --rebase is specified)') do
116+
options[:fetch] = true
117+
end
118+
113119
opts.separator ""
114120

115121
# No argument, shows at tail. This will print an options summary.
@@ -178,6 +184,10 @@ def clone!
178184
get_branches
179185
end
180186

187+
def do_fetch
188+
run_command("git svn fetch")
189+
end
190+
181191
def get_branches
182192
# Get the list of local and remote svn branches, taking care to ignore console color codes and ignoring
183193
# the '*' character used to indicate the currently selected branch.

0 commit comments

Comments
 (0)