comparison lib/redmine/scm/adapters/bazaar_adapter.rb @ 1295:622f24f53b42 redmine-2.3

Update to Redmine SVN revision 11972 on 2.3-stable branch
author Chris Cannam
date Fri, 14 Jun 2013 09:02:21 +0100
parents 433d4f72a19b
children 4f746d8966dd e248c7af89ec
comparison
equal deleted inserted replaced
1294:3e4c3460b6ca 1295:622f24f53b42
1 # Redmine - project management software 1 # Redmine - project management software
2 # Copyright (C) 2006-2012 Jean-Philippe Lang 2 # Copyright (C) 2006-2013 Jean-Philippe Lang
3 # 3 #
4 # This program is free software; you can redistribute it and/or 4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License 5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2 6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version. 7 # of the License, or (at your option) any later version.
102 prefix = scm_iconv(@path_encoding, 'UTF-8', prefix_utf8) 102 prefix = scm_iconv(@path_encoding, 'UTF-8', prefix_utf8)
103 prefix.force_encoding('ASCII-8BIT') if prefix.respond_to?(:force_encoding) 103 prefix.force_encoding('ASCII-8BIT') if prefix.respond_to?(:force_encoding)
104 re = %r{^V\s+(#{Regexp.escape(prefix)})?(\/?)([^\/]+)(\/?)\s+(\S+)\r?$} 104 re = %r{^V\s+(#{Regexp.escape(prefix)})?(\/?)([^\/]+)(\/?)\s+(\S+)\r?$}
105 io.each_line do |line| 105 io.each_line do |line|
106 next unless line =~ re 106 next unless line =~ re
107 name_locale = $3.strip 107 name_locale, slash, revision = $3.strip, $4, $5.strip
108 name = scm_iconv('UTF-8', @path_encoding, name_locale) 108 name = scm_iconv('UTF-8', @path_encoding, name_locale)
109 entries << Entry.new({:name => name, 109 entries << Entry.new({:name => name,
110 :path => ((path.empty? ? "" : "#{path}/") + name), 110 :path => ((path.empty? ? "" : "#{path}/") + name),
111 :kind => ($4.blank? ? 'file' : 'dir'), 111 :kind => (slash.blank? ? 'file' : 'dir'),
112 :size => nil, 112 :size => nil,
113 :lastrev => Revision.new(:revision => $5.strip) 113 :lastrev => Revision.new(:revision => revision)
114 }) 114 })
115 end 115 end
116 end 116 end
117 if logger && logger.debug? 117 if logger && logger.debug?
118 logger.debug("Found #{entries.size} entries in the repository for #{target(path)}") 118 logger.debug("Found #{entries.size} entries in the repository for #{target(path)}")