MTrackWeb/Merger.php
[web.mtrack] / MTrackWeb / Merger.php
1 <?php
2 /**
3  * concept is to merge commits from a live or working tree
4  * into the 'release tree'
5  *
6  *
7  * step 1 = render the log of differences..
8  *
9  */
10
11 require_once 'MTrackWeb/Log.php';
12
13 class MTrackWeb_Merger extends MTrackWeb_Log {
14     
15     
16     // function getAuth() - from log..
17     
18     
19     function get($pi)
20     {
21         
22         $this->pi = empty($pi) ? '' : ($pi . $this->bootLoader->ext);
23          $this->repo = DB_DataObject::factory('mtrack_repos');
24         $this->filename = $this->repo->loadFromPath($this->pi);
25         
26         
27        
28         if (!$this->repo->id) {
29             return HTML_FlexyFramework::run('Browse');  
30         };
31           
32         if (!$this->projectPerm($this->repo->project_id, 'MTrack.Repos', 'S')) {
33             return HTML_FlexyFramework::run('Noperm');  // noperm = loggedin -> need more perms / not.. try loggin in..
34         }
35          $hist = $this->repo->history("/", array($offset,100), $object, $ident);
36          
37          
38         $live = 'master';
39         $release = 'github';
40          
41         
42         $ar = $this->repo->history("/", null, "rev",  "$release..$master");
43         print_R($ar);
44         
45         // need to get a 2 dimensional array of
46         // files along top, and commints down.
47         foreach($ar as $commit) {
48             $files = $commit->files();
49             $row = array(
50                 'commit' => $commit->time()
51             );
52             foreach($files as $f) {
53                 $row[$f] = $commit->uid();
54             }
55             $rows[] = $row;
56         }
57         // this might result in alot of white boxes where you can
58         // let's see what it looks like..
59         
60         die("done");
61         
62         
63         
64         
65     }
66     
67     
68     
69 }