From 4fcac9d2cbdafb51e3ee9ca3b3da64fd86103174 Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Tue, 26 Nov 2013 15:58:15 -0500 Subject: [PATCH] Remove artifact setting from manager dialog --- src/main/java/com/gitblit/utils/ActivityUtils.java | 26 +++++++++++++++----------- 1 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/gitblit/utils/ActivityUtils.java b/src/main/java/com/gitblit/utils/ActivityUtils.java index fa74350..ddd7e37 100644 --- a/src/main/java/com/gitblit/utils/ActivityUtils.java +++ b/src/main/java/com/gitblit/utils/ActivityUtils.java @@ -45,16 +45,16 @@ /** * Utility class for building activity information from repositories. - * + * * @author James Moger - * + * */ public class ActivityUtils { /** * Gets the recent activity from the repositories for the last daysBack days * on the specified branch. - * + * * @param models * the list of repositories to query * @param daysBack @@ -79,7 +79,7 @@ df.setTimeZone(timezone); Calendar cal = Calendar.getInstance(); cal.setTimeZone(timezone); - + // aggregate author exclusions Set<String> authorExclusions = new TreeSet<String>(); authorExclusions.addAll(GitBlit.getStrings(Keys.web.metricAuthorExclusions)); @@ -105,6 +105,10 @@ if (StringUtils.isEmpty(objectId)) { for (RefModel local : JGitUtils.getLocalBranches( repository, true, -1)) { + if (!local.getDate().after(thresholdDate)) { + // branch not recently updated + continue; + } branches.add(local.getName()); } } else { @@ -121,7 +125,7 @@ // trim commits to maximum count commits = commits.subList(0, model.maxActivityCommits); } - for (RepositoryCommit commit : commits) { + for (RepositoryCommit commit : commits) { Date date = commit.getCommitDate(); String dateStr = df.format(date); if (!activity.containsKey(dateStr)) { @@ -138,7 +142,7 @@ activity.get(dateStr).addCommit(commit); } } - + // close the repository repository.close(); } @@ -151,7 +155,7 @@ /** * Returns the Gravatar profile, if available, for the specified email * address. - * + * * @param emailaddress * @return a Gravatar Profile * @throws IOException @@ -163,7 +167,7 @@ /** * Creates a Gravatar thumbnail url from the specified email address. - * + * * @param email * address to query Gravatar * @param width @@ -179,10 +183,10 @@ "https://www.gravatar.com/avatar/{0}?s={1,number,0}&d=identicon", emailHash, width); return url; } - + /** * Creates a Gravatar thumbnail url from the specified email address. - * + * * @param email * address to query Gravatar * @param width @@ -202,7 +206,7 @@ /** * Returns the Gravatar profile, if available, for the specified hashcode. * address. - * + * * @param hash * the hash of the email address * @return a Gravatar Profile -- Gitblit v1.9.1