enhanced code search to consult the current revision

This commit is contained in:
hyung-hwan 2014-05-25 13:07:46 +00:00
parent daaf42b678
commit 792cd682f0
3 changed files with 7 additions and 5 deletions

View File

@ -446,6 +446,7 @@ class Code extends Controller
$this->form_validation->set_rules ('search_pattern', 'pattern', 'required');
$this->form_validation->set_rules ('search_folder', 'folder', '');
$this->form_validation->set_rules ('search_revision', 'revision', 'numeric');
$this->form_validation->set_error_delimiters('<span class="form_field_error">','</span>');
if ($this->input->post('search_pattern'))
@ -453,7 +454,7 @@ class Code extends Controller
$pattern = $this->input->post('search_pattern');
$path = $this->input->post('search_folder');
$path = $this->_normalize_path ($path);
$rev = SVN_REVISION_HEAD;
$rev = $this->input->post('search_revision');
$file = $this->subversion->getFile ($project->id, $path, $rev);
if ($file === FALSE)

View File

@ -127,8 +127,9 @@ $this->load->view (
<div class="infostrip" id="code_folder_mainarea_infostrip">
<?php if (CODEPOT_SIGNIN_FOR_CODE_SEARCH === FALSE || (isset($login['id']) && $login['id'] != '')): ?>
<?=form_open("code/search/{$project->id}/", 'id="code_folder_search_form"')?>
<?=form_open("code/search/{$project->id}/", 'id="code_folder_search_form"')?>
<?=form_hidden('search_folder', set_value('search_folder', $file['fullpath']), 'id="code_folder_search_folder"')?>
<?=form_hidden('search_revision', set_value('search_revision', $revision), 'id="code_folder_search_revision"')?>
<?=form_input('search_pattern', set_value('search_pattern', ''), 'id="code_folder_search_pattern"')?>
<?=form_submit('search_submit', $this->lang->line('Search'), 'id="code_folder_search_submit"')?>
|

View File

@ -93,13 +93,13 @@ $this->load->view (
<div class="infostrip" id="code_search_mainarea_infostrip">
<?=form_open("code/search/{$project->id}/", 'id="code_search_search_form"')?>
<?=form_open("code/search/{$project->id}/", 'id="code_search_search_form"')?>
<?=form_hidden ('search_folder', set_value('search_folder', $file['fullpath']), 'id="code_search_search_folder"')?>
<?=form_hidden ('search_revision', set_value('search_revision', $revision), 'id="code_search_search_revision"')?>
<?=form_input ('search_pattern', set_value('search_pattern', ''), 'id="code_search_search_pattern"')?>
<?=form_submit ('search_submit', $this->lang->line('Search'), 'id="code_search_search_submit"')?>
|
<?=$this->lang->line('Revision')?>: <?=$file['created_rev']?>
<?=form_close()?>
</div>
@ -149,7 +149,7 @@ function search_and_show ($controller, $project, $path, $revision, $pattern, $re
}
else
{
$revreq = "/{$file2['rev']}";
$revreq = "/{$file2['created_rev']}";
$revreqroot = '/' . $controller->converter->AsciiToHex ('.') . $revreq;
}