summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-04-06 12:22:59 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-04-06 12:22:59 +0000
commitbeff2c54bc325e8a8f838d90aa122be823423114 (patch)
tree4b85ffc093b8518834630b33acbf10c2540bba9d /app
parentdb7f890030b8138fc12d5debcdc66bf1b1e3861b (diff)
downloadredmine-beff2c54bc325e8a8f838d90aa122be823423114.tar.gz
redmine-beff2c54bc325e8a8f838d90aa122be823423114.zip
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
Diffstat (limited to 'app')
-rw-r--r--app/models/repository/mercurial.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/repository/mercurial.rb b/app/models/repository/mercurial.rb
index 27a8eaea9..b183c15a7 100644
--- a/app/models/repository/mercurial.rb
+++ b/app/models/repository/mercurial.rb
@@ -34,6 +34,11 @@ class Repository::Mercurial < Repository
if entries
entries.each do |entry|
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
change = changes.find(:first, :conditions => ["path = ?", scm.with_leading_slash(entry.path)], :order => "#{Changeset.table_name}.committed_on DESC")
if change