[evolvis-commits] r18398: scmsvn-tweaks pending merges:↵ Thorsten Glaser 2012-05-11 [#2971] display additional git repositories for a group, too

mirabilos at evolvis.org mirabilos at evolvis.org
Fri May 11 17:15:48 CEST 2012


Author: mirabilos
Date: 2012-05-11 17:15:47 +0200 (Fri, 11 May 2012)
New Revision: 18398

Modified:
   trunk/gforge_base/evolvisforge-5.1/src/plugins/scmgit/common/GitPlugin.class.php
Log:
scmsvn-tweaks pending merges:
  Thorsten Glaser 2012-05-11 [#2971] display additional git repositories for a group, too

Modified: trunk/gforge_base/evolvisforge-5.1/src/plugins/scmgit/common/GitPlugin.class.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/plugins/scmgit/common/GitPlugin.class.php	2012-05-11 15:15:38 UTC (rev 18397)
+++ trunk/gforge_base/evolvisforge-5.1/src/plugins/scmgit/common/GitPlugin.class.php	2012-05-11 15:15:47 UTC (rev 18398)
@@ -242,11 +242,42 @@
 		$b .= '<p>';
 		$b .= _('Browsing the Git tree gives you a view into the current status of this project\'s code. You may also view the complete histories of any file in the repository.');
 		$b .= '</p>';
-		$b .= '<p>[' ;
-		$b .= util_make_link ("/scm/browser.php?group_id=".$project->getID(),
-				      _('Browse primary Git Repository')
-			) ;
-		$b .= ']</p>' ;
+
+		$rootdir = forge_get_config('repos_path', 'scmgit');
+		$unxname = $project->getUnixName();
+		$xrepos = $this->getRepositories($rootdir . "/" . $unxname);
+		$repos = array();
+		$prepo = false;
+
+		foreach ($xrepos as $repo) {
+			$repo = substr($repo, strlen($rootdir) + 1);
+			if ($repo == ($unxname . "/" . $unxname . ".git")) {
+				$prepo = true;
+			} else {
+				$repos[] = $repo;
+			}
+		}
+
+		if ($prepo) {
+			$b .= '<p>[' .
+			    util_make_link("/plugins/scmgit/cgi-bin/gitweb.cgi?p=" .
+			    $unxname . "/" . $unxname . ".git",
+			    _('Browse primary Git repository')) . "]</p>\n";
+		}
+
+		if (!$repos) {
+			return $b;
+		}
+
+		$b .= '<p>' . _('Browse additional Git repositories') .
+		    "</p><ul>\n";
+		foreach ($repos as $repo) {
+			$b .= '<li>' .
+			    util_make_link("/plugins/scmgit/cgi-bin/gitweb.cgi?p=" .
+			    $repo, substr($repo, 0, -4)) . "</li>\n";
+		}
+		$b .= "</ul>\n";
+
 		return $b ;
 	}
 
@@ -706,5 +737,3 @@
 // mode: php
 // c-file-style: "bsd"
 // End:
-
-?>



More information about the evolvis-commits mailing list