def run_vcs_tool(path, action):
 info = get_vcs_info(get_vcs_root(path))
 tools = info['actions'][action]
 for (tool, args) in tools:
  if programs.find_program(tool):
   programs.run_program(tool, args, cwd=path)
   return
 else:
  cmdnames = [name for (name, args) in tools]
  raise ActionToolNotFound(info['name'], action, cmdnames)

def run_vcs_tool ( path , action ) : info = get_vcs_info ( get_vcs_root ( path ) ) tools = info [ 'actions' ] [ action ] for ( tool , args ) in tools : if programs . find_program ( tool ) : programs . run_program ( tool , args , cwd = path ) return else : cmdnames = [ name for ( name , args ) in tools ] raise ActionToolNotFound ( info [ 'name' ] , action , cmdnames )
if path is a valid vcs repository .