From f09af5c266dafa76b0147e7868b94b58facf8b18 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Sat, 25 Jul 2015 18:42:30 -0400 Subject: [PATCH] Fine-grained force_switch to branch. We cannot force every time because of previous_gdb.sum --- lib/gdbcommand.py | 4 ++-- lib/gdbgitdb.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/gdbcommand.py b/lib/gdbcommand.py index ab5a837..ab6911e 100644 --- a/lib/gdbcommand.py +++ b/lib/gdbcommand.py @@ -30,7 +30,7 @@ class CopyOldGDBSumFile (ShellCommand): return SUCCESS # Switch to the right branch inside the BUILDER repo - switch_to_branch (builder, branch) + switch_to_branch (builder, branch, force_switch = True) try: copyfile ("%s/%s/gdb.sum" % (wb, builder), @@ -57,7 +57,7 @@ class GdbCatSumfileCommand(ShellCommand): branch = 'master' # Switch to the right branch inside the BUILDER repo - switch_to_branch (builder, branch) + switch_to_branch (builder, branch, force_switch = False) parser = DejaResults() cur_results = parser.read_sum_text(self.getLog('stdio').getText()) diff --git a/lib/gdbgitdb.py b/lib/gdbgitdb.py index 273f054..46ea086 100644 --- a/lib/gdbgitdb.py +++ b/lib/gdbgitdb.py @@ -23,7 +23,7 @@ log files of the COMMIT that was tested.""" return None -def switch_to_branch (builder, branch): +def switch_to_branch (builder, branch, force_switch = False): """Switch (or create) to BRANCH on BUILDER repo.""" repodir = os.path.join (get_web_base (), builder) repo = git.Repo.init (path = repodir) @@ -42,7 +42,7 @@ def switch_to_branch (builder, branch): else: myhead = repo.heads[branch] - myhead.checkout (force = True) + myhead.checkout (force = force_switch) class SaveGDBResults (ShellCommand): name = 'save build results'