Mercurial > kallithea
changeset 2423:30589acf820e beta
Merge with latest changes
author | Vincent Duvert <vincent@duvert.net> |
---|---|
date | Wed, 06 Jun 2012 21:02:21 +0200 |
parents | 2fa7bcccf7c5 (current diff) b0d09c20f608 (diff) |
children | 2dc4cfa44b25 |
files | |
diffstat | 5 files changed, 26 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/config/routing.py Tue Jun 05 20:49:12 2012 +0200 +++ b/rhodecode/config/routing.py Wed Jun 06 21:02:21 2012 +0200 @@ -342,10 +342,17 @@ rmap.connect('public_journal', '%s/public_journal' % ADMIN_PREFIX, controller='journal', action="public_journal") - rmap.connect('public_journal_rss', '%s/public_journal_rss' % ADMIN_PREFIX, + rmap.connect('public_journal_rss', '%s/public_journal/rss' % ADMIN_PREFIX, + controller='journal', action="public_journal_rss") + + rmap.connect('public_journal_rss_old', '%s/public_journal_rss' % ADMIN_PREFIX, controller='journal', action="public_journal_rss") rmap.connect('public_journal_atom', + '%s/public_journal/atom' % ADMIN_PREFIX, controller='journal', + action="public_journal_atom") + + rmap.connect('public_journal_atom_old', '%s/public_journal_atom' % ADMIN_PREFIX, controller='journal', action="public_journal_atom")
--- a/rhodecode/controllers/journal.py Tue Jun 05 20:49:12 2012 +0200 +++ b/rhodecode/controllers/journal.py Wed Jun 06 21:02:21 2012 +0200 @@ -192,8 +192,8 @@ ttl=self.ttl) for entry in journal[:self.feed_nr]: - action, action_extra = h.action_parser(entry, feed=True) - title = "%s - %s %s" % (entry.user.short_contact, action, + action, action_extra, ico = h.action_parser(entry, feed=True) + title = "%s - %s %s" % (entry.user.short_contact, action(), entry.repository.repo_name) desc = action_extra() feed.add_item(title=title, @@ -225,8 +225,8 @@ ttl=self.ttl) for entry in journal[:self.feed_nr]: - action, action_extra = h.action_parser(entry, feed=True) - title = "%s - %s %s" % (entry.user.short_contact, action, + action, action_extra, ico = h.action_parser(entry, feed=True) + title = "%s - %s %s" % (entry.user.short_contact, action(), entry.repository.repo_name) desc = action_extra() feed.add_item(title=title,
--- a/rhodecode/lib/indexers/__init__.py Tue Jun 05 20:49:12 2012 +0200 +++ b/rhodecode/lib/indexers/__init__.py Wed Jun 06 21:02:21 2012 +0200 @@ -40,7 +40,7 @@ from whoosh.formats import Characters from whoosh.highlight import highlight, HtmlFormatter, ContextFragmenter -from webhelpers.html.builder import escape +from webhelpers.html.builder import escape, literal from sqlalchemy import engine_from_config from rhodecode.model import init_model @@ -57,6 +57,7 @@ #INDEX SCHEMA DEFINITION SCHEMA = Schema( + fileid=ID(unique=True), owner=TEXT(), repository=TEXT(stored=True), path=TEXT(stored=True), @@ -230,7 +231,7 @@ if self.search_type != 'content': return '' hl = highlight( - text=escape(content), + text=content, terms=self.highlight_items, analyzer=ANALYZER, fragmenter=FRAGMENTER,
--- a/rhodecode/lib/indexers/daemon.py Tue Jun 05 20:49:12 2012 +0200 +++ b/rhodecode/lib/indexers/daemon.py Wed Jun 06 21:02:21 2012 +0200 @@ -146,10 +146,12 @@ u_content = u'' indexed += 1 + p = safe_unicode(path) writer.add_document( + fileid=p, owner=unicode(repo.contact), repository=safe_unicode(repo_name), - path=safe_unicode(path), + path=p, content=u_content, modtime=self.get_node_mtime(node), extension=node.extension @@ -214,8 +216,11 @@ if mtime > indexed_time: # The file has changed, delete it and add it to the list of # files to reindex - log.debug('adding to reindex list %s' % indexed_path) - writer.delete_by_term('path', indexed_path) + log.debug('adding to reindex list %s mtime: %s vs %s' % ( + indexed_path, mtime, indexed_time) + ) + writer.delete_by_term('fileid', indexed_path) + to_index.add(indexed_path) except (ChangesetError, NodeDoesNotExistError): # This file was deleted since it was indexed @@ -230,6 +235,7 @@ for path in self.get_paths(repo): path = safe_unicode(path) if path in to_index or path not in indexed_paths: + # This is either a file that's changed, or a new file # that wasn't indexed before. So index it! i, iwc = self.add_doc(writer, path, repo, repo_name)
--- a/rhodecode/templates/search/search.html Tue Jun 05 20:49:12 2012 +0200 +++ b/rhodecode/templates/search/search.html Wed Jun 06 21:02:21 2012 +0200 @@ -65,7 +65,7 @@ </div> </div> ${h.end_form()} - + <div class="search"> %if c.cur_search == 'content': <%include file='search_content.html'/> %elif c.cur_search == 'path': @@ -75,6 +75,7 @@ %elif c.cur_search == 'repository': <%include file='search_repository.html'/> %endif + </div> </div> </%def>