php8
[web.mtrack] / MTrackWeb / Merger.php
index d68d5c5..f8c9636 100644 (file)
@@ -6,6 +6,12 @@
  *
  * step 1 = render the log of differences..
  *
+ *
+ * First run issues:
+ *  -- our doc commit changes loads of files.. and makes the layout pointless.
+ *  -- ?? grouping by day??? // expand/collapse.. 
+ * 
+ *
  */
 
 require_once 'MTrackWeb/Log.php';
@@ -33,30 +39,59 @@ class MTrackWeb_Merger extends MTrackWeb_Log {
             return HTML_FlexyFramework::run('Noperm');  // noperm = loggedin -> need more perms / not.. try loggin in..
         }
           
-         
+        $this->tree();
+        
+        
+        exit;
+        
+    }
+    function tree()
+    {
+        
         $live = 'master';
         $release = 'github';
          
+        $this->repo->debug = 1;
+        $ar = $this->repo->history("/", null, "rev",  "$release..$live");
+        
+        // the point of this is to extract all the revisions, and group them.
+        
+        
         
-        $ar = $this->repo->history("/", null, "rev",  "$release..$master");
-        print_R($ar);
+        //echo '<PRE>';print_R($ar);
         
         // need to get a 2 dimensional array of
         // files along top, and commints down.
+        $cfiles = array();
+        $rows = array();
         foreach($ar as $commit) {
-            $files = $commit->files();
-            $row = array(
-                'commit' => $commit->time()
-            );
-            foreach($files as $f) {
-                $row[$f] = $commit->uid();
+            
+            $files = $commit->files;
+            $day = date("Y-m-d", strtotime($commit->ctime));
+            if (!isset($days[$day])) { 
+                $days[$day] = array(
+                    'title' => $day,
+                    'rev' => $day,
+                    'children' => array()
+                );
+            }
+            $time= date("H:i:s", strtotime($commit->ctime));
+            if (!isset($days[$day]['children'][$time])) { 
+                $days[$day]['children'][$time] = array(
+                    'title' => $time,
+                    'rev' => $day . ' ' . $time,
+                    'commits' =>array(),
+                );
             }
-            $rows[] = $row;
+            $days[$day]['children'][$time]['children'][] = array(
+                'title'=> $commit->changelog,
+                'rev' => $commit->rev
+            );
         }
         // this might result in alot of white boxes where you can
         // let's see what it looks like..
+        echo '<PRE>';print_R($days);
         
-        die("done");
         
         
         
@@ -64,5 +99,4 @@ class MTrackWeb_Merger extends MTrackWeb_Log {
     }
     
     
-    
 }