Changeset - e4784e2b03f7
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 15 years ago 2011-04-06 20:16:02
marcin@python-works.com
strip os.sep instead of '/' in repo scanner
1 file changed with 5 insertions and 3 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/utils.py
Show inline comments
 
@@ -149,18 +149,21 @@ def get_repos(path, recursive=False):
 
    :param path: path to scann for repositories
 
    :param recursive: recursive search and return names with subdirs in front
 
    """
 
    from vcs.utils.helpers import get_scm
 
    from vcs.exceptions import VCSError
 

	
 
    if path.endswith('/'):
 
        #add ending slash for better results
 
    if path.endswith(os.sep):
 
        #remove ending slash for better results
 
        path = path[:-1]
 

	
 
    def _get_repos(p):
 
        if not os.access(p, os.W_OK):
 
            return
 
        for dirpath in os.listdir(p):
 
            print dirpath
 
            if os.path.isfile(os.path.join(p, dirpath)):
 
                continue
 
            cur_path = os.path.join(p, dirpath)
 
            try:
 
                scm_info = get_scm(cur_path)
 
                yield scm_info[1].split(path)[-1].lstrip(os.sep), scm_info
 
@@ -613,13 +616,12 @@ def create_test_env(repos_test_path, con
 
    #CREATE DEFAULT HG REPOSITORY
 
    cur_dir = dn(dn(abspath(__file__)))
 
    tar = tarfile.open(jn(cur_dir, 'tests', "vcs_test_hg.tar.gz"))
 
    tar.extractall(jn(TESTS_TMP_PATH, HG_REPO))
 
    tar.close()
 

	
 

	
 
#==============================================================================
 
# PASTER COMMANDS
 
#==============================================================================
 

	
 
class BasePasterCommand(Command):
 
    """
0 comments (0 inline, 0 general)