def invokeGit(self, workspace, scm): spec = MagicMock(workspaceWorkspacePath=workspace, envWhiteList=set()) invoker = Invoker(spec, False, True, True, True, True, False) run(scm.invoke(invoker)) log = subprocess.check_output( ["git", "log", "--oneline"], cwd=workspace, universal_newlines=True).strip().split("\n") branches = subprocess.check_output( ["git", "branch", "-r"], cwd=workspace, universal_newlines=True).strip().split("\n") branches = set(b.strip() for b in branches) return (len(log), branches)
def invokeScm(self, workspace, scm): spec = MagicMock(workspaceWorkspacePath=workspace, envWhiteList=set()) invoker = Invoker(spec, False, True, True, True, True, False) run(scm.invoke(invoker))