]> source.dussan.org Git - gitblit.git/commitdiff
Build infrastructure improvements. Setting to show remote branches.
authorJames Moger <james.moger@gitblit.com>
Wed, 4 May 2011 21:35:49 +0000 (17:35 -0400)
committerJames Moger <james.moger@gitblit.com>
Wed, 4 May 2011 21:35:49 +0000 (17:35 -0400)
The JGit team is now publishing 0.12.1 artifacts on the Eclipse Maven
site. Yeah! That was the last missing piece for a slick Git:Blit
deployment. The build has been reworked to download from Eclipse and
to also download source and javadoc jars for setting up a development
environment.

Made the log4j pattern configurable by operating system.
Moved Markdown utils to their own class since I need StringUtils for
Build and that introduced a chicken-and-egg scenario.

25 files changed:
.classpath
build.xml
gitblit.properties
makepassword.cmd [deleted file]
makerepository.cmd [deleted file]
src/com/gitblit/Build.java
src/com/gitblit/Constants.java
src/com/gitblit/FileSettings.java
src/com/gitblit/GitBlit.java
src/com/gitblit/GitBlitServer.java
src/com/gitblit/Launcher.java
src/com/gitblit/WebXmlSettings.java
src/com/gitblit/utils/JGitUtils.java
src/com/gitblit/utils/MarkdownUtils.java [new file with mode: 0644]
src/com/gitblit/utils/StringUtils.java
src/com/gitblit/wicket/GitBlitWebApp.properties
src/com/gitblit/wicket/models/RepositoryModel.java
src/com/gitblit/wicket/pages/BranchesPage.java
src/com/gitblit/wicket/pages/EditRepositoryPage.html
src/com/gitblit/wicket/pages/EditRepositoryPage.java
src/com/gitblit/wicket/pages/MarkdownPage.java
src/com/gitblit/wicket/pages/RepositoriesPage.java
src/com/gitblit/wicket/pages/SummaryPage.java
src/com/gitblit/wicket/panels/BranchesPanel.java
src/com/gitblit/wicket/resources/welcome.mkd

index e1c4e4ae133f26809f399d9bcc4d266f72068acb..26484c28063126cb6d1274ac93be64c96d4cb5be 100644 (file)
@@ -2,19 +2,72 @@
 <classpath>\r
        <classpathentry kind="src" path="src"/>\r
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="lib" path="ext/log4j-1.2.16.jar"/>\r
-       <classpathentry kind="lib" path="ext/servlet-api-2.5.jar"/>\r
-       <classpathentry kind="lib" path="ext/slf4j-api-1.6.1.jar"/>\r
-       <classpathentry kind="lib" path="ext/slf4j-log4j12-1.6.1.jar"/>\r
-       <classpathentry kind="lib" path="ext/jetty-all-7.2.2.v20101205.jar"/>\r
-       <classpathentry kind="lib" path="ext/jcommander-1.17.jar"/>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>\r
-       <classpathentry kind="lib" path="ext/wicket-1.4.17.jar"/>\r
-       <classpathentry kind="lib" path="ext/wicket-auth-roles-1.4.17.jar"/>\r
-       <classpathentry kind="lib" path="ext/wicket-extensions-1.4.17.jar"/>\r
-       <classpathentry kind="lib" path="ext/markdownpapers-core-1.0.0.jar"/>\r
-       <classpathentry kind="lib" path="ext/googlecharts-1.4.17.jar"/>\r
-       <classpathentry kind="lib" path="lib/jgit-0.12-stable.jar"/>\r
-       <classpathentry kind="lib" path="lib/jgit-http-0.12-stable.jar"/>\r
+       <classpathentry kind="lib" path="ext/log4j-1.2.16.jar" sourcepath="ext/log4j-1.2.16-sources.jar">\r
+               <attributes>\r
+                       <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/log4j-1.2.16-javadoc.jar!/"/>\r
+               </attributes>\r
+       </classpathentry>\r
+       <classpathentry kind="lib" path="ext/servlet-api-2.5.jar" sourcepath="ext/servlet-api-2.5-sources.jar"/>\r
+       <classpathentry kind="lib" path="ext/slf4j-api-1.6.1.jar" sourcepath="ext/slf4j-api-1.6.1-sources.jar">\r
+               <attributes>\r
+                       <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/slf4j-api-1.6.1-javadoc.jar!/"/>\r
+               </attributes>\r
+       </classpathentry>\r
+       <classpathentry kind="lib" path="ext/slf4j-log4j12-1.6.1.jar" sourcepath="ext/slf4j-log4j12-1.6.1-sources.jar">\r
+               <attributes>\r
+                       <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/slf4j-log4j12-1.6.1-javadoc.jar!/"/>\r
+               </attributes>\r
+       </classpathentry>\r
+       <classpathentry kind="lib" path="ext/jetty-all-7.2.2.v20101205.jar" sourcepath="ext/jetty-all-7.2.2.v20101205-sources.jar">\r
+               <attributes>\r
+                       <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/jetty-all-7.2.2.v20101205-javadoc.jar!/"/>\r
+               </attributes>\r
+       </classpathentry>\r
+       <classpathentry kind="lib" path="ext/jcommander-1.17.jar" sourcepath="ext/jcommander-1.17-sources.jar">\r
+               <attributes>\r
+                       <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/jcommander-1.17-javadoc.jar!/"/>\r
+               </attributes>\r
+       </classpathentry>\r
+       <classpathentry kind="lib" path="ext/wicket-1.4.17.jar" sourcepath="ext/wicket-1.4.17-sources.jar">\r
+               <attributes>\r
+                       <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/wicket-1.4.17-javadoc.jar!/"/>\r
+               </attributes>\r
+       </classpathentry>\r
+       <classpathentry kind="lib" path="ext/wicket-auth-roles-1.4.17.jar" sourcepath="ext/wicket-auth-roles-1.4.17-sources.jar">\r
+               <attributes>\r
+                       <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/wicket-auth-roles-1.4.17-javadoc.jar!/"/>\r
+               </attributes>\r
+       </classpathentry>\r
+       <classpathentry kind="lib" path="ext/wicket-extensions-1.4.17.jar" sourcepath="ext/wicket-extensions-1.4.17-sources.jar">\r
+               <attributes>\r
+                       <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/wicket-extensions-1.4.17-javadoc.jar!/"/>\r
+               </attributes>\r
+       </classpathentry>\r
+       <classpathentry kind="lib" path="ext/markdownpapers-core-1.0.0.jar" sourcepath="ext/markdownpapers-core-1.0.0-sources.jar">\r
+               <attributes>\r
+                       <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/markdownpapers-core-1.0.0-javadoc.jar!/"/>\r
+               </attributes>\r
+       </classpathentry>\r
+       <classpathentry kind="lib" path="ext/googlecharts-1.4.17.jar" sourcepath="ext/googlecharts-1.4.17-sources.jar">\r
+               <attributes>\r
+                       <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/googlecharts-1.4.17-javadoc.jar!/"/>\r
+               </attributes>\r
+       </classpathentry>\r
+       <classpathentry kind="lib" path="ext/junit-3.8.2.jar"/>\r
+       <classpathentry kind="lib" path="ext/org.eclipse.jgit-0.12.1.jar" sourcepath="ext/org.eclipse.jgit-0.12.1-sources.jar">\r
+               <attributes>\r
+                       <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/org.eclipse.jgit-0.12.1-javadoc.jar!/"/>\r
+               </attributes>\r
+       </classpathentry>\r
+       <classpathentry kind="lib" path="ext/org.eclipse.jgit.http.server-0.12.1.jar" sourcepath="ext/org.eclipse.jgit.http.server-0.12.1-sources.jar">\r
+               <attributes>\r
+                       <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/org.eclipse.jgit.http.server-0.12.1-javadoc.jar!/"/>\r
+               </attributes>\r
+       </classpathentry>\r
+       <classpathentry kind="lib" path="ext/bcprov-jdk16-1.46.jar" sourcepath="ext/bcprov-jdk16-1.46-sources.jar">\r
+               <attributes>\r
+                       <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/bcprov-jdk16-1.46-javadoc.jar!/"/>\r
+               </attributes>\r
+       </classpathentry>\r
        <classpathentry kind="output" path="bin"/>\r
 </classpath>\r
index 08de19b2344b97ab8daac8dbeded19189f9abd79..caaf34375f455e0bcdd9343659cf256d513d2659 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -23,9 +23,6 @@
 \r
                <!-- Compile Project -->\r
                <path id="master-classpath">\r
-                       <fileset dir="${basedir}/lib">\r
-                               <include name="*.jar" />\r
-                       </fileset>\r
                        <fileset dir="${basedir}/ext">\r
                                <include name="*.jar" />\r
                        </fileset>\r
 \r
                <!-- Build jar -->\r
                <delete file="${project.jar}" />\r
-               <jar index="true" jarfile="${project.jar}">\r
+               <jar jarfile="${project.jar}">\r
                        <fileset dir="${project.build.dir}">\r
                                <include name="**/*" />\r
                        </fileset>\r
                        <manifest>\r
                                <attribute name="Main-Class" value="${project.mainclass}" />\r
                        </manifest>\r
-                       <indexjars>\r
-                               <fileset dir="${basedir}/lib" />\r
-                       </indexjars>\r
                </jar>\r
 \r
                <!-- Delete the deploy folder -->\r
                <!-- Create deployment folder structure -->\r
                <mkdir dir="${basedir}/deploy" />\r
                <copy todir="${basedir}/deploy" file="${project.jar}" />\r
-               <copy todir="${basedir}/deploy/lib">\r
-                       <fileset dir="${basedir}/lib">\r
-                               <include name="**/*.jar" />\r
-                       </fileset>\r
-               </copy>\r
                <copy todir="${basedir}/deploy">\r
                        <fileset dir="${basedir}/service">\r
                                <include name="**/*" />\r
index 992549978b9b19655234a46e6f6f87d3f0eb4adf..67c3a095dc83a71612e6e797868d2a830cfbc936 100644 (file)
@@ -122,6 +122,9 @@ regex.global.changeid = \\b(Change-Id:\\s*)([A-Za-z0-9]*)\\b!!!<a href="http://s
 #\r
 server.tempFolder = temp\r
 server.log4jPattern = %-5p %d{MM-dd HH:mm:ss.SSS}  %-20.20c{1}  %m%n\r
+server.log4jPattern.windows = %-5p %m%n\r
+server.log4jPattern.linux =\r
+\r
 \r
 #\r
 # Jetty Settings\r
diff --git a/makepassword.cmd b/makepassword.cmd
deleted file mode 100644 (file)
index 0257e87..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-@if [%1]==[] goto missingparameters\r
-@if [%2]==[] goto missingparameters\r
-\r
-@java -cp "%CD%\ext\*" org.eclipse.jetty.http.security.Password %1 %2\r
-@goto end\r
-\r
-:missingparameters\r
-@echo Usage:\r
-@echo    makepassword username password\r
-@echo.\r
-\r
-:end
\ No newline at end of file
diff --git a/makerepository.cmd b/makerepository.cmd
deleted file mode 100644 (file)
index 660e2d7..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-@if [%1]==[] goto missingparameters\r
-\r
-@java -cp gitblit.jar;"%CD%\lib\*" com.gitblit.MakeRepository --create %1\r
-@goto end\r
-\r
-:missingparameters\r
-@echo Usage:\r
-@echo    makerepository path_to_repository\r
-@echo.\r
-\r
-:end
\ No newline at end of file
index 604ee08fd55996245ee8187975235aae905e2f7f..8b7fe3c1cc0d5167c180db6a0a35ac83f9423572 100644 (file)
@@ -20,6 +20,10 @@ import com.gitblit.utils.StringUtils;
 \r
 public class Build {\r
 \r
+       public static enum BuildType {\r
+               RUNTIME, COMPILETIME;\r
+       }\r
+\r
        public static void main(String... args) {\r
                runtime();\r
                compiletime();\r
@@ -27,21 +31,40 @@ public class Build {
        }\r
 \r
        public static void runtime() {\r
-               downloadFromMaven(MavenObject.JCOMMANDER);\r
-               downloadFromMaven(MavenObject.JETTY);\r
-               downloadFromMaven(MavenObject.SERVLET);\r
-               downloadFromMaven(MavenObject.SLF4JAPI);\r
-               downloadFromMaven(MavenObject.SLF4LOG4J);\r
-               downloadFromMaven(MavenObject.LOG4J);\r
-               downloadFromMaven(MavenObject.WICKET);\r
-               downloadFromMaven(MavenObject.WICKET_EXT);\r
-               downloadFromMaven(MavenObject.WICKET_AUTH_ROLES);\r
-               downloadFromMaven(MavenObject.WICKET_GOOGLE_CHARTS);\r
-               downloadFromMaven(MavenObject.MARKDOWNPAPERS);\r
+               downloadFromApache(MavenObject.JCOMMANDER, BuildType.RUNTIME);\r
+               downloadFromApache(MavenObject.JETTY, BuildType.RUNTIME);\r
+               downloadFromApache(MavenObject.SERVLET, BuildType.RUNTIME);\r
+               downloadFromApache(MavenObject.SLF4JAPI, BuildType.RUNTIME);\r
+               downloadFromApache(MavenObject.SLF4LOG4J, BuildType.RUNTIME);\r
+               downloadFromApache(MavenObject.LOG4J, BuildType.RUNTIME);\r
+               downloadFromApache(MavenObject.WICKET, BuildType.RUNTIME);\r
+               downloadFromApache(MavenObject.WICKET_EXT, BuildType.RUNTIME);\r
+               downloadFromApache(MavenObject.WICKET_AUTH_ROLES, BuildType.RUNTIME);\r
+               downloadFromApache(MavenObject.WICKET_GOOGLE_CHARTS, BuildType.RUNTIME);\r
+               downloadFromApache(MavenObject.MARKDOWNPAPERS, BuildType.RUNTIME);\r
+               downloadFromApache(MavenObject.BOUNCYCASTLE, BuildType.RUNTIME);\r
+\r
+               downloadFromEclipse(MavenObject.JGIT, BuildType.RUNTIME);\r
+               downloadFromEclipse(MavenObject.JGIT_HTTP, BuildType.RUNTIME);\r
        }\r
 \r
        public static void compiletime() {\r
-               downloadFromMaven(MavenObject.JUNIT);\r
+               downloadFromApache(MavenObject.JUNIT, BuildType.RUNTIME);\r
+               downloadFromApache(MavenObject.JCOMMANDER, BuildType.COMPILETIME);\r
+               downloadFromApache(MavenObject.JETTY, BuildType.COMPILETIME);\r
+               downloadFromApache(MavenObject.SERVLET, BuildType.COMPILETIME);\r
+               downloadFromApache(MavenObject.SLF4JAPI, BuildType.COMPILETIME);\r
+               downloadFromApache(MavenObject.SLF4LOG4J, BuildType.COMPILETIME);\r
+               downloadFromApache(MavenObject.LOG4J, BuildType.COMPILETIME);\r
+               downloadFromApache(MavenObject.WICKET, BuildType.COMPILETIME);\r
+               downloadFromApache(MavenObject.WICKET_EXT, BuildType.COMPILETIME);\r
+               downloadFromApache(MavenObject.WICKET_AUTH_ROLES, BuildType.COMPILETIME);\r
+               downloadFromApache(MavenObject.WICKET_GOOGLE_CHARTS, BuildType.COMPILETIME);\r
+               downloadFromApache(MavenObject.MARKDOWNPAPERS, BuildType.COMPILETIME);\r
+               downloadFromApache(MavenObject.BOUNCYCASTLE, BuildType.COMPILETIME);\r
+               \r
+               downloadFromEclipse(MavenObject.JGIT, BuildType.COMPILETIME);\r
+               downloadFromEclipse(MavenObject.JGIT_HTTP, BuildType.COMPILETIME);\r
        }\r
 \r
        public static void buildSettingKeys() {\r
@@ -114,6 +137,28 @@ public class Build {
                }\r
        }\r
 \r
+       /**\r
+        * Download a file from the official Apache Maven repository.\r
+        * \r
+        * @param mo\r
+        *            the maven object to download.\r
+        * @return\r
+        */\r
+       private static List<File> downloadFromApache(MavenObject mo, BuildType type) {\r
+               return downloadFromMaven("http://repo1.maven.org/maven2/", mo, type);\r
+       }\r
+\r
+       /**\r
+        * Download a file from the official Eclipse Maven repository.\r
+        * \r
+        * @param mo\r
+        *            the maven object to download.\r
+        * @return\r
+        */\r
+       private static List<File> downloadFromEclipse(MavenObject mo, BuildType type) {\r
+               return downloadFromMaven("http://download.eclipse.org/jgit/maven/", mo, type);\r
+       }\r
+\r
        /**\r
         * Download a file from a Maven repository.\r
         * \r
@@ -121,105 +166,186 @@ public class Build {
         *            the maven object to download.\r
         * @return\r
         */\r
-       private static File downloadFromMaven(MavenObject mo) {\r
-               File targetFile = mo.getLocalFile("ext");\r
-               if (targetFile.exists()) {\r
-                       return targetFile;\r
+       private static List<File> downloadFromMaven(String mavenRoot, MavenObject mo, BuildType type) {\r
+               List<File> downloads = new ArrayList<File>();\r
+               String[] jars = { "" };\r
+               if (BuildType.RUNTIME.equals(type)) {\r
+                       jars = new String[] { "" };\r
+               } else if (BuildType.COMPILETIME.equals(type)) {\r
+                       jars = new String[] { "-sources", "-javadoc" };\r
                }\r
-\r
-               String mavenURL = "http://repo1.maven.org/maven2/" + mo.getRepositoryPath();\r
-               if (!targetFile.getAbsoluteFile().getParentFile().exists()) {\r
-                       boolean success = targetFile.getAbsoluteFile().getParentFile().mkdirs();\r
-                       if (!success) {\r
-                               throw new RuntimeException("Failed to create destination folder structure!");\r
+               for (String jar : jars) {\r
+                       File targetFile = mo.getLocalFile("ext", jar);\r
+                       if (targetFile.exists()) {\r
+                               downloads.add(targetFile);\r
+                               continue;\r
                        }\r
-               }\r
-               ByteArrayOutputStream buff = new ByteArrayOutputStream();\r
-               try {\r
-                       System.out.println("Downloading " + mavenURL);\r
-                       URL url = new URL(mavenURL);\r
-                       InputStream in = new BufferedInputStream(url.openStream());\r
-                       long last = System.currentTimeMillis();\r
-                       int len = 0;\r
-                       while (true) {\r
-                               long now = System.currentTimeMillis();\r
-                               if (now > last + 200) {\r
-                                       System.out.println("  downloaded " + len + " bytes");\r
-                                       last = now;\r
+                       String expectedSHA1 = mo.getSHA1(jar);\r
+                       if (expectedSHA1 == null) {\r
+                               // skip this jar\r
+                               continue;\r
+                       }\r
+                       float approximateLength = mo.getApproximateLength(jar);\r
+                       String mavenURL = mavenRoot + mo.getRepositoryPath(jar);\r
+                       if (!targetFile.getAbsoluteFile().getParentFile().exists()) {\r
+                               boolean success = targetFile.getAbsoluteFile().getParentFile().mkdirs();\r
+                               if (!success) {\r
+                                       throw new RuntimeException("Failed to create destination folder structure!");\r
                                }\r
-                               int x = in.read();\r
-                               len++;\r
-                               if (x < 0) {\r
-                                       break;\r
+                       }\r
+                       ByteArrayOutputStream buff = new ByteArrayOutputStream();\r
+                       try {\r
+                               URL url = new URL(mavenURL);\r
+                               InputStream in = new BufferedInputStream(url.openStream());\r
+                               byte[] buffer = new byte[4096];\r
+                               int downloadedLen = 0;\r
+                               float lastProgress = 0f;\r
+                               \r
+                               updateDownload(0, targetFile);\r
+                               while (true) {\r
+                                       int len = in.read(buffer);\r
+                                       if (len < 0) {\r
+                                               break;\r
+                                       }\r
+                                       downloadedLen += len;\r
+                                       buff.write(buffer, 0, len);\r
+                                       float progress = downloadedLen / approximateLength;\r
+                                       if (progress - lastProgress >= 0.1f) {\r
+                                               lastProgress = progress;\r
+                                               updateDownload(progress, targetFile);\r
+                                       }\r
                                }\r
-                               buff.write(x);\r
+                               in.close();\r
+                               updateDownload(1f, targetFile);\r
+                               \r
+                       } catch (IOException e) {\r
+                               throw new RuntimeException("Error downloading " + mavenURL + " to " + targetFile, e);\r
                        }\r
-                       in.close();\r
-               } catch (IOException e) {\r
-                       throw new RuntimeException("Error downloading " + mavenURL + " to " + targetFile, e);\r
-               }\r
-               byte[] data = buff.toByteArray();\r
-               String got = StringUtils.getSHA1(data);\r
-               if (mo.sha1 != null && !got.equals(mo.sha1)) {\r
-                       throw new RuntimeException("SHA1 checksum mismatch; got: " + got);\r
+                       byte[] data = buff.toByteArray();\r
+                       String calculatedSHA1 = StringUtils.getSHA1(data);\r
+\r
+                       System.out.println();\r
+\r
+                       if (expectedSHA1.length() == 0) {\r
+                               updateProgress(0, "sha: " + calculatedSHA1);\r
+                               System.out.println();\r
+                       } else {\r
+                               if (!calculatedSHA1.equals(expectedSHA1)) {\r
+                                       throw new RuntimeException("SHA1 checksum mismatch; got: " + calculatedSHA1);\r
+                               }\r
+                       }\r
+                       try {\r
+                               RandomAccessFile ra = new RandomAccessFile(targetFile, "rw");\r
+                               ra.write(data);\r
+                               ra.setLength(data.length);\r
+                               ra.close();\r
+                       } catch (IOException e) {\r
+                               throw new RuntimeException("Error writing to file " + targetFile, e);\r
+                       }\r
+                       downloads.add(targetFile);\r
                }\r
-               try {\r
-                       RandomAccessFile ra = new RandomAccessFile(targetFile, "rw");\r
-                       ra.write(data);\r
-                       ra.setLength(data.length);\r
-                       ra.close();\r
-               } catch (IOException e) {\r
-                       throw new RuntimeException("Error writing to file " + targetFile, e);\r
+               return downloads;\r
+       }\r
+       \r
+       private static void updateDownload(float progress, File file) {\r
+               updateProgress(progress, "d/l: " + file.getName());\r
+       }\r
+\r
+       private static void updateProgress(float progress, String url) {\r
+               String anim = "==========";\r
+               int width = Math.round(anim.length() * progress);\r
+               System.out.print("\r[");\r
+               System.out.print(anim.substring(0, width));\r
+               for (int i = 0; (i < anim.length() - width); i++) {\r
+                       System.out.print(" ");\r
                }\r
-               return targetFile;\r
+               System.out.print("] " + url);\r
        }\r
 \r
        private static class MavenObject {\r
 \r
-               public static final MavenObject JCOMMANDER = new MavenObject("jCommander", "com/beust", "jcommander", "1.17", "219a3540f3b27d7cc3b1d91d6ea046cd8723290e");\r
+               public static final MavenObject JCOMMANDER = new MavenObject("jCommander", "com/beust", "jcommander", "1.17", 34000, 32000, 141000, "219a3540f3b27d7cc3b1d91d6ea046cd8723290e", "0bb50eec177acf0e94d58e0cf07262fe5164331d", "c7adc475ca40c288c93054e0f4fe58f3a98c0cb5");\r
+\r
+               public static final MavenObject JETTY = new MavenObject("Jetty", "org/eclipse/jetty/aggregate", "jetty-all", "7.2.2.v20101205", 1430000, 965000, 3871000, "b9b7c812a732721c427e208c54fbb71ca17a2ee1", "cbc4fc72c4a646d8822bf7369c2101d4d5d1ff98", "34c87e11bba426fe97bfe23ccff12eda477c8f57");\r
 \r
-               public static final MavenObject JETTY = new MavenObject("Jetty", "org/eclipse/jetty/aggregate", "jetty-all", "7.2.2.v20101205", "b9b7c812a732721c427e208c54fbb71ca17a2ee1");\r
+               public static final MavenObject SERVLET = new MavenObject("Servlet 2.5", "javax/servlet", "servlet-api", "2.5", 105000, 158000, 0, "5959582d97d8b61f4d154ca9e495aafd16726e34", "021599814ad9a605b86f3e6381571beccd861a32", null);\r
 \r
-               public static final MavenObject SERVLET = new MavenObject("Servlet 2.5", "javax/servlet", "servlet-api", "2.5", "5959582d97d8b61f4d154ca9e495aafd16726e34");\r
+               public static final MavenObject SLF4JAPI = new MavenObject("SLF4J API", "org/slf4j", "slf4j-api", "1.6.1", 25500, 45000, 182000, "6f3b8a24bf970f17289b234284c94f43eb42f0e4", "46a386136c901748e6a3af67ebde6c22bc6b4524", "e223571d77769cdafde59040da235842f3326453");\r
 \r
-               public static final MavenObject SLF4JAPI = new MavenObject("SLF4J API", "org/slf4j", "slf4j-api", "1.6.1", "6f3b8a24bf970f17289b234284c94f43eb42f0e4");\r
+               public static final MavenObject SLF4LOG4J = new MavenObject("SLF4J LOG4J", "org/slf4j", "slf4j-log4j12", "1.6.1", 9800, 9500, 52400, "bd245d6746cdd4e6203e976e21d597a46f115802", "7a26b08b265f55622fa1fed3bda68bbd37a465ba", "6e4b16bce7994e3692e82002f322a0dd2f32741e");\r
 \r
-               public static final MavenObject SLF4LOG4J = new MavenObject("SLF4J LOG4J", "org/slf4j", "slf4j-log4j12", "1.6.1", "bd245d6746cdd4e6203e976e21d597a46f115802");\r
+               public static final MavenObject LOG4J = new MavenObject("Apache LOG4J", "log4j", "log4j", "1.2.16", 481000, 471000, 1455000, "7999a63bfccbc7c247a9aea10d83d4272bd492c6", "bf945d1dc995be7fe64923625f842fbb6bf443be", "78aa1cbf0fa3b259abdc7d87f9f6788d785aac2a");\r
 \r
-               public static final MavenObject LOG4J = new MavenObject("Apache LOG4J", "log4j", "log4j", "1.2.16", "7999a63bfccbc7c247a9aea10d83d4272bd492c6");\r
+               public static final MavenObject WICKET = new MavenObject("Apache Wicket", "org/apache/wicket", "wicket", "1.4.17", 1960000, 1906000, 6818000, "39815e37a6f56465b2d2c3d3017c4f3bf17db50a", "a792ebae4123253ffd039c3be49e773f8622f94e", "f2f244ca72d10081529b017e89d6276eab62c621");\r
 \r
-               public static final MavenObject WICKET = new MavenObject("Apache Wicket", "org/apache/wicket", "wicket", "1.4.17", "39815e37a6f56465b2d2c3d3017c4f3bf17db50a");\r
+               public static final MavenObject WICKET_EXT = new MavenObject("Apache Wicket Extensions", "org/apache/wicket", "wicket-extensions", "1.4.17", 1180000, 1118000, 1458000, "01111d0dbffdc425581b006a43864c22797ce72a", "f194f40ea6e361bb745dfa22e2f9171eb63a9355", "bd42e5ba9444a426bb2d7cacce91c6033b663b57");\r
 \r
-               public static final MavenObject WICKET_EXT = new MavenObject("Apache Wicket Extensions", "org/apache/wicket", "wicket-extensions", "1.4.17", "01111d0dbffdc425581b006a43864c22797ce72a");\r
+               public static final MavenObject WICKET_AUTH_ROLES = new MavenObject("Apache Wicket Auth Roles", "org/apache/wicket", "wicket-auth-roles", "1.4.17", 44000, 45000, 166000, "86d20ff32f62d3026213ff11a78555da643bc676", "37e815350a2d6b97734b250a8a03d8bf3712bba7", "ac3896368bfb372d178041a4ac3ee2c44f62e21c");\r
 \r
-               public static final MavenObject WICKET_AUTH_ROLES = new MavenObject("Apache Wicket Auth Roles", "org/apache/wicket", "wicket-auth-roles", "1.4.17", "86d20ff32f62d3026213ff11a78555da643bc676");\r
+               public static final MavenObject WICKET_GOOGLE_CHARTS = new MavenObject("Apache Wicket Google Charts Add-On", "org/wicketstuff", "googlecharts", "1.4.17", 34000, 18750, 161000, "c567b98b0c5efe4147e77ef2d0d3c2d45c49dea5", "3d32d958b2f7aa58388af5701ea3aafc433e573f", "c37518b67ea85af485dd61fe854137eeacc50318");\r
 \r
-               public static final MavenObject WICKET_GOOGLE_CHARTS = new MavenObject("Apache Wicket Google Charts Add-On", "org/wicketstuff", "googlecharts", "1.4.17", "c567b98b0c5efe4147e77ef2d0d3c2d45c49dea5");\r
+               public static final MavenObject JUNIT = new MavenObject("JUnit", "junit", "junit", "3.8.2", 120000, 0, 0, "07e4cde26b53a9a0e3fe5b00d1dbbc7cc1d46060", "", "");\r
 \r
-               public static final MavenObject JUNIT = new MavenObject("JUnit", "junit", "junit", "3.8.2", "07e4cde26b53a9a0e3fe5b00d1dbbc7cc1d46060");\r
+               public static final MavenObject MARKDOWNPAPERS = new MavenObject("MarkdownPapers", "org/tautua/markdownpapers", "markdownpapers-core", "1.0.0", 87000, 58000, 278000, "feda63bd149f3315da210e397d45d02277038ad5", "a9a6c4d163af81e265a15138fcaeafa9829c6054", "f932656266a7f9593488d3f89e815d0af44d0853");\r
+               \r
+               public static final MavenObject BOUNCYCASTLE = new MavenObject("BouncyCastle", "org/bouncycastle", "bcprov-jdk16", "1.46", 1900000, 1400000, 4670000, "ce091790943599535cbb4de8ede84535b0c1260c", "d2b70567594225923450d7e3f80cd022c852725e", "873a6fe765f33fc27df498a5d1f5bf077e503b2f");\r
 \r
-               public static final MavenObject MARKDOWNPAPERS = new MavenObject("MarkdownPapers", "org/tautua/markdownpapers", "markdownpapers-core", "1.0.0", "feda63bd149f3315da210e397d45d02277038ad5");\r
+               public static final MavenObject JGIT = new MavenObject("JGit", "org/eclipse/jgit", "org.eclipse.jgit", "0.12.1", 1318000, 1354000, 2993000, "fd77699699b9651d2fc31c7ed63af98b14fc1975", "c8b3d84922c7802cfe6a661e13a002641a78583d", "5609aa3ce3ac3d52030befd27ddd2941f6c07570");\r
+\r
+               public static final MavenObject JGIT_HTTP = new MavenObject("JGit", "org/eclipse/jgit", "org.eclipse.jgit.http.server", "0.12.1", 68000, 62000, 99000, "384058ca906dffb8b8708c2db8849c9754359b28", "7b026658ed8de2eccc2d11d647d43d7c84a56911", "6c19e37b3caafd70c1b7b024ae1858c725181688");\r
 \r
                public final String name;\r
                public final String group;\r
                public final String artifact;\r
                public final String version;\r
-               public final String sha1;\r
+               public final int len_library;\r
+               public final int len_sources;\r
+               public final int len_javadoc;\r
+               public final String sha1_library;\r
+               public final String sha1_sources;\r
+               public final String sha1_javadoc;\r
 \r
-               private MavenObject(String name, String group, String artifact, String version, String sha1) {\r
+               private MavenObject(String name, String group, String artifact, String version, int len_library, int len_sources, int len_javadoc, String sha1_library, String sha1_sources, String sha1_javadoc) {\r
                        this.name = name;\r
                        this.group = group;\r
                        this.artifact = artifact;\r
                        this.version = version;\r
-                       this.sha1 = sha1;\r
+                       this.len_library = len_library;\r
+                       this.len_sources = len_sources;\r
+                       this.len_javadoc = len_javadoc;\r
+                       this.sha1_library = sha1_library;\r
+                       this.sha1_sources = sha1_sources;\r
+                       this.sha1_javadoc = sha1_javadoc;\r
+               }\r
+\r
+               private String getRepositoryPath(String jar) {\r
+                       return group + "/" + artifact + "/" + version + "/" + artifact + "-" + version + jar + ".jar";\r
                }\r
 \r
-               private String getRepositoryPath() {\r
-                       return group + "/" + artifact + "/" + version + "/" + artifact + "-" + version + ".jar";\r
+               private File getLocalFile(String basePath, String jar) {\r
+                       return new File(basePath, artifact + "-" + version + jar + ".jar");\r
                }\r
 \r
-               private File getLocalFile(String basePath) {\r
-                       return new File(basePath, artifact + "-" + version + ".jar");\r
+               private String getSHA1(String jar) {\r
+                       if (jar.equals("")) {\r
+                               return sha1_library;\r
+                       } else if (jar.equals("-sources")) {\r
+                               return sha1_sources;\r
+                       } else if (jar.equals("-javadoc")) {\r
+                               return sha1_javadoc;\r
+                       }\r
+                       return sha1_library;\r
+               }\r
+\r
+               private int getApproximateLength(String jar) {\r
+                       if (jar.equals("")) {\r
+                               return len_library;\r
+                       } else if (jar.equals("-sources")) {\r
+                               return len_sources;\r
+                       } else if (jar.equals("-javadoc")) {\r
+                               return len_javadoc;\r
+                       }\r
+                       return len_library;\r
                }\r
 \r
                @Override\r
index 4ad46636c25c1d0a4aab5a4d18e0403ac2bf426c..38f2e7db36f9cd4300e51fa9554d6d674da3b4dd 100644 (file)
@@ -19,7 +19,7 @@ public class Constants {
        }\r
 \r
        public static String getJGitVersion() {\r
-               return "JGit 0.12-stable";\r
+               return "JGit 0.12.1";\r
        }\r
 \r
        public static String getRunningVersion() {\r
index 371b7348b45e6f5c199ba4c777578c6f1cfcd57c..5cf54a7b97d4b7ee577970268bf533f4089bdce3 100644 (file)
@@ -138,6 +138,6 @@ public class FileSettings implements IStoredSettings {
        \r
        @Override\r
        public String toString() {\r
-               return getClass().getSimpleName() + ": " + new File(Constants.PROPERTIES_FILE).getAbsolutePath();\r
+               return new File(Constants.PROPERTIES_FILE).getAbsolutePath();\r
        }\r
 }\r
index 32ee73c48a8c38a8bf5a8805a9a164d96ea16114..c633f6e91a22bf9e8f2d65eb89b8198a99e95ee5 100644 (file)
@@ -137,6 +137,7 @@ public class GitBlit implements ServletContextListener {
                        model.useTickets = config.getBoolean("gitblit", "useTickets", false);\r
                        model.useDocs = config.getBoolean("gitblit", "useDocs", false);\r
                        model.useRestrictedAccess = config.getBoolean("gitblit", "restrictedAccess", false);\r
+                       model.showRemoteBranches = config.getBoolean("gitblit", "showRemoteBranches", false);\r
                }\r
                r.close();\r
                return model;\r
@@ -170,6 +171,7 @@ public class GitBlit implements ServletContextListener {
                config.setBoolean("gitblit", null, "useTickets", repository.useTickets);\r
                config.setBoolean("gitblit", null, "useDocs", repository.useDocs);\r
                config.setBoolean("gitblit", null, "restrictedAccess", repository.useRestrictedAccess);\r
+               config.setBoolean("gitblit", null, "showRemoteBranches", repository.showRemoteBranches);\r
                try {\r
                        config.save();\r
                } catch (IOException e) {\r
@@ -178,8 +180,8 @@ public class GitBlit implements ServletContextListener {
                r.close();\r
        }\r
 \r
-       public void setupContext(IStoredSettings settings) {\r
-               logger.info("Setting up GitBlit context from " + settings.toString());\r
+       public void configureContext(IStoredSettings settings) {\r
+               logger.info("Configure GitBlit from " + settings.toString());\r
                this.storedSettings = settings;\r
                repositoriesFolder = new File(settings.getString(Keys.git.repositoriesFolder, "repos"));\r
                exportAll = settings.getBoolean(Keys.git.exportAll, true);\r
@@ -188,12 +190,9 @@ public class GitBlit implements ServletContextListener {
 \r
        @Override\r
        public void contextInitialized(ServletContextEvent contextEvent) {\r
-               logger.info("GitBlit context initialization by servlet container...");\r
                if (storedSettings == null) {\r
                        WebXmlSettings webxmlSettings = new WebXmlSettings(contextEvent.getServletContext());\r
-                       setupContext(webxmlSettings);\r
-               } else {\r
-                       logger.info("GitBlit context already setup by " + storedSettings.toString());\r
+                       configureContext(webxmlSettings);\r
                }\r
        }\r
 \r
index a82b595f29b05387ca86e1bc324ebce05f0f3f33..9a9f63e20ff1c5273851e7470b613c91ad7e1135 100644 (file)
@@ -110,7 +110,23 @@ public class GitBlitServer {
         * Start Server.\r
         */\r
        private static void start(Params params) {\r
-               PatternLayout layout = new PatternLayout(fileSettings.getString(Keys.server.log4jPattern, "%-5p %d{MM-dd HH:mm:ss.SSS}  %-20.20c{1}  %m%n"));\r
+               String pattern = fileSettings.getString(Keys.server.log4jPattern, "%-5p %d{MM-dd HH:mm:ss.SSS}  %-20.20c{1}  %m%n");\r
+\r
+               // allow os override of logging pattern\r
+               String os = System.getProperty("os.name").toLowerCase();\r
+               if (os.indexOf("windows") > -1) {\r
+                       String winPattern = fileSettings.getString(Keys.server.log4jPattern_windows, pattern);\r
+                       if (!StringUtils.isEmpty(winPattern)) {\r
+                               pattern = winPattern;\r
+                       }\r
+               } else if (os.indexOf("linux") > -1) {\r
+                       String linuxPattern = fileSettings.getString(Keys.server.log4jPattern_linux, pattern);\r
+                       if (!StringUtils.isEmpty(linuxPattern)) {\r
+                               pattern = linuxPattern;\r
+                       }\r
+               }\r
+\r
+               PatternLayout layout = new PatternLayout(pattern);\r
                org.apache.log4j.Logger rootLogger = org.apache.log4j.Logger.getRootLogger();\r
                rootLogger.addAppender(new ConsoleAppender(layout));\r
 \r
@@ -244,7 +260,7 @@ public class GitBlitServer {
 \r
                // Setup the GitBlit context\r
                GitBlit gitblit = GitBlit.self();\r
-               gitblit.setupContext(fileSettings);\r
+               gitblit.configureContext(fileSettings);\r
                rootContext.addEventListener(gitblit);\r
 \r
                // Start the Server\r
index a55056d5b2d80414efd4732f59e524edf3e0c609..3173dc33f0ad0085278fee2d58d655e8a49fa8fd 100644 (file)
@@ -101,6 +101,10 @@ public class Launcher {
         * @throws IOException\r
         */\r
        public static void addJarFile(File f) throws IOException {\r
+               if (f.getName().indexOf("-sources") > -1 || f.getName().indexOf("-javadoc") > -1) {\r
+                       // don't add source or javadoc jars to runtime classpath\r
+                       return;\r
+               }\r
                URL u = f.toURI().toURL();\r
                if (debug)\r
                        System.out.println("load=" + u.toExternalForm());\r
index 00084bf6aa50205d2e83f71b92ef2d9e1dedbe83..03e2a922ebbcfefb1101479c08f44e8bc7c34b34 100644 (file)
@@ -60,6 +60,6 @@ public class WebXmlSettings implements IStoredSettings {
        \r
        @Override\r
        public String toString() {\r
-               return getClass().getSimpleName() + ": web.xml";\r
+               return "WEB.XML";\r
        }\r
 }\r
index 71fa20e19ce161c64a7c5153737bbdc60f7ec443..f86596d502cc7595cf775ab0d9d932fbfe2ea6c8 100644 (file)
@@ -63,12 +63,6 @@ import com.gitblit.wicket.models.TicketModel.Comment;
 \r
 public class JGitUtils {\r
 \r
-       /** Prefix for notes refs */\r
-       public static final String R_NOTES = "refs/notes/";\r
-\r
-       /** Standard notes ref */\r
-       public static final String R_NOTES_COMMITS = R_NOTES + "commits";\r
-\r
        private final static Logger LOGGER = LoggerFactory.getLogger(JGitUtils.class);\r
 \r
        public static Repository createRepository(File repositoriesFolder, String name, boolean bare) {\r
diff --git a/src/com/gitblit/utils/MarkdownUtils.java b/src/com/gitblit/utils/MarkdownUtils.java
new file mode 100644 (file)
index 0000000..6cdb3be
--- /dev/null
@@ -0,0 +1,53 @@
+package com.gitblit.utils;\r
+\r
+import java.io.IOException;\r
+import java.io.Reader;\r
+import java.io.StringReader;\r
+import java.io.StringWriter;\r
+\r
+import org.tautua.markdownpapers.Markdown;\r
+import org.tautua.markdownpapers.parser.ParseException;\r
+\r
+public class MarkdownUtils {\r
+\r
+       public static String transformMarkdown(String markdown) throws java.text.ParseException {\r
+               // Read raw markdown content and transform it to html           \r
+               StringReader reader = new StringReader(markdown);\r
+               StringWriter writer = new StringWriter();\r
+               try {\r
+                       Markdown md = new Markdown();\r
+                       md.transform(reader, writer);\r
+                       return writer.toString();\r
+               } catch (ParseException p) {                    \r
+                       throw new java.text.ParseException(p.getMessage(), 0);\r
+               } finally {\r
+                       reader.close();\r
+                       try {\r
+                               writer.close();\r
+                       } catch (IOException e) {\r
+                       }\r
+               }\r
+       }\r
+\r
+       public static String transformMarkdown(Reader markdownReader) throws java.text.ParseException {\r
+               // Read raw markdown content and transform it to html                           \r
+               StringWriter writer = new StringWriter();\r
+               try {\r
+                       Markdown md = new Markdown();\r
+                       md.transform(markdownReader, writer);\r
+                       return writer.toString();\r
+               } catch (ParseException p) {                    \r
+                       throw new java.text.ParseException(p.getMessage(), 0);\r
+               } finally {\r
+                       try {\r
+                               markdownReader.close();\r
+                       } catch (IOException e) {\r
+                       }\r
+                       try {\r
+                               writer.close();\r
+                       } catch (IOException e) {\r
+                       }\r
+               }\r
+       }\r
+\r
+}\r
index d52be0e48640599c190b267d69a65c7452965271..ff47a51ecbf39ceb6a504cb6ed743e0327140875 100644 (file)
@@ -1,16 +1,10 @@
 package com.gitblit.utils;\r
 \r
-import java.io.IOException;\r
-import java.io.Reader;\r
-import java.io.StringReader;\r
-import java.io.StringWriter;\r
 import java.io.UnsupportedEncodingException;\r
 import java.security.MessageDigest;\r
 import java.security.NoSuchAlgorithmException;\r
 import java.util.List;\r
 \r
-import org.tautua.markdownpapers.Markdown;\r
-import org.tautua.markdownpapers.parser.ParseException;\r
 \r
 public class StringUtils {\r
 \r
@@ -113,44 +107,4 @@ public class StringUtils {
                        throw new RuntimeException(t);\r
                }\r
        }\r
-\r
-       public static String transformMarkdown(String markdown) throws java.text.ParseException {\r
-               // Read raw markdown content and transform it to html           \r
-               StringReader reader = new StringReader(markdown);\r
-               StringWriter writer = new StringWriter();\r
-               try {\r
-                       Markdown md = new Markdown();\r
-                       md.transform(reader, writer);\r
-                       return writer.toString();\r
-               } catch (ParseException p) {                    \r
-                       throw new java.text.ParseException(p.getMessage(), 0);\r
-               } finally {\r
-                       reader.close();\r
-                       try {\r
-                               writer.close();\r
-                       } catch (IOException e) {\r
-                       }\r
-               }\r
-       }\r
-       \r
-       public static String transformMarkdown(Reader markdownReader) throws java.text.ParseException {\r
-               // Read raw markdown content and transform it to html                           \r
-               StringWriter writer = new StringWriter();\r
-               try {\r
-                       Markdown md = new Markdown();\r
-                       md.transform(markdownReader, writer);\r
-                       return writer.toString();\r
-               } catch (ParseException p) {                    \r
-                       throw new java.text.ParseException(p.getMessage(), 0);\r
-               } finally {\r
-                       try {\r
-                               markdownReader.close();\r
-                       } catch (IOException e) {\r
-                       }\r
-                       try {\r
-                               writer.close();\r
-                       } catch (IOException e) {\r
-                       }\r
-               }\r
-       }\r
 }\r
index 17bbdecb52ee0f2e39bf1eea0a83342fc95ba7ce..39bdd29b9882d5a8d47b95df7045690c29b445fa 100644 (file)
@@ -76,4 +76,5 @@ gb.group = group
 gb.description = description\r
 gb.enableTickets = enable tickets\r
 gb.enableDocs = enable docs\r
-gb.save = save
\ No newline at end of file
+gb.save = save\r
+gb.showRemoteBranches = show remote branches
\ No newline at end of file
index 8efa58dc1cfced50ea52cfd6a981225910f558d3..d21cff6117d525cbc9f6a2b5d1d48aabad6a12eb 100644 (file)
@@ -12,6 +12,7 @@ public class RepositoryModel implements Serializable {
        public String group;\r
        public Date lastChange;\r
        public boolean hasCommits;\r
+       public boolean showRemoteBranches;\r
        public boolean useTickets;\r
        public boolean useDocs;\r
        public boolean useRestrictedAccess;\r
index 49088f0d2f1ebda5d5f65a8b1a861429996a435f..928765c3e237b50ad088f16ffd21096d417155ba 100644 (file)
@@ -10,7 +10,7 @@ public class BranchesPage extends RepositoryPage {
        public BranchesPage(PageParameters params) {\r
                super(params);\r
 \r
-               add(new BranchesPanel("branchesPanel", repositoryName, getRepository(), -1));\r
+               add(new BranchesPanel("branchesPanel", getRepositoryModel(), getRepository(), -1));\r
        }\r
 \r
        @Override\r
index 6c622455baecb91d7248438a252b7387f18fb1b5..bc965e7a3f372daa0d337b4e0b22b393b4ab6384 100644 (file)
@@ -21,7 +21,8 @@
                                <tr><th><wicket:message key="gb.group"></wicket:message></th><td class="edit"><input type="text" wicket:id="group" size="30" tabindex="4" /></td></tr>\r
                                <tr><th><wicket:message key="gb.enableTickets"></wicket:message></th><td class="edit"><input type="checkbox" wicket:id="useTickets" tabindex="5" /> &nbsp;<i>distributed Ticgit issues</i></td></tr>\r
                                <tr><th><wicket:message key="gb.enableDocs"></wicket:message></th><td class="edit"><input type="checkbox" wicket:id="useDocs" tabindex="6" /> &nbsp;<i>enumerates repository Markdown documentation</i></td></tr>\r
-                               <tr><td class="edit" colspan="2"><input type="submit" value="Save" wicket:message="value:gb.save" tabindex="7" /></td></tr>\r
+                               <tr><th><wicket:message key="gb.showRemoteBranches"></wicket:message></th><td class="edit"><input type="checkbox" wicket:id="showRemoteBranches" tabindex="7" /> &nbsp;<i>show remote branches</i></td></tr>\r
+                               <tr><td class="edit" colspan="2"><input type="submit" value="Save" wicket:message="value:gb.save" tabindex="8" /></td></tr>\r
                        </tbody>\r
                </table>\r
        </form> \r
index 45fe9e2ed3cf77f0b309260e78d7d1e2021569af..6bf16599fe6640b2b059d1a2ba54db1727f6553b 100644 (file)
@@ -67,6 +67,7 @@ public class EditRepositoryPage extends BasePage {
                form.add(new TextField<String>("group"));\r
                form.add(new CheckBox("useTickets"));\r
                form.add(new CheckBox("useDocs"));\r
+               form.add(new CheckBox("showRemoteBranches"));\r
 \r
                add(form);\r
        }\r
index 64d3ce3fa4a14311d93d904136ad2df0b47c93ed..81e53f550cffe01c7f1bc71608e65383bed3af8d 100644 (file)
@@ -10,7 +10,7 @@ import org.eclipse.jgit.lib.Repository;
 import org.eclipse.jgit.revwalk.RevCommit;\r
 \r
 import com.gitblit.utils.JGitUtils;\r
-import com.gitblit.utils.StringUtils;\r
+import com.gitblit.utils.MarkdownUtils;\r
 import com.gitblit.wicket.RepositoryPage;\r
 import com.gitblit.wicket.WicketUtils;\r
 \r
@@ -34,7 +34,7 @@ public class MarkdownPage extends RepositoryPage {
                String markdownText = JGitUtils.getRawContentAsString(r, commit, markdownPath);\r
                String htmlText;\r
                try {\r
-                       htmlText = StringUtils.transformMarkdown(markdownText);\r
+                       htmlText = MarkdownUtils.transformMarkdown(markdownText);\r
                } catch (ParseException p) {\r
                        error(p.getMessage());\r
                        htmlText = markdownText;\r
index 2edb3e8c9f8146d8382c8e62afa1303fd182fccb..111084c314426e24f31cbf7dde22f883d4fd1d13 100644 (file)
@@ -25,6 +25,7 @@ import org.apache.wicket.resource.ContextRelativeResource;
 \r
 import com.gitblit.GitBlit;\r
 import com.gitblit.Keys;\r
+import com.gitblit.utils.MarkdownUtils;\r
 import com.gitblit.utils.StringUtils;\r
 import com.gitblit.utils.TimeUtils;\r
 import com.gitblit.wicket.BasePage;\r
@@ -68,7 +69,7 @@ public class RepositoriesPage extends BasePage {
                                ContextRelativeResource res = WicketUtils.getResource("welcome.mkd");\r
                                InputStream is = res.getResourceStream().getInputStream();\r
                                InputStreamReader reader = new InputStreamReader(is);\r
-                               message = StringUtils.transformMarkdown(reader);\r
+                               message = MarkdownUtils.transformMarkdown(reader);\r
                        } catch (Throwable t) {\r
                                message = "Failed to read default welcome message!";\r
                                error(message, t, false);\r
@@ -80,7 +81,7 @@ public class RepositoriesPage extends BasePage {
                                if (file.exists()) {\r
                                        try {\r
                                                FileReader reader = new FileReader(file);\r
-                                               message = StringUtils.transformMarkdown(reader);\r
+                                               message = MarkdownUtils.transformMarkdown(reader);\r
                                        } catch (Throwable t) {\r
                                                message = "Failed to read " + file;\r
                                                error(message, t, false);\r
index 78a58f771d8540de16aabb2e72009a052faa2b3b..c0193dbeec8159052fd291b032da1d37104b16ac 100644 (file)
@@ -70,7 +70,7 @@ public class SummaryPage extends RepositoryPage {
 \r
                add(new LogPanel("commitsPanel", repositoryName, null, r, numberCommits, 0));\r
                add(new TagsPanel("tagsPanel", repositoryName, r, numberRefs));\r
-               add(new BranchesPanel("branchesPanel", repositoryName, r, numberRefs));\r
+               add(new BranchesPanel("branchesPanel", getRepositoryModel(), r, numberRefs));\r
 \r
                // Display an activity line graph\r
                insertActivityGraph(metrics);\r
index ff4679f5eeee6cb8235e38a4d3603858c305ba71..aff28ec8fc2661fe22cbeae402384d084ccd3960 100644 (file)
@@ -18,6 +18,7 @@ import com.gitblit.utils.StringUtils;
 import com.gitblit.wicket.LinkPanel;\r
 import com.gitblit.wicket.WicketUtils;\r
 import com.gitblit.wicket.models.RefModel;\r
+import com.gitblit.wicket.models.RepositoryModel;\r
 import com.gitblit.wicket.pages.BranchesPage;\r
 import com.gitblit.wicket.pages.LogPage;\r
 import com.gitblit.wicket.pages.SummaryPage;\r
@@ -27,13 +28,15 @@ public class BranchesPanel extends BasePanel {
 \r
        private static final long serialVersionUID = 1L;\r
 \r
-       public BranchesPanel(String wicketId, final String repositoryName, Repository r, final int maxCount) {\r
+       public BranchesPanel(String wicketId, final RepositoryModel model, Repository r, final int maxCount) {\r
                super(wicketId);\r
 \r
                // branches\r
                List<RefModel> branches = new ArrayList<RefModel>();\r
                branches.addAll(JGitUtils.getLocalBranches(r, maxCount));\r
-               branches.addAll(JGitUtils.getRemoteBranches(r, maxCount));\r
+               if (model.showRemoteBranches) {\r
+                       branches.addAll(JGitUtils.getRemoteBranches(r, maxCount));\r
+               }\r
                Collections.sort(branches);\r
                Collections.reverse(branches);\r
                if (maxCount > 0 && branches.size() > maxCount) {\r
@@ -43,11 +46,11 @@ public class BranchesPanel extends BasePanel {
                if (maxCount > 0) {\r
                        // summary page\r
                        // show branches page link\r
-                       add(new LinkPanel("branches", "title", new StringResourceModel("gb.branches", this, null), BranchesPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
+                       add(new LinkPanel("branches", "title", new StringResourceModel("gb.branches", this, null), BranchesPage.class, WicketUtils.newRepositoryParameter(model.name)));\r
                } else {\r
                        // branches page\r
                        // show repository summary page link\r
-                       add(new LinkPanel("branches", "title", repositoryName, SummaryPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
+                       add(new LinkPanel("branches", "title", model.name, SummaryPage.class, WicketUtils.newRepositoryParameter(model.name)));\r
                }\r
 \r
                ListDataProvider<RefModel> branchesDp = new ListDataProvider<RefModel>(branches);\r
@@ -60,14 +63,14 @@ public class BranchesPanel extends BasePanel {
 \r
                                item.add(WicketUtils.createDateLabel("branchDate", entry.getDate(), getTimeZone()));\r
 \r
-                               item.add(new LinkPanel("branchName", "list name", StringUtils.trimString(entry.getDisplayName(), 28), LogPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));\r
+                               item.add(new LinkPanel("branchName", "list name", StringUtils.trimString(entry.getDisplayName(), 28), LogPage.class, WicketUtils.newObjectParameter(model.name, entry.getName())));\r
 \r
                                // only show branch type on the branches page\r
                                boolean remote = entry.getName().startsWith(Constants.R_REMOTES);\r
                                item.add(new Label("branchType", remote ? getString("gb.remote") : getString("gb.local")).setVisible(maxCount <= 0));\r
 \r
-                               item.add(new BookmarkablePageLink<Void>("log", LogPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));\r
-                               item.add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));\r
+                               item.add(new BookmarkablePageLink<Void>("log", LogPage.class, WicketUtils.newObjectParameter(model.name, entry.getName())));\r
+                               item.add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils.newObjectParameter(model.name, entry.getName())));\r
 \r
                                WicketUtils.setAlternatingBackground(item, counter);\r
                                counter++;\r
@@ -77,7 +80,7 @@ public class BranchesPanel extends BasePanel {
                if (branches.size() < maxCount || maxCount <= 0) {\r
                        add(new Label("allBranches", "").setVisible(false));\r
                } else {\r
-                       add(new LinkPanel("allBranches", "link", new StringResourceModel("gb.allBranches", this, null), BranchesPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
+                       add(new LinkPanel("allBranches", "link", new StringResourceModel("gb.allBranches", this, null), BranchesPage.class, WicketUtils.newRepositoryParameter(model.name)));\r
                }\r
        }\r
 }\r
index 7f744068100e79c5891335025489686aca378ffc..a9248acbd9555c5605b59b67707a26fb31ed8165 100644 (file)
@@ -1,5 +1,5 @@
-## Welcome to Git:Blit ##\r
+## Welcome to Git:Blit\r
 \r
-A quick and easy way to host your own Git repositories.\r
+A quick and easy way to host or view your own Git repositories.\r
 \r
-Built with [JGit](http://eclipse.org/jgit), [Wicket](http://wicket.apache.org), [WicketStuff GoogleCharts](https://github.com/wicketstuff/core/wiki/GoogleCharts), [markitup](http://markitup.jaysalvat.com), [MarkdownPapers](http://markdown.tautua.org), [Jetty](http://eclipse.org/jetty), [SLF4J](http://www.slf4j.org), [Log4j](http://logging.apache.org/log4j), [google-code-prettify](http://code.google.com/p/google-code-prettify), [JCommander](http://jcommander.org), Most icons courtesy of [FatCow Hosting](http://www.fatcow.com/free-icons)
\ No newline at end of file
+Built with [JGit](http://eclipse.org/jgit), [Wicket](http://wicket.apache.org), [WicketStuff GoogleCharts](https://github.com/wicketstuff/core/wiki/GoogleCharts), [MarkdownPapers](http://markdown.tautua.org), [Jetty](http://eclipse.org/jetty), [SLF4J](http://www.slf4j.org), [Log4j](http://logging.apache.org/log4j), [google-code-prettify](http://code.google.com/p/google-code-prettify), [JCommander](http://jcommander.org), [BouncyCastle](http://www.bouncycastle.org), [JavaService](http://forge.ow2.org/projects/javaservice), and most icons courtesy of [FatCow Hosting](http://www.fatcow.com/free-icons)
\ No newline at end of file