Class: AccuHook::Accurev::Commit
- Inherits:
-
Object
- Object
- AccuHook::Accurev::Commit
- Defined in:
- lib/accuhook/commit.rb
Instance Method Summary collapse
- #commit!(commit_object, repository) ⇒ Object
-
#initialize(repository, commit_object) ⇒ Commit
constructor
A new instance of Commit.
Constructor Details
Instance Method Details
#commit!(commit_object, repository) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/accuhook/commit.rb', line 15 def commit!(commit_object, repository) commit_object.each do |commit| commit.show.each do |diff| case when diff.new_file # Accurev add, then keep @command.add("#{repository.working_dir}/#{diff.a_path}") @command.keep("#{repository.working_dir}/#{diff.a_path}", commit.) when diff.deleted_file # accurev defunct @command.defunct("#{repository.working_dir}/#{diff.a_path}", commit.) when diff.renamed_file # accurev defunct a_path, then add b_path (then keep) puts "Renamed file detected" @command.defunct("#{repository.working_dir}/#{diff.a_path}", commit.) @command.add("#{repository.working_dir}/#{diff.b_path}") @command.keep("#{repository.working_dir}/#{diff.b_path}", commit.) else # Accurev regular keep puts "Modified file detected" @command.keep("#{repository.working_dir}/#{diff.a_path}", commit.) end end end end |