require_once 'MTrack/Config.php';
require_once 'MTrack/Project.php';
require_once 'MTrack/SCMFileEvent.php';
-require_once 'MTrack/ACL.php';
-//require_once 'MTrack/Changeset.php';
-require_once 'MTrack/Wiki.php';
+ //require_once 'MTrack/Changeset.php';
+//require_once 'MTrack/Wiki.php';
class MTrack_Repo extends MTrackSCM
static function factory($ar)
{
- print_r($ar);
+ //print_r($ar);
$type = ucfirst($ar['scmtype']);
$fn = 'MTrack/SCM/'.$type .'/Repo.php';
$cls = 'MTrack_SCM_'.$type .'_Repo';
function diff($path, $from = null, $to = null) {}
function getRelatedChanges($revision) {}
function getSCMMetaData() { return null; }
-
-/* -- We do not support projects yet,
- and anyway it should be repo's are only part of a single project
- ... even if they are multiple projects it would not be feasible to
- ... work that out from the path...
-
-
- function projectFromPath($filename)
- {
- static $links = array();
- if (!isset($links[$this->repoid]) || $links[$this->repoid] === null) {
- $links[$this->repoid] = array();
- foreach (MTrackDB::q(
- 'select projid, repopathregex from project_repo_link where repoid = ?',
- $this->repoid) as $row) {
- $re = str_replace('/', '\\/', $row[1]);
- $links[$this->repoid][] = array($row[0], "/$re/");
- }
- }
- if (is_array($filename)) {
- $proj_incidence = array();
- foreach ($filename as $file) {
- $proj = $this->projectFromPath($file);
- if ($proj === null) continue;
- if (isset($proj_incidence[$proj])) {
- $proj_incidence[$proj]++;
- } else {
- $proj_incidence[$proj] = 1;
- }
- }
- $the_proj = null;
- $the_proj_count = 0;
- foreach ($proj_incidence as $proj => $count) {
- if ($count > $the_proj_count) {
- $the_proj_count = $count;
- $the_proj = $proj;
- }
- }
- return $the_proj;
- }
-
- if ($filename instanceof MTrackSCMFileEvent) {
- $filename = $filename->name;
- }
-
- // walk through the regexes; take the longest match as definitive
- $longest = null;
- $longest_id = null;
- if ($filename[0] != '/') {
- $filename = '/' . $filename;
- }
- foreach ($links[$this->repoid] as $link) {
- if (preg_match($link[1], $filename, $M)) {
- if (strlen($M[0]) > strlen($longest)) {
- $longest = $M[0];
- $longest_id = $link[0];
- }
- }
- }
- return $longest_id;
- }
- */
-
-
-
-
- /*
-
- static function defaultRepo($cfg = null)
- {
- static $defrepo = null;
- if ($defrepo !== null) {
- return $defrepo; // already to it..
- }
-
- $defrepo = $cfg;
- if ($defrepo !== null) {
- $defrepo = strpos($defrepo, '/') === false ? 'default/' . $defrepo : $defrepo;
- return $defrepo;
- }
-
- $defrepo = '';
- $q = MTrackDB::q( 'select parent, shortname from repos order by shortname');
- foreach($q->fetchAll() as $row) {
- $defrepo = MTrackSCM::makeDisplayName($row);
- return $defrepo;
- }
- return '';
-
+ /**
+ * converts a commit log message (cached locally into a working object..)
+ * see Browse.php
+ */
+ function commitLogToEvent($str) {
+ throw new Exception("no implementation for commitLogToEvent");
}
- */
}