comparison lib/redmine/scm/adapters/bazaar_adapter.rb @ 119:8661b858af72

* Update to Redmine trunk rev 4705
author Chris Cannam
date Thu, 13 Jan 2011 14:12:06 +0000
parents 513646585e45
children 0579821a129a
comparison
equal deleted inserted replaced
39:150ceac17a8d 119:8661b858af72
72 entries.sort_by_name 72 entries.sort_by_name
73 end 73 end
74 74
75 def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={}) 75 def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={})
76 path ||= '' 76 path ||= ''
77 identifier_from = 'last:1' unless identifier_from and identifier_from.to_i > 0 77 identifier_from = (identifier_from and identifier_from.to_i > 0) ? identifier_from.to_i : 'last:1'
78 identifier_to = 1 unless identifier_to and identifier_to.to_i > 0 78 identifier_to = (identifier_to and identifier_to.to_i > 0) ? identifier_to.to_i : 1
79 revisions = Revisions.new 79 revisions = Revisions.new
80 cmd = "#{BZR_BIN} log -v --show-ids -r#{identifier_to.to_i}..#{identifier_from} #{target(path)}" 80 cmd = "#{BZR_BIN} log -v --show-ids -r#{identifier_to}..#{identifier_from} #{target(path)}"
81 shellout(cmd) do |io| 81 shellout(cmd) do |io|
82 revision = nil 82 revision = nil
83 parsing = nil 83 parsing = nil
84 io.each_line do |line| 84 io.each_line do |line|
85 if line =~ /^----/ 85 if line =~ /^----/
138 if identifier_to 138 if identifier_to
139 identifier_to = identifier_to.to_i 139 identifier_to = identifier_to.to_i
140 else 140 else
141 identifier_to = identifier_from.to_i - 1 141 identifier_to = identifier_from.to_i - 1
142 end 142 end
143 if identifier_from
144 identifier_from = identifier_from.to_i
145 end
143 cmd = "#{BZR_BIN} diff -r#{identifier_to}..#{identifier_from} #{target(path)}" 146 cmd = "#{BZR_BIN} diff -r#{identifier_to}..#{identifier_from} #{target(path)}"
144 diff = [] 147 diff = []
145 shellout(cmd) do |io| 148 shellout(cmd) do |io|
146 io.each_line do |line| 149 io.each_line do |line|
147 diff << line 150 diff << line