}
-
+ function branchObject($n)
+ {
+ // create or return branch dataobject
+ $b = DB_DataObject::factory('mtrack_repos_branch');
+ $b->repo_id = $this->id;
+ $b->name = $n;
+ if ($b->find(true)) {
+ return $b;
+ }
+ $b->insert();
+ return $b;
+
+ }
// these should really be phased out, and the Controlers use impl()-> directly..
function getBranches()
//print_r($last);exit;
$body = '';
-
+ $len = 0;
foreach($obj->summary as $file=>$who) {
$res = $this->impl()->diff($file, $last ? $last->rev : $first->rev, $last ? $first->rev : null);
//print_r($res);
//$lines = $this->parseDiff($res);
$lines = stream_get_contents($res);
+ $len += strlen($lines);
+ if ($len > 2000000) {
+ $lines = "Too large see repo";
+ }
if (preg_match('/\.map$/', $file)) {
$lines = "Changed";
//$this->impl()->debug=1;
//print_r(array('since'=> '{'.$start.'}' , 'before' => '{'.$end .'}'));
- $res = $this->impl()->history('.', array('since'=> '{'.$start.'}' , 'before' => '{'.$end .'}'), $object, $branch);
-
- // find the last rev the day before...
-
+ $res = $this->impl()->history('.', array('since'=> '{'.$start.'}' , 'before' => '{'.$end .'}'), 'rev', '--all');
-
- $obj = $this->historyToSummary($res, $notify->act_start);
- if (!$obj) {
- // echo "History returned nothing";
- return true;
+ $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;
+ //print_r($obj);exit;
+
+ $objs[] = $obj;
}
- $obj->from_dt = $start;
- $obj->to_dt = $end;
+ $ret = $rcpt->buildMail('repo_daily_changes', array('branches' => $obj));
- //print_r($obj);exit;
- $ret = $rcpt->buildMail('repo_daily_changes', $obj);
- //print_r($ret);exit;
return $ret;