Lines Matching refs:dir_path
226 def get_svn_info(dir_path):
228 if not os.path.isdir(dir_path):
230 out = capture(['svn', 'info', '.', '--non-interactive'], dir_path)
234 def get_svn_url(dir_path):
235 return get_svn_info(dir_path).get('URL')
238 def get_svn_root(dir_path):
240 svn_url = get_svn_url(dir_path)
245 parent = os.path.dirname(dir_path)
246 if parent == dir_path:
250 return dir_path
251 dir_path = parent
254 def get_git_root(dir_path):
256 root = capture(['git', 'rev-parse', '--show-toplevel'], dir_path).strip()
460 def get_scm(dir_path, bare):
463 root = get_svn_root(dir_path or cwd)
467 return ApiSvnQuick(dir_path or root, bare)
468 root = get_git_root(dir_path or cwd)
472 return ApiGit(dir_path or root, bare)
476 print('Failed to determine the SCM for %s' % dir_path)
477 return ApiBase(dir_path or cwd, bare)