diff --git a/module/repo/control.php b/module/repo/control.php index 43018a4830..4a747571c8 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -369,6 +369,10 @@ class repo extends control $this->repo->setRepoBranch($branchID); } } + else + { + $this->repo->setRepoBranch(''); + } /* Decrypt path and get cacheFile. */ $path = $this->repo->decodePath($path); diff --git a/module/repo/model.php b/module/repo/model.php index 2bcd7a1c6d..155da3643d 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -56,46 +56,6 @@ class repoModel extends model } } - /* - if($showSeleter && !empty($repos)) - { - $repoIndex = '
'; - $repoIndex .= $this->select($repos, $repoID); - $repoIndex .= '
'; - - $branches = $this->getBranches($repo); - if(empty($branches)) - { - $this->setRepoBranch(''); - } - else - { - $branchID = 'master'; - if($this->cookie->repoBranch) $branchID = $this->cookie->repoBranch; - if(!isset($branches[$branchID])) $branchID = 'master'; - - $branch = zget($branches, $branchID); - if(empty($branch)) $branchID = $branch = current($branches); - - $this->setRepoBranch($branchID); - - $repoIndex .= '
'; - $repoIndex .= "
"; - } - - $this->lang->switcherMenu = $repoIndex; - } - */ - common::setMenuVars('devops', $repoID); session_start(); $this->session->set('repoID', $repoID); @@ -471,7 +431,7 @@ class repoModel extends model ->leftJoin(TABLE_REPOBRANCH)->alias('t2')->on('t1.id=t2.revision') ->where('t1.repo')->eq($repoID) ->beginIF($revision != 'HEAD')->andWhere('t1.revision')->eq($revision)->fi() - ->beginIF($this->cookie->repoBranch)->andWhere('t2.branch')->eq($this->cookie->repoBranch)->fi() + ->beginIF($repo->SCM != 'Subversion' and $this->cookie->repoBranch)->andWhere('t2.branch')->eq($this->cookie->repoBranch)->fi() ->orderBy('time desc') ->limit(1) ->fetch('time'); @@ -486,7 +446,7 @@ class repoModel extends model ->andWhere('t1.repo')->eq($repo->id) ->andWhere('t2.`time`')->le($revisionTime) ->andWhere('left(t2.comment, 12)')->ne('Merge branch') - ->beginIF($this->cookie->repoBranch)->andWhere('t3.branch')->eq($this->cookie->repoBranch)->fi() + ->beginIF($repo->SCM != 'Subversion' and $this->cookie->repoBranch)->andWhere('t3.branch')->eq($this->cookie->repoBranch)->fi() ->beginIF($type == 'dir') ->andWhere('t1.parent', true)->like(rtrim($entry, '/') . "/%") ->orWhere('t1.parent')->eq(rtrim($entry, '/')) @@ -503,7 +463,7 @@ class repoModel extends model ->where('t1.repo')->eq($repoID) ->andWhere('t1.`time`')->le($revisionTime) ->andWhere('left(t1.comment, 12)')->ne('Merge branch') - ->beginIF($this->cookie->repoBranch)->andWhere('t2.branch')->eq($this->cookie->repoBranch)->fi() + ->beginIF($repo->SCM != 'Subversion' and $this->cookie->repoBranch)->andWhere('t2.branch')->eq($this->cookie->repoBranch)->fi() ->beginIF($entry != '/' and !empty($entry))->andWhere('t1.id')->in($historyIdList)->fi() ->beginIF($begin)->andWhere('t1.time')->ge($begin)->fi() ->beginIF($end)->andWhere('t1.time')->le($end)->fi()