nirvdrum / svn2git

Ruby tool for importing existing svn projects into git.
MIT License
2.11k stars 443 forks source link

getting syntax errors when running svn2git #37

Closed hotribao closed 12 years ago

hotribao commented 12 years ago

Environment: ubuntu 10.04. git version 1.7.0.4 git-svn installed ruby 1.8.7 svn2git 2.1.1

When running the following command

 /var/lib/gems/1.8/bin/svn2git http://host/svn/myrepo

I then get the following syntax errors. What did I miss in the installation?

/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require': /var/lib/gems/1.8/gems/svn2git-2.1.1/lib/svn2git/migration.rb:246: syntax error, unexpected $undefined, expecting ')' (SyntaxError) run_command("git checkout \"#{branch}"\") ^ /var/lib/gems/1.8/gems/svn2git-2.1.1/lib/svn2git/migration.rb:253: syntax error, unexpected tIDENTIFIER, expecting kEND run_command("git checkout svn/trunk") ^ /var/lib/gems/1.8/gems/svn2git-2.1.1/lib/svn2git/migration.rb:253: syntax error, unexpected tSTRING_BEG, expecting kDO or '{' or '(' run_command("git checkout svn/trunk") ^ /var/lib/gems/1.8/gems/svn2git-2.1.1/lib/svn2git/migration.rb:254: syntax error, unexpected tIDENTIFIER, expecting kEND run_command("git branch -D master") ^ /var/lib/gems/1.8/gems/svn2git-2.1.1/lib/svn2git/migration.rb:254: syntax error, unexpected tIDENTIFIER, expecting kDO or '{' or '(' run_command("git branch -D master") ^ /var/lib/gems/1.8/gems/svn2git-2.1.1/lib/svn2git/migration.rb:255: syntax error, unexpected tIDENTIFIER, expecting kEND run_command("git checkout -f -b master") ^ /var/lib/gems/1.8/gems/svn2git-2.1.1/lib/svn2git/migration.rb:255: syntax error, unexpected tUMINUS, expecting kDO or '{' or '(' run_command("git checkout -f -b master") ^ /var/lib/gems/1.8/gems/svn2git-2.1.1/lib/svn2git/migration.rb:257: syntax error, unexpected tIDENTIFIER, expecting kEND run_command("git checkout -f master") ^ /var/lib/gems/1.8/gems/svn2git-2.1.1/lib/svn2git/migration.rb:257: syntax error, unexpected tIDENTIFIER, expecting kDO or '{' or '(' run_command("git checkout -f master") ^ /var/lib/gems/1.8/gems/svn2git-2.1.1/lib/svn2git/migration.rb:262: syntax error, unexpected tIDENTIFIER, expecting kEND run_command("git gc") ^ /var/lib/gems/1.8/gems/svn2git-2.1.1/lib/svn2git/migration.rb:266: syntax error, unexpected tCONSTANT, expecting kEND log "Running command: #{cmd}" ^ /var/lib/gems/1.8/gems/svn2git-2.1.1/lib/svn2git/migration.rb:271: syntax error, unexpected kDO_BLOCK, expecting kEND IO.popen(cmd) do |stdout| ^ /var/lib/gems/1.8/gems/svn2git-2.1.1/lib/svn2git/migration.rb:272: syntax error, unexpected kDO_BLOCK, expecting kEND stdout.each do |line| ^ /var/lib/gems/1.8/gems/svn2git-2.1.1/lib/svn2git/migration.rb:273: syntax error, unexpected tIDENTIFIER, expecting kDO or '{' or '(' /var/lib/gems/1.8/gems/svn2git-2.1.1/lib/svn2git/migration.rb:309: syntax error, unexpected kEND, expecting $end from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:inrequire' from /var/lib/gems/1.8/gems/svn2git-2.1.1/lib/svn2git.rb:1 from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:inrequire' from /var/lib/gems/1.8/gems/svn2git-2.1.1/bin/svn2git:23 from /var/lib/gems/1.8/bin/svn2git:19:in `load' from /var/lib/gems/1.8/bin/svn2git:19

johnxx commented 12 years ago

I'm just starting to play with svn2git and haven't verified my migration yet, but if I change line 246 of svn2git-2.1.1/lib/svn2git/migration.rb from: run_command("git checkout \"#{branch}"\") to run_command("git checkout \"#{branch}\"")

I'm at least able to proceed. This looks like a very slick program except for the minor typo. :)

nirvdrum commented 12 years ago

Sorry, this was a massive oversight. I just pushed 2.1.2 with the fix.