Changeset - 291be8fa4d4f
[Not reviewed]
beta
0 2 0
Mads Kiilerich - 13 years ago 2012-12-12 18:12:18
madski@unity3d.com
Grafted from: 44b57042f4bd
rename search_recursively to search_up - that is what it is
2 files changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/vcs/backends/__init__.py
Show inline comments
 
@@ -30,7 +30,7 @@ def get_repo(path=None, alias=None, crea
 
    if path is None:
 
        path = abspath(os.path.curdir)
 
    try:
 
        scm, path = get_scm(path, search_recursively=True)
 
        scm, path = get_scm(path, search_up=True)
 
        path = abspath(path)
 
        alias = scm
 
    except VCSError:
rhodecode/lib/vcs/utils/helpers.py
Show inline comments
 
@@ -15,14 +15,14 @@ from rhodecode.lib.vcs.utils.paths impor
 
ALIASES = ['hg', 'git']
 

	
 

	
 
def get_scm(path, search_recursively=False, explicit_alias=None):
 
def get_scm(path, search_up=False, explicit_alias=None):
 
    """
 
    Returns one of alias from ``ALIASES`` (in order of precedence same as
 
    shortcuts given in ``ALIASES``) and top working dir path for the given
 
    argument. If no scm-specific directory is found or more than one scm is
 
    found at that directory, ``VCSError`` is raised.
 

	
 
    :param search_recursively: if set to ``True``, this function would try to
 
    :param search_up: if set to ``True``, this function would try to
 
      move up to parent directory every time no scm is recognized for the
 
      currently checked path. Default: ``False``.
 
    :param explicit_alias: can be one of available backend aliases, when given
 
@@ -37,7 +37,7 @@ def get_scm(path, search_recursively=Fal
 
        return [(scm, path) for scm in get_scms_for_path(path)]
 

	
 
    found_scms = get_scms(path)
 
    while  not found_scms and search_recursively:
 
    while not found_scms and search_up:
 
        newpath = abspath(path, '..')
 
        if newpath == path:
 
            break
0 comments (0 inline, 0 general)