@@ -161,26 +161,30 @@ class WhooshIndexingDaemon(object):
cs = self._get_index_changeset(repo, index_rev=index_rev)
node = cs.get_node(node_path)
return node
def get_node_mtime(self, node):
return mktime(node.last_changeset.date.timetuple())
def add_doc(self, writer, path, repo, repo_name, index_rev=None):
"""
Adding doc to writer this function itself fetches data from
the instance of vcs backend
try:
node = self.get_node(repo, path, index_rev)
except (ChangesetError, NodeDoesNotExistError):
log.debug("couldn't add doc - %s did not have %r at %s", repo, path, index_rev)
return 0, 0
indexed = indexed_w_content = 0
# we just index the content of chosen files, and skip binary files
if node.extension in INDEX_EXTENSIONS and not node.is_binary:
u_content = node.content
if not isinstance(u_content, unicode):
log.warning(' >> %s Could not get this content as unicode '
'replacing with empty content' % path)
u_content = u''
else:
log.debug(' >> %s [WITH CONTENT]', path)
indexed_w_content += 1
Status change: