Class: Perforce2Svn::Migrator
- Inherits:
-
Object
- Object
- Perforce2Svn::Migrator
- Includes:
- Choosy::Terminal, Logging
- Defined in:
- lib/perforce2svn/migrator.rb
Instance Method Summary collapse
-
#initialize(migrator_file, options) ⇒ Migrator
constructor
A new instance of Migrator.
- #run! ⇒ Object
Methods included from Logging
Constructor Details
#initialize(migrator_file, options) ⇒ Migrator
Returns a new instance of Migrator.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/perforce2svn/migrator.rb', line 15 def initialize(migrator_file, ) Logging.configure([:debug]) Environment.new.check! @migration_file = Mapping::MappingFile.new(migrator_file, ) @svnRepo = Perforce2Svn::Subversion::SvnRepo.new([:repository]) @commit_builder = Perforce::CommitBuilder.new(@migration_file.mappings) @version_range = [:changes] || VersionRange.new(1) @options = end |
Instance Method Details
#run! ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/perforce2svn/migrator.rb', line 26 def run! begin @commit_builder.commits_in(@version_range) do |commit| migrate_commit(commit) end unless @options[:skip_perforce] execute_commands unless @options[:skip_commands] rescue SystemExit raise rescue Interrupt @svnRepo.clean_transactions! die "Interrupted. Not continuing." rescue Exception => e puts e.backtrace log.error e die "Unable to complete migration." end end |