Changeset - 30589acf820e
[Not reviewed]
Merge beta
0 5 0
Vincent Duvert - 13 years ago 2012-06-06 21:02:21
vincent@duvert.net
Merge with latest changes
5 files changed with 26 insertions and 11 deletions:
0 comments (0 inline, 0 general)
rhodecode/config/routing.py
Show inline comments
 
@@ -342,10 +342,17 @@ def make_map(config):
 
    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")
 

	
rhodecode/controllers/journal.py
Show inline comments
 
@@ -192,8 +192,8 @@ class JournalController(BaseController):
 
                         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 @@ class JournalController(BaseController):
 
                         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,
rhodecode/lib/indexers/__init__.py
Show inline comments
 
@@ -40,7 +40,7 @@ from whoosh.index import create_in, open
 
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 @@ ANALYZER = RegexTokenizer(expression=r"\
 

	
 
#INDEX SCHEMA DEFINITION
 
SCHEMA = Schema(
 
    fileid=ID(unique=True),
 
    owner=TEXT(),
 
    repository=TEXT(stored=True),
 
    path=TEXT(stored=True),
 
@@ -230,7 +231,7 @@ class WhooshResultWrapper(object):
 
        if self.search_type != 'content':
 
            return ''
 
        hl = highlight(
 
            text=escape(content),
 
            text=content,
 
            terms=self.highlight_items,
 
            analyzer=ANALYZER,
 
            fragmenter=FRAGMENTER,
rhodecode/lib/indexers/daemon.py
Show inline comments
 
@@ -146,10 +146,12 @@ class WhooshIndexingDaemon(object):
 
            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 @@ class WhooshIndexingDaemon(object):
 
                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 @@ class WhooshIndexingDaemon(object):
 
            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)
rhodecode/templates/search/search.html
Show inline comments
 
@@ -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>
0 comments (0 inline, 0 general)