diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-04-11 15:45:20 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-04-11 15:45:20 +0000 |
commit | e9a33eff147cba52eee854f52045e984c0acf45a (patch) | |
tree | f31ef65aaf842734d91d8f00f689e0f490870afb /lib | |
parent | 9df194ff165b108e49b739ffd194e28d923b6628 (diff) | |
download | redmine-e9a33eff147cba52eee854f52045e984c0acf45a.tar.gz redmine-e9a33eff147cba52eee854f52045e984c0acf45a.zip |
scm: cvs: use scm_cmd() in annotate of adapter.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5412 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine/scm/adapters/cvs_adapter.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/redmine/scm/adapters/cvs_adapter.rb b/lib/redmine/scm/adapters/cvs_adapter.rb index 58c7b6d9d..d156b3d31 100644 --- a/lib/redmine/scm/adapters/cvs_adapter.rb +++ b/lib/redmine/scm/adapters/cvs_adapter.rb @@ -308,12 +308,14 @@ module Redmine end def annotate(path, identifier=nil) - identifier = (identifier) ? identifier.to_i : "HEAD" + identifier = (identifier) ? identifier : "HEAD" logger.debug "<cvs> annotate path:'#{path}',identifier #{identifier}" path_with_project="#{url}#{with_leading_slash(path)}" - cmd = "#{self.class.sq_bin} -d #{shell_quote root_url} rannotate -r#{identifier} #{shell_quote path_with_project}" + cmd_args = %w|rannotate| + cmd_args << "-D" << "#{time_to_cvstime(identifier)}" if identifier + cmd_args << path_with_project blame = Annotate.new - shellout(cmd) do |io| + scm_cmd(*cmd_args) do |io| io.each_line do |line| next unless line =~ %r{^([\d\.]+)\s+\(([^\)]+)\s+[^\)]+\):\s(.*)$} blame.add_line( @@ -325,8 +327,9 @@ module Redmine )) end end - return nil if $? && $?.exitstatus != 0 blame + rescue ScmCommandAborted + Annotate.new end private |