diff --git a/codepot/src/codepot/controllers/code.php b/codepot/src/codepot/controllers/code.php index df2f992b..ccfdc754 100644 --- a/codepot/src/codepot/controllers/code.php +++ b/codepot/src/codepot/controllers/code.php @@ -157,6 +157,28 @@ class Code extends Controller $file['created_tag'] = $this->subversion->getRevProp ($projectid, $file['created_rev'], CODEPOT_SVN_TAG_PROPERTY); if ($file['created_tag'] === FALSE) $file['created_tag'] = ''; + + foreach ($file['content'] as &$f) + { + $exe = $this->subversion->getProp ( + $projectid, $path . '/' . $f['name'], + $file['created_rev'], 'svn:executable'); + if ($exe !== FALSE && is_array($exe)) + { + // the answer is like this + // Array ( [file:///var/lib/codepot/svnrepo/sg/trunk/drbdfix/drbdfix.sh] => Array ( [svn:executable] => * ) ) + foreach ($exe as &$ex) + { + if (array_key_exists('svn:executable', $ex)) + { + $f['executable'] = $ex['svn:executable']; + break; + } + } + } + } + + $data['project'] = $project; $data['headpath'] = $path; $data['file'] = $file; diff --git a/codepot/src/codepot/models/subversionmodel.php b/codepot/src/codepot/models/subversionmodel.php index d4e3bd0f..b85f42c4 100644 --- a/codepot/src/codepot/models/subversionmodel.php +++ b/codepot/src/codepot/models/subversionmodel.php @@ -1137,6 +1137,26 @@ class SubversionModel extends Model return @svn_proplist ($workurl, 0, $rev); } + function getProp ($projectid, $path, $rev, $prop) + { + $orgurl = 'file://'.$this->_canonical_path(CODEPOT_SVNREPO_DIR."/{$projectid}/{$path}"); + + $workurl = ($path == '')? $orgurl: "{$orgurl}@"; // trailing @ for collision prevention + $info = @svn_info ($workurl, FALSE, $rev); + + if ($info === FALSE || count($info) != 1) + { + if ($rev == SVN_REVISION_HEAD || $path == '') return FALSE; + + // rebuild the URL with a peg revision and retry it. + $workurl = "{$orgurl}@{$rev}"; + $info = @svn_info ($workurl, FALSE, $rev); + if ($info === FALSE || count($info) != 1) return FALSE; + } + + return @svn_propget ($workurl, $prop, FALSE, $rev); + } + function _cloc_revision_by_lang ($projectid, $path, $rev) { $orgurl = 'file://'.$this->_canonical_path(CODEPOT_SVNREPO_DIR."/{$projectid}/{$path}"); diff --git a/codepot/src/codepot/views/code_folder.php b/codepot/src/codepot/views/code_folder.php index 9ad21135..358d038e 100644 --- a/codepot/src/codepot/views/code_folder.php +++ b/codepot/src/codepot/views/code_folder.php @@ -713,7 +713,8 @@ $this->load->view ( { // file $hexpath = $this->converter->AsciiToHex($fullpath); - print "