3 * concept is to merge commits from a live or working tree
4 * into the 'release tree'
7 * step 1 = render the log of differences..
11 * -- our doc commit changes loads of files.. and makes the layout pointless.
12 * -- ?? grouping by day??? // expand/collapse..
17 require_once 'MTrackWeb/Log.php';
19 class MTrackWeb_Merger extends MTrackWeb_Log {
22 // function getAuth() - from log..
28 $this->pi = empty($pi) ? '' : ($pi . $this->bootLoader->ext);
29 $this->repo = DB_DataObject::factory('mtrack_repos');
30 $this->filename = $this->repo->loadFromPath($this->pi);
34 if (!$this->repo->id) {
35 return HTML_FlexyFramework::run('Browse');
38 if (!$this->projectPerm($this->repo->project_id, 'MTrack.Repos', 'S')) {
39 return HTML_FlexyFramework::run('Noperm'); // noperm = loggedin -> need more perms / not.. try loggin in..
46 $this->repo->debug = 1;
47 $ar = $this->repo->history("/", null, "rev", "$release..$live");
48 //echo '<PRE>';print_R($ar);
50 // need to get a 2 dimensional array of
51 // files along top, and commints down.
54 foreach($ar as $commit) {
55 $files = $commit->files;
56 $id = date("Y-m-d H:i", strtotime($commit->ctime));
57 if (!isset($row[$id])) {
58 $rows[$id] = $row= array(
60 'desc' => $commit->changelog
64 foreach($files as $f=>$data) {
65 $rows[$id][$f] = $commit->rev;
66 $cfiles[$f] = isset($cfiles[$f]) ? $cfiles[$f] +1 : 1;
71 // this might result in alot of white boxes where you can
72 // let's see what it looks like..
73 echo '<PRE>';print_R($cfiles);
74 echo '<PRE>';print_R($rows);