Mercurial: display working directory files sizes unless browsing a specific revision (#999).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1333 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2008-04-06 12:22:59 +00:00
parent db7f890030
commit beff2c54bc
1 changed files with 5 additions and 0 deletions

View File

@ -34,6 +34,11 @@ class Repository::Mercurial < Repository
if entries if entries
entries.each do |entry| entries.each do |entry|
next unless entry.is_file? next unless entry.is_file?
# Set the filesize unless browsing a specific revision
if identifier.nil?
full_path = File.join(root_url, entry.path)
entry.size = File.stat(full_path).size if File.file?(full_path)
end
# Search the DB for the entry's last change # Search the DB for the entry's last change
change = changes.find(:first, :conditions => ["path = ?", scm.with_leading_slash(entry.path)], :order => "#{Changeset.table_name}.committed_on DESC") change = changes.find(:first, :conditions => ["path = ?", scm.with_leading_slash(entry.path)], :order => "#{Changeset.table_name}.committed_on DESC")
if change if change