From 12c856124b6b968d55053f413a406b97b4423160 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Wed, 13 Apr 2011 11:54:06 +0000 Subject: [PATCH] scm: cvs: code clean up adapter. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5449 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/scm/adapters/cvs_adapter.rb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/redmine/scm/adapters/cvs_adapter.rb b/lib/redmine/scm/adapters/cvs_adapter.rb index e840f182..ee8e61d8 100644 --- a/lib/redmine/scm/adapters/cvs_adapter.rb +++ b/lib/redmine/scm/adapters/cvs_adapter.rb @@ -170,8 +170,8 @@ module Redmine revision = nil state = "entry_start" end - if state=="entry_start" - branch_map=Hash.new + if state == "entry_start" + branch_map = Hash.new if /^RCS file: #{Regexp.escape(root_url_path)}\/#{Regexp.escape(path_with_proj(path))}(.+),v$/ =~ line entry_path = normalize_cvs_path($1) entry_name = normalize_path(File.basename($1)) @@ -185,29 +185,29 @@ module Redmine state = "revision" end next - elsif state=="symbolic" + elsif state == "symbolic" if /^(.*):\s(.*)/ =~ (line.strip) - branch_map[$1]=$2 + branch_map[$1] = $2 else - state="tags" + state = "tags" next end - elsif state=="tags" + elsif state == "tags" if /^#{STARTLOG}/ =~ line commit_log = "" - state="revision" + state = "revision" elsif /^#{ENDLOG}/ =~ line - state="head" + state = "head" end next - elsif state=="revision" + elsif state == "revision" if /^#{ENDLOG}/ =~ line || /^#{STARTLOG}/ =~ line if revision revHelper = CvsRevisionHelper.new(revision) revBranch = "HEAD" branch_map.each() do |branch_name, branch_point| if revHelper.is_in_branch_with_symbol(branch_point) - revBranch=branch_name + revBranch = branch_name end end logger.debug("********** YIELD Revision #{revision}::#{revBranch}") @@ -222,8 +222,8 @@ module Redmine :name => entry_name, :kind => 'file', :action => file_state - }] - }) + }] + }) end commit_log = String.new revision = nil -- 2.11.0