Changeset - a1841a3cf03b
[Not reviewed]
default
0 1 0
Mads Kiilerich - 11 years ago 2014-08-12 13:08:23
madski@unity3d.com
indexer: rework get_node to handle alternative path element separators

Problem seen on Windows by Dominik Ruf.
1 file changed with 9 insertions and 5 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/indexers/daemon.py
Show inline comments
 
@@ -146,17 +146,21 @@ class WhooshIndexingDaemon(object):
 

	
 
    def get_node(self, repo, path, index_rev=None):
 
        """
 
        gets a filenode based on given full path.It operates on string for
 
        hg git compatability.
 
        gets a filenode based on given full path. It operates on string for
 
        hg git compatibility.
 

	
 
        :param repo: scm repo instance
 
        :param path: full path including root location
 
        :return: FileNode
 
        """
 
        root_path = safe_str(repo.path)+'/'
 
        parts = safe_str(path).partition(root_path)
 
        # FIXME: paths should be normalized ... or even better: don't include repo.path
 
        path = safe_str(path)
 
        repo_path = safe_str(repo.path)
 
        assert path.startswith(repo_path)
 
        assert path[len(repo_path)] in (os.path.sep, os.path.altsep)
 
        node_path = path[len(repo_path) + 1:]
 
        cs = self._get_index_changeset(repo, index_rev=index_rev)
 
        node = cs.get_node(parts[-1])
 
        node = cs.get_node(node_path)
 
        return node
 

	
 
    def get_node_mtime(self, node):
0 comments (0 inline, 0 general)