Mercurial > kallithea
comparison rhodecode/lib/indexers/__init__.py @ 2718:82fb2a161ddf beta
fixes issue #524
- fixed search by filename
- added missing test for this search
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 16 Aug 2012 11:05:04 +0200 |
parents | 66c778b8cb54 |
children | 63e58ef80ef1 a08624dd675e |
comparison
equal
deleted
inserted
replaced
2717:dd240b2b7a12 | 2718:82fb2a161ddf |
---|---|
86 removed=TEXT(), | 86 removed=TEXT(), |
87 changed=TEXT(), | 87 changed=TEXT(), |
88 ) | 88 ) |
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 |
95 min_args = 1 | 96 min_args = 1 |
216 content_short = self.get_short_content(res, docid[1]) | 217 content_short = self.get_short_content(res, docid[1]) |
217 res.update({'content_short': content_short, | 218 res.update({'content_short': content_short, |
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 |
224 log.debug('result: %s' % res) | 230 log.debug('result: %s' % res) |
225 | 231 |