From 412d74e2952c5d6add6ec4dbd318a6d1c876b271 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 18 Jul 2016 13:57:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9C=80=E8=BF=91=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E8=8E=B7=E5=8F=96=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/repositories_helper.rb | 8 +++----- app/views/repositories/_dir_list_content.html.erb | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index 72bee4843..ef637d3ee 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -47,13 +47,11 @@ module RepositoriesHelper end # 获取文件目录的最新动态 - def get_trees_last_changes(project_id, rev, ent_name) - g = Gitlab.client + def get_trees_last_changes(project_id, rev, ent_name, g) begin tree_changes = g.rep_last_changes(project_id, :rev => rev, :path => ent_name) - tree_changes - rescue - logger.error("faile to get tress activities!") + rescue Exception => e + puts e end end diff --git a/app/views/repositories/_dir_list_content.html.erb b/app/views/repositories/_dir_list_content.html.erb index 7a378dcb2..068ae0a1b 100644 --- a/app/views/repositories/_dir_list_content.html.erb +++ b/app/views/repositories/_dir_list_content.html.erb @@ -4,7 +4,7 @@ <% sub_path = entry.path[0] == "/" ? entry.path.sub("/", "") : entry.path %> <% ent_path = Redmine::CodesetUtil.replace_invalid_utf8(sub_path) %> <% ent_name = Redmine::CodesetUtil.replace_invalid_utf8(entry.name) %> - <% latest_changes = get_trees_last_changes(@project.gpid, @rev, ent_path) %> + <% latest_changes = get_trees_last_changes(@project.gpid, @rev, ent_path, @g) %>