Lines Matching refs:dir_path
229 def get_svn_info(dir_path):
231 if not os.path.isdir(dir_path):
233 out = capture(['svn', 'info', '.', '--non-interactive'], dir_path)
237 def get_svn_url(dir_path):
238 return get_svn_info(dir_path).get('URL')
241 def get_svn_root(dir_path):
243 svn_url = get_svn_url(dir_path)
248 parent = os.path.dirname(dir_path)
249 if parent == dir_path:
253 return dir_path
254 dir_path = parent
257 def get_git_root(dir_path):
259 root = capture(['git', 'rev-parse', '--show-toplevel'], dir_path).strip()
455 def get_scm(dir_path, bare):
458 root = get_svn_root(dir_path or cwd)
462 return ApiSvnQuick(dir_path or root, bare)
463 root = get_git_root(dir_path or cwd)
467 return ApiGit(dir_path or root, bare)
471 print('Failed to determine the SCM for %s' % dir_path)
472 return ApiBase(dir_path or cwd, bare)