@@ -74,10 +74,10 module Redmine | |||
|
74 | 74 | |
|
75 | 75 | def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={}) |
|
76 | 76 | path ||= '' |
|
77 |
identifier_from = |
|
|
78 |
identifier_to = |
|
|
77 | identifier_from = (identifier_from and identifier_from.to_i > 0) ? identifier_from.to_i : 'last:1' | |
|
78 | identifier_to = (identifier_to and identifier_to.to_i > 0) ? identifier_to.to_i : 1 | |
|
79 | 79 | revisions = Revisions.new |
|
80 |
cmd = "#{BZR_BIN} log -v --show-ids -r#{identifier_to |
|
|
80 | cmd = "#{BZR_BIN} log -v --show-ids -r#{identifier_to}..#{identifier_from} #{target(path)}" | |
|
81 | 81 | shellout(cmd) do |io| |
|
82 | 82 | revision = nil |
|
83 | 83 | parsing = nil |
@@ -140,6 +140,9 module Redmine | |||
|
140 | 140 | else |
|
141 | 141 | identifier_to = identifier_from.to_i - 1 |
|
142 | 142 | end |
|
143 | if identifier_from | |
|
144 | identifier_from = identifier_from.to_i | |
|
145 | end | |
|
143 | 146 | cmd = "#{BZR_BIN} diff -r#{identifier_to}..#{identifier_from} #{target(path)}" |
|
144 | 147 | diff = [] |
|
145 | 148 | shellout(cmd) do |io| |
@@ -63,7 +63,7 module Redmine | |||
|
63 | 63 | logger.debug "<cvs> entries '#{path}' with identifier '#{identifier}'" |
|
64 | 64 | path_with_project="#{url}#{with_leading_slash(path)}" |
|
65 | 65 | entries = Entries.new |
|
66 | cmd = "#{CVS_BIN} -d #{root_url} rls -e" | |
|
66 | cmd = "#{CVS_BIN} -d #{shell_quote root_url} rls -e" | |
|
67 | 67 | cmd << " -D \"#{time_to_cvstime(identifier)}\"" if identifier |
|
68 | 68 | cmd << " #{shell_quote path_with_project}" |
|
69 | 69 | shellout(cmd) do |io| |
@@ -108,7 +108,7 module Redmine | |||
|
108 | 108 | logger.debug "<cvs> revisions path:'#{path}',identifier_from #{identifier_from}, identifier_to #{identifier_to}" |
|
109 | 109 | |
|
110 | 110 | path_with_project="#{url}#{with_leading_slash(path)}" |
|
111 | cmd = "#{CVS_BIN} -d #{root_url} rlog" | |
|
111 | cmd = "#{CVS_BIN} -d #{shell_quote root_url} rlog" | |
|
112 | 112 | cmd << " -d\">#{time_to_cvstime(identifier_from)}\"" if identifier_from |
|
113 | 113 | cmd << " #{shell_quote path_with_project}" |
|
114 | 114 | shellout(cmd) do |io| |
@@ -229,7 +229,7 module Redmine | |||
|
229 | 229 | def diff(path, identifier_from, identifier_to=nil) |
|
230 | 230 | logger.debug "<cvs> diff path:'#{path}',identifier_from #{identifier_from}, identifier_to #{identifier_to}" |
|
231 | 231 | path_with_project="#{url}#{with_leading_slash(path)}" |
|
232 | cmd = "#{CVS_BIN} -d #{root_url} rdiff -u -r#{identifier_to} -r#{identifier_from} #{shell_quote path_with_project}" | |
|
232 | cmd = "#{CVS_BIN} -d #{shell_quote root_url} rdiff -u -r#{identifier_to.to_i} -r#{identifier_from.to_i} #{shell_quote path_with_project}" | |
|
233 | 233 | diff = [] |
|
234 | 234 | shellout(cmd) do |io| |
|
235 | 235 | io.each_line do |line| |
@@ -244,7 +244,7 module Redmine | |||
|
244 | 244 | identifier = (identifier) ? identifier : "HEAD" |
|
245 | 245 | logger.debug "<cvs> cat path:'#{path}',identifier #{identifier}" |
|
246 | 246 | path_with_project="#{url}#{with_leading_slash(path)}" |
|
247 | cmd = "#{CVS_BIN} -d #{root_url} co" | |
|
247 | cmd = "#{CVS_BIN} -d #{shell_quote root_url} co" | |
|
248 | 248 | cmd << " -D \"#{time_to_cvstime(identifier)}\"" if identifier |
|
249 | 249 | cmd << " -p #{shell_quote path_with_project}" |
|
250 | 250 | cat = nil |
@@ -256,10 +256,10 module Redmine | |||
|
256 | 256 | end |
|
257 | 257 | |
|
258 | 258 | def annotate(path, identifier=nil) |
|
259 | identifier = (identifier) ? identifier : "HEAD" | |
|
259 | identifier = (identifier) ? identifier.to_i : "HEAD" | |
|
260 | 260 | logger.debug "<cvs> annotate path:'#{path}',identifier #{identifier}" |
|
261 | 261 | path_with_project="#{url}#{with_leading_slash(path)}" |
|
262 | cmd = "#{CVS_BIN} -d #{root_url} rannotate -r#{identifier} #{shell_quote path_with_project}" | |
|
262 | cmd = "#{CVS_BIN} -d #{shell_quote root_url} rannotate -r#{identifier} #{shell_quote path_with_project}" | |
|
263 | 263 | blame = Annotate.new |
|
264 | 264 | shellout(cmd) do |io| |
|
265 | 265 | io.each_line do |line| |
@@ -66,7 +66,7 module Redmine | |||
|
66 | 66 | path_prefix = (path.blank? ? '' : "#{path}/") |
|
67 | 67 | path = '.' if path.blank? |
|
68 | 68 | entries = Entries.new |
|
69 | cmd = "#{DARCS_BIN} annotate --repodir #{@url} --xml-output" | |
|
69 | cmd = "#{DARCS_BIN} annotate --repodir #{shell_quote @url} --xml-output" | |
|
70 | 70 | cmd << " --match #{shell_quote("hash #{identifier}")}" if identifier |
|
71 | 71 | cmd << " #{shell_quote path}" |
|
72 | 72 | shellout(cmd) do |io| |
@@ -90,7 +90,7 module Redmine | |||
|
90 | 90 | def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={}) |
|
91 | 91 | path = '.' if path.blank? |
|
92 | 92 | revisions = Revisions.new |
|
93 | cmd = "#{DARCS_BIN} changes --repodir #{@url} --xml-output" | |
|
93 | cmd = "#{DARCS_BIN} changes --repodir #{shell_quote @url} --xml-output" | |
|
94 | 94 | cmd << " --from-match #{shell_quote("hash #{identifier_from}")}" if identifier_from |
|
95 | 95 | cmd << " --last #{options[:limit].to_i}" if options[:limit] |
|
96 | 96 | shellout(cmd) do |io| |
@@ -116,7 +116,7 module Redmine | |||
|
116 | 116 | |
|
117 | 117 | def diff(path, identifier_from, identifier_to=nil) |
|
118 | 118 | path = '*' if path.blank? |
|
119 | cmd = "#{DARCS_BIN} diff --repodir #{@url}" | |
|
119 | cmd = "#{DARCS_BIN} diff --repodir #{shell_quote @url}" | |
|
120 | 120 | if identifier_to.nil? |
|
121 | 121 | cmd << " --match #{shell_quote("hash #{identifier_from}")}" |
|
122 | 122 | else |
@@ -135,7 +135,7 module Redmine | |||
|
135 | 135 | end |
|
136 | 136 | |
|
137 | 137 | def cat(path, identifier=nil) |
|
138 | cmd = "#{DARCS_BIN} show content --repodir #{@url}" | |
|
138 | cmd = "#{DARCS_BIN} show content --repodir #{shell_quote @url}" | |
|
139 | 139 | cmd << " --match #{shell_quote("hash #{identifier}")}" if identifier |
|
140 | 140 | cmd << " #{shell_quote path}" |
|
141 | 141 | cat = nil |
@@ -170,7 +170,7 module Redmine | |||
|
170 | 170 | |
|
171 | 171 | # Retrieve changed paths for a single patch |
|
172 | 172 | def get_paths_for_patch(hash) |
|
173 | cmd = "#{DARCS_BIN} annotate --repodir #{@url} --summary --xml-output" | |
|
173 | cmd = "#{DARCS_BIN} annotate --repodir #{shell_quote @url} --summary --xml-output" | |
|
174 | 174 | cmd << " --match #{shell_quote("hash #{hash}")} " |
|
175 | 175 | paths = [] |
|
176 | 176 | shellout(cmd) do |io| |
@@ -117,7 +117,7 module Redmine | |||
|
117 | 117 | cmd = "#{GIT_BIN} --git-dir #{target('')} log --no-color --raw --date=iso --pretty=fuller " |
|
118 | 118 | cmd << " --reverse " if options[:reverse] |
|
119 | 119 | cmd << " --all " if options[:all] |
|
120 | cmd << " -n #{options[:limit]} " if options[:limit] | |
|
120 | cmd << " -n #{options[:limit].to_i} " if options[:limit] | |
|
121 | 121 | cmd << "#{shell_quote(identifier_from + '..')}" if identifier_from |
|
122 | 122 | cmd << "#{shell_quote identifier_to}" if identifier_to |
|
123 | 123 | cmd << " --since=#{shell_quote(options[:since].strftime("%Y-%m-%d %H:%M:%S"))}" if options[:since] |
@@ -80,7 +80,7 module Redmine | |||
|
80 | 80 | path ||= '' |
|
81 | 81 | entries = Entries.new |
|
82 | 82 | cmd = "#{HG_BIN} -R #{target('')} --cwd #{target('')} locate" |
|
83 | cmd << " -r " + (identifier ? identifier.to_s : "tip") | |
|
83 | cmd << " -r " + shell_quote(identifier ? identifier.to_s : "tip") | |
|
84 | 84 | cmd << " " + shell_quote("path:#{path}") unless path.empty? |
|
85 | 85 | shellout(cmd) do |io| |
|
86 | 86 | io.each_line do |line| |
@@ -112,7 +112,7 module Redmine | |||
|
112 | 112 | cmd << " -r #{identifier_from.to_i}:" |
|
113 | 113 | end |
|
114 | 114 | cmd << " --limit #{options[:limit].to_i}" if options[:limit] |
|
115 | cmd << " #{path}" if path | |
|
115 | cmd << " #{shell_quote path}" if path | |
|
116 | 116 | shellout(cmd) do |io| |
|
117 | 117 | begin |
|
118 | 118 | # HG doesn't close the XML Document... |
@@ -157,6 +157,9 module Redmine | |||
|
157 | 157 | else |
|
158 | 158 | identifier_to = identifier_from.to_i - 1 |
|
159 | 159 | end |
|
160 | if identifier_from | |
|
161 | identifier_from = identifier_from.to_i | |
|
162 | end | |
|
160 | 163 | cmd = "#{HG_BIN} -R #{target('')} diff -r #{identifier_to} -r #{identifier_from} --nodates" |
|
161 | 164 | cmd << " -I #{target(path)}" unless path.empty? |
|
162 | 165 | diff = [] |
@@ -171,7 +174,7 module Redmine | |||
|
171 | 174 | |
|
172 | 175 | def cat(path, identifier=nil) |
|
173 | 176 | cmd = "#{HG_BIN} -R #{target('')} cat" |
|
174 | cmd << " -r " + (identifier ? identifier.to_s : "tip") | |
|
177 | cmd << " -r " + shell_quote(identifier ? identifier.to_s : "tip") | |
|
175 | 178 | cmd << " #{target(path)}" |
|
176 | 179 | cat = nil |
|
177 | 180 | shellout(cmd) do |io| |
@@ -186,7 +189,7 module Redmine | |||
|
186 | 189 | path ||= '' |
|
187 | 190 | cmd = "#{HG_BIN} -R #{target('')}" |
|
188 | 191 | cmd << " annotate -n -u" |
|
189 | cmd << " -r " + (identifier ? identifier.to_s : "tip") | |
|
192 | cmd << " -r " + shell_quote(identifier ? identifier.to_s : "tip") | |
|
190 | 193 | cmd << " -r #{identifier.to_i}" if identifier |
|
191 | 194 | cmd << " #{target(path)}" |
|
192 | 195 | blame = Annotate.new |
@@ -135,8 +135,8 module Redmine | |||
|
135 | 135 | |
|
136 | 136 | def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={}) |
|
137 | 137 | path ||= '' |
|
138 |
identifier_from = (identifier_from |
|
|
139 |
identifier_to = (identifier_to |
|
|
138 | identifier_from = (identifier_from && identifier_from.to_i > 0) ? identifier_from.to_i : "HEAD" | |
|
139 | identifier_to = (identifier_to && identifier_to.to_i > 0) ? identifier_to.to_i : 1 | |
|
140 | 140 | revisions = Revisions.new |
|
141 | 141 | cmd = "#{SVN_BIN} log --xml -r #{identifier_from}:#{identifier_to}" |
|
142 | 142 | cmd << credentials_string |
General Comments 0
You need to be logged in to leave comments.
Login now