Mercurial > hg > soundsoftware-site
comparison lib/redmine/scm/adapters/cvs_adapter.rb @ 210:0579821a129a
Update to Redmine trunk rev 4802
author | Chris Cannam |
---|---|
date | Tue, 08 Feb 2011 13:51:46 +0000 |
parents | 8661b858af72 |
children | 051f544170fe |
comparison
equal
deleted
inserted
replaced
128:07fa8a8b56a8 | 210:0579821a129a |
---|---|
21 module Scm | 21 module Scm |
22 module Adapters | 22 module Adapters |
23 class CvsAdapter < AbstractAdapter | 23 class CvsAdapter < AbstractAdapter |
24 | 24 |
25 # CVS executable name | 25 # CVS executable name |
26 CVS_BIN = "cvs" | 26 CVS_BIN = Redmine::Configuration['scm_cvs_command'] || "cvs" |
27 | 27 |
28 # Guidelines for the input: | 28 # Guidelines for the input: |
29 # url -> the project-path, relative to the cvsroot (eg. module name) | 29 # url -> the project-path, relative to the cvsroot (eg. module name) |
30 # root_url -> the good old, sometimes damned, CVSROOT | 30 # root_url -> the good old, sometimes damned, CVSROOT |
31 # login -> unnecessary | 31 # login -> unnecessary |
107 def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={}, &block) | 107 def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={}, &block) |
108 logger.debug "<cvs> revisions path:'#{path}',identifier_from #{identifier_from}, identifier_to #{identifier_to}" | 108 logger.debug "<cvs> revisions path:'#{path}',identifier_from #{identifier_from}, identifier_to #{identifier_to}" |
109 | 109 |
110 path_with_project="#{url}#{with_leading_slash(path)}" | 110 path_with_project="#{url}#{with_leading_slash(path)}" |
111 cmd = "#{CVS_BIN} -d #{shell_quote root_url} rlog" | 111 cmd = "#{CVS_BIN} -d #{shell_quote root_url} rlog" |
112 cmd << " -d\">#{time_to_cvstime(identifier_from)}\"" if identifier_from | 112 cmd << " -d\">#{time_to_cvstime_rlog(identifier_from)}\"" if identifier_from |
113 cmd << " #{shell_quote path_with_project}" | 113 cmd << " #{shell_quote path_with_project}" |
114 shellout(cmd) do |io| | 114 shellout(cmd) do |io| |
115 state="entry_start" | 115 state="entry_start" |
116 | 116 |
117 commit_log=String.new | 117 commit_log=String.new |
288 unless time.kind_of? Time | 288 unless time.kind_of? Time |
289 time = Time.parse(time) | 289 time = Time.parse(time) |
290 end | 290 end |
291 return time.strftime("%Y-%m-%d %H:%M:%S") | 291 return time.strftime("%Y-%m-%d %H:%M:%S") |
292 end | 292 end |
293 | |
294 def time_to_cvstime_rlog(time) | |
295 return nil if time.nil? | |
296 t1 = time.clone.localtime | |
297 return t1.strftime("%Y-%m-%d %H:%M:%S") | |
298 end | |
293 | 299 |
294 def normalize_cvs_path(path) | 300 def normalize_cvs_path(path) |
295 normalize_path(path.gsub(/Attic\//,'')) | 301 normalize_path(path.gsub(/Attic\//,'')) |
296 end | 302 end |
297 | 303 |