]> source.dussan.org Git - redmine.git/commitdiff
Mercurial: display working directory files sizes unless browsing a specific revision...
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 6 Apr 2008 12:22:59 +0000 (12:22 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 6 Apr 2008 12:22:59 +0000 (12:22 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1333 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/repository/mercurial.rb

index 27a8eaea956d25550bb4432e168ea75b1059c39a..b183c15a734583875e4fa6db971b459c0aa982fe 100644 (file)
@@ -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