From 792cd682f002215c15b07c44d5e15df93853abd1 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sun, 25 May 2014 13:07:46 +0000 Subject: [PATCH] enhanced code search to consult the current revision --- codepot/src/codepot/controllers/code.php | 3 ++- codepot/src/codepot/views/code_folder.php | 3 ++- codepot/src/codepot/views/code_search.php | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/codepot/src/codepot/controllers/code.php b/codepot/src/codepot/controllers/code.php index fe940184..60542ec9 100644 --- a/codepot/src/codepot/controllers/code.php +++ b/codepot/src/codepot/controllers/code.php @@ -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('',''); 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) diff --git a/codepot/src/codepot/views/code_folder.php b/codepot/src/codepot/views/code_folder.php index 08718537..f538dc64 100644 --- a/codepot/src/codepot/views/code_folder.php +++ b/codepot/src/codepot/views/code_folder.php @@ -127,8 +127,9 @@ $this->load->view (
- id}/", 'id="code_folder_search_form"')?> + id}/", 'id="code_folder_search_form"')?> + lang->line('Search'), 'id="code_folder_search_submit"')?> | diff --git a/codepot/src/codepot/views/code_search.php b/codepot/src/codepot/views/code_search.php index 615db033..ff1d54aa 100644 --- a/codepot/src/codepot/views/code_search.php +++ b/codepot/src/codepot/views/code_search.php @@ -93,13 +93,13 @@ $this->load->view (
- id}/", 'id="code_search_search_form"')?> + id}/", 'id="code_search_search_form"')?> + lang->line('Search'), 'id="code_search_search_submit"')?> | lang->line('Revision')?>: -
@@ -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; }