##// END OF EJS Templates
fixes issue #524...
marcink -
r2718:82fb2a16 beta
parent child Browse files
Show More
@@ -89,6 +89,7 b' CHGSETS_SCHEMA = Schema('
89
89
90 CHGSET_IDX_NAME = 'CHGSET_INDEX'
90 CHGSET_IDX_NAME = 'CHGSET_INDEX'
91
91
92
92 class MakeIndex(BasePasterCommand):
93 class MakeIndex(BasePasterCommand):
93
94
94 max_args = 1
95 max_args = 1
@@ -218,6 +219,11 b' class WhooshResultWrapper(object):'
218 'content_short_hl': self.highlight(content_short),
219 'content_short_hl': self.highlight(content_short),
219 'f_path': f_path
220 'f_path': f_path
220 })
221 })
222 elif self.search_type == 'path':
223 full_repo_path = jn(self.repo_location, res['repository'])
224 f_path = res['path'].split(full_repo_path)[-1]
225 f_path = f_path.lstrip(os.sep)
226 res.update({'f_path': f_path})
221 elif self.search_type == 'message':
227 elif self.search_type == 'message':
222 res.update({'message_hl': self.highlight(res['message'])})
228 res.update({'message_hl': self.highlight(res['message'])})
223
229
@@ -90,3 +90,10 b' class TestSearchController(TestControlle'
90 'type': 'commit'})
90 'type': 'commit'})
91
91
92 response.mustcontain('1 results')
92 response.mustcontain('1 results')
93
94 def test_search_file_name(self):
95 self.log_user()
96 response = self.app.get(url(controller='search', action='index'),
97 {'q': 'README.rst', 'type': 'path'})
98
99 response.mustcontain('2 results') No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now