From c2dc59357ae0a2f2bbffde36c8e1463f0fe97aa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= Date: Tue, 17 Feb 2015 10:46:16 +0000 Subject: [PATCH] scripts/tools/rrs_upgrade_history.py: Fix branch deletion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add try/catch to branch deletion because at initial loop the branch don't exist. Signed-off-by: Aníbal Limón --- scripts/tools/rrs_upgrade_history.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/tools/rrs_upgrade_history.py b/scripts/tools/rrs_upgrade_history.py index 30e988b..9594873 100755 --- a/scripts/tools/rrs_upgrade_history.py +++ b/scripts/tools/rrs_upgrade_history.py @@ -222,7 +222,10 @@ def upgrade_history(logger): datestr = date.strftime("%Y-%m-%d") date_next = date + timedelta(days=1) date_nextstr = date_next.strftime("%Y-%m-%d") - utils.runcmd("git branch -D " + datestr + " &> /dev/null", repodir) + try: + utils.runcmd("git branch -D " + datestr + " &> /dev/null", repodir) + except: + pass utils.runcmd("git checkout -b " + datestr, repodir) # Get commits for the current day