DataObjects/Mtrack_repos_branch.php
authorAlan Knowles <alan@roojs.com>
Tue, 15 Jan 2019 10:10:49 +0000 (18:10 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 15 Jan 2019 10:10:49 +0000 (18:10 +0800)
DataObjects/Mtrack_repos_branch.php

index 4d7c67c..8206433 100644 (file)
@@ -32,42 +32,28 @@ class Pman_MTrack_DataObjects_Mtrack_repos extends DB_DataObject
         
         $object = null;
         $branch = null;
-        if ($this->impl()->shortname == 'greengarden') {
+         
             $object = 'branch';
-            $branch = 'roojs';
+            $branch = $this->name;
         }
         
         //$this->impl()->debug=1;
         //print_r(array('since'=> '{'.$start.'}' , 'before' => '{'.$end .'}'));
-        $res = $this->impl()->history('.', array('since'=> '{'.$start.'}' , 'before' => '{'.$end .'}'), 'rev', '--all');
-        
-        $branches = array();
-        foreach($res as $r) {
-            if (!preg_match('#^refs/heads/.*$#', $r->branch)) {
-                continue;
-            }
-            $br = preg_replace('#^refs/heads/.*$#', $r->branch, '');
-            $branches[$br] = 1;
-                
-        }
-        $objs = array();
-        foreach($branches as $branch=>$one) {
-            
-            
-            $res = $this->impl()->history('.', array('since'=> '{'.$start.'}' , 'before' => '{'.$end .'}'), $object, $branch);
-             
-            // find the last rev the day before...
-            
-            
-             
-            $obj = $this->historyToSummary($res, $notify->act_start);
-            if (!$obj) {
-               // echo "History returned nothing";
-                return true;
-            }
-            $obj->from_dt = $start;
-            $obj->to_dt = $end;
-            $obj->branch = $br;
+    
+         $res = $this->repo()->impl()->history('.', array('since'=> '{'.$start.'}' , 'before' => '{'.$end .'}'), $object, $branch);
+          
+         // find the last rev the day before...
+         
+         
+          
+         $obj = $this->historyToSummary($res, $notify->act_start);
+         if (!$obj) {
+            // echo "History returned nothing";
+             return true;
+         }
+         $obj->from_dt = $start;
+         $obj->to_dt = $end;
+         $obj->branch = $br;
             //print_r($obj);exit; 
          
             $objs[] = $obj;