Mercurial > kallithea
changeset 3091:291be8fa4d4f beta
rename search_recursively to search_up - that is what it is
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Wed, 12 Dec 2012 18:12:18 +0100 |
parents | 280ac97cb37f |
children | cd25fa6f4008 |
files | rhodecode/lib/vcs/backends/__init__.py rhodecode/lib/vcs/utils/helpers.py |
diffstat | 2 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/lib/vcs/backends/__init__.py Wed Dec 12 18:11:33 2012 +0100 +++ b/rhodecode/lib/vcs/backends/__init__.py Wed Dec 12 18:12:18 2012 +0100 @@ -30,7 +30,7 @@ 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:
--- a/rhodecode/lib/vcs/utils/helpers.py Wed Dec 12 18:11:33 2012 +0100 +++ b/rhodecode/lib/vcs/utils/helpers.py Wed Dec 12 18:12:18 2012 +0100 @@ -15,14 +15,14 @@ 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 @@ 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