From 99f359e07087d826fdb024e4d205c2cb645f1d2a Mon Sep 17 00:00:00 2001
From: saheba <mail@saheba.net>
Date: Mon, 25 Mar 2013 16:32:53 -0400
Subject: [PATCH] +feature: automatic tagging of each push with an incremental revision number per repository

---
 src/com/gitblit/GitBlit.java |   27 ++++++++++++++++++++-------
 1 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/src/com/gitblit/GitBlit.java b/src/com/gitblit/GitBlit.java
index f47e76c..3ac8d17 100644
--- a/src/com/gitblit/GitBlit.java
+++ b/src/com/gitblit/GitBlit.java
@@ -1668,6 +1668,7 @@
 			model.addOwners(ArrayUtils.fromString(getConfig(config, "owner", "")));
 			model.useTickets = getConfig(config, "useTickets", false);
 			model.useDocs = getConfig(config, "useDocs", false);
+			model.useIncrementalRevisionNumbers = getConfig(config, "useIncrementalRevisionNumbers", false);
 			model.allowForks = getConfig(config, "allowForks", true);
 			model.accessRestriction = AccessRestrictionType.fromName(getConfig(config,
 					"accessRestriction", settings.getString(Keys.git.defaultAccessRestriction, null)));
@@ -2186,6 +2187,7 @@
 		config.setString(Constants.CONFIG_GITBLIT, null, "owner", ArrayUtils.toString(repository.owners));
 		config.setBoolean(Constants.CONFIG_GITBLIT, null, "useTickets", repository.useTickets);
 		config.setBoolean(Constants.CONFIG_GITBLIT, null, "useDocs", repository.useDocs);
+		config.setBoolean(Constants.CONFIG_GITBLIT, null, "useIncrementalRevisionNumbers", repository.useIncrementalRevisionNumbers);
 		config.setBoolean(Constants.CONFIG_GITBLIT, null, "allowForks", repository.allowForks);
 		config.setString(Constants.CONFIG_GITBLIT, null, "accessRestriction", repository.accessRestriction.name());
 		config.setString(Constants.CONFIG_GITBLIT, null, "authorizationControl", repository.authorizationControl.name());
@@ -3096,13 +3098,7 @@
 		}
 		
 		// schedule lucene engine
-		boolean luceneIndexing = settings.getBoolean(Keys.web.allowLuceneIndexing, true);
-		logger.info("Lucene indexing is " + (luceneIndexing ? "" : "not") + " activated");
-		
-		if (luceneIndexing) {
-			scheduledExecutor.scheduleAtFixedRate(luceneExecutor, 1, 2,  TimeUnit.MINUTES);
-			logger.info("Lucene executor is scheduled to process indexed branches every 2 minutes.");      
-		}
+		enableLuceneIndexing();
 
 		
 		// schedule gc engine
@@ -3184,6 +3180,23 @@
 		}
 	}
 	
+	protected void enableLuceneIndexing() {
+		scheduledExecutor.scheduleAtFixedRate(luceneExecutor, 1, 2,  TimeUnit.MINUTES);
+		logger.info("Lucene executor is scheduled to process indexed branches every 2 minutes.");
+	}
+	
+	protected final Logger getLogger() {
+		return logger;
+	}
+	
+	protected final ScheduledExecutorService getScheduledExecutor() {
+		return scheduledExecutor;
+	}
+
+	protected final LuceneExecutor getLuceneExecutor() {
+		return luceneExecutor;
+	}
+	
 	private void logTimezone(String type, TimeZone zone) {
 		SimpleDateFormat df = new SimpleDateFormat("z Z");
 		df.setTimeZone(zone);

--
Gitblit v1.9.1