Mercurial > hg > soundsoftware-site
diff lib/redmine/scm/adapters/bazaar_adapter.rb @ 441:cbce1fd3b1b7 redmine-1.2
Update to Redmine 1.2-stable branch (Redmine SVN rev 6000)
author | Chris Cannam |
---|---|
date | Mon, 06 Jun 2011 14:24:13 +0100 |
parents | 051f544170fe |
children | cbb26bc654de |
line wrap: on
line diff
--- a/lib/redmine/scm/adapters/bazaar_adapter.rb Thu Mar 03 11:42:28 2011 +0000 +++ b/lib/redmine/scm/adapters/bazaar_adapter.rb Mon Jun 06 14:24:13 2011 +0100 @@ -1,16 +1,16 @@ -# redMine - project management software -# Copyright (C) 2006-2007 Jean-Philippe Lang +# Redmine - project management software +# Copyright (C) 2006-2011 Jean-Philippe Lang # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -78,12 +78,12 @@ # Returns an Entries collection # or nil if the given path doesn't exist in the repository - def entries(path=nil, identifier=nil) + def entries(path=nil, identifier=nil, options={}) path ||= '' entries = Entries.new cmd = "#{self.class.sq_bin} ls -v --show-ids" - identifier = -1 unless identifier && identifier.to_i > 0 - cmd << " -r#{identifier.to_i}" + identifier = -1 unless identifier && identifier.to_i > 0 + cmd << " -r#{identifier.to_i}" cmd << " #{target(path)}" shellout(cmd) do |io| prefix = "#{url}/#{path}".gsub('\\', '/') @@ -120,7 +120,6 @@ parsing = nil else next unless revision - if line =~ /^revno: (\d+)($|\s\[merge\]$)/ revision.identifier = $1.to_i elsif line =~ /^committer: (.+)$/ @@ -168,7 +167,7 @@ def diff(path, identifier_from, identifier_to=nil) path ||= '' if identifier_to - identifier_to = identifier_to.to_i + identifier_to = identifier_to.to_i else identifier_to = identifier_from.to_i - 1 end @@ -209,7 +208,13 @@ identifier = nil io.each_line do |line| next unless line =~ %r{^(\d+) ([^|]+)\| (.*)$} - blame.add_line($3.rstrip, Revision.new(:identifier => $1.to_i, :author => $2.strip)) + rev = $1 + blame.add_line($3.rstrip, + Revision.new( + :identifier => rev, + :revision => rev, + :author => $2.strip + )) end end return nil if $? && $?.exitstatus != 0