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..
54 $this->repo->debug = 1;
55 $ar = $this->repo->history("/", null, "rev", "$release..$live");
57 // the point of this is to extract all the revisions, and group them.
61 //echo '<PRE>';print_R($ar);
63 // need to get a 2 dimensional array of
64 // files along top, and commints down.
67 foreach($ar as $commit) {
69 $files = $commit->files;
70 $day = date("Y-m-d", strtotime($commit->ctime));
71 if (!isset($days[$day])) {
78 $time= date("H:i:s", strtotime($commit->ctime));
79 if (!isset($days[$day]['children'][$time])) {
80 $days[$day]['children'][$time] = array(
82 'rev' => $day . ' ' . $time,
86 $days[$day]['children'][$time]['children'][] = array(
87 'title'=> $commit->changelog,
91 // this might result in alot of white boxes where you can
92 // let's see what it looks like..
93 echo '<PRE>';print_R($days);