Changeset - 3b0255d936c8
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 14 years ago 2012-02-01 23:31:16
marcin@python-works.com
fixed exception in rhodecode_crawler
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/tests/rhodecode_crawler.py
Show inline comments
 
@@ -94,39 +94,40 @@ def test_changeset_walk(limit=None):
 

	
 
    print 'total_time', total_time
 
    print 'average on req', total_time / float(cnt)
 

	
 

	
 
def test_files_walk(limit=100):
 
    print 'processing', jn(PROJECT_PATH, PROJECT)
 
    total_time = 0
 

	
 
    repo = vcs.get_repo(jn(PROJECT_PATH, PROJECT))
 

	
 
    from rhodecode.lib.compat import OrderedSet
 
    from vcs.exceptions import RepositoryError
 

	
 
    paths_ = OrderedSet([''])
 
    try:
 
        tip = repo.get_changeset('tip')
 
        for topnode, dirs, files in tip.walk('/'):
 

	
 
            for dir in dirs:
 
                paths_.add(dir.path)
 
                for f in dir:
 
                    paths_.add(f.path)
 

	
 
            for f in files:
 
                paths_.add(f.path)
 

	
 
    except vcs.exception.RepositoryError, e:
 
    except RepositoryError, e:
 
        pass
 

	
 
    cnt = 0
 
    for f in paths_:
 
        cnt += 1
 
        if limit and limit == cnt:
 
            break
 

	
 
        file_path = '/'.join((PROJECT, 'files', 'tip', f))
 

	
 
        full_uri = (BASE_URI % file_path)
 
        s = time.time()
0 comments (0 inline, 0 general)