comparison rhodecode/lib/indexers/daemon.py @ 3921:932c84e8fa92 beta

fixed #851 and #563 make-index crashes on non-ascii files
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 30 May 2013 22:37:08 +0200
parents ba08786c49ef
children d8e02de53bbc
comparison
equal deleted inserted replaced
3920:985db7f7b9b2 3921:932c84e8fa92
138 log.debug(traceback.format_exc()) 138 log.debug(traceback.format_exc())
139 pass 139 pass
140 return index_paths_ 140 return index_paths_
141 141
142 def get_node(self, repo, path): 142 def get_node(self, repo, path):
143 n_path = path[len(repo.path) + 1:] 143 """
144 gets a filenode based on given full path.It operates on string for
145 hg git compatability.
146
147 :param repo: scm repo instance
148 :param path: full path including root location
149 :return: FileNode
150 """
151 root_path = safe_str(repo.path)+'/'
152 parts = safe_str(path).partition(root_path)
144 cs = self._get_index_changeset(repo) 153 cs = self._get_index_changeset(repo)
145 node = cs.get_node(n_path) 154 node = cs.get_node(parts[-1])
146 return node 155 return node
147 156
148 def get_node_mtime(self, node): 157 def get_node_mtime(self, node):
149 return mktime(node.last_changeset.date.timetuple()) 158 return mktime(node.last_changeset.date.timetuple())
150 159