[Asterisk-code-review] mkrelease: Ignore exception when trying to remove a branch n... (repotools[master])

Benjamin Keith Ford asteriskteam at digium.com
Thu Mar 15 15:25:38 CDT 2018


Benjamin Keith Ford has uploaded this change for review. ( https://gerrit.asterisk.org/8544


Change subject: mkrelease: Ignore exception when trying to remove a branch not in list.
......................................................................

mkrelease: Ignore exception when trying to remove a branch not in list.

When running the mkrelease script, if a branch is not found in the
list when attempting to remove it, an exception is thrown. Since we
don't care if it's not in the list (we want to remove it anyways),
ignore the exception and continue.

Change-Id: I78901a5a1a8962245e12f973c522391959d6e84e
---
M digium_git.py
1 file changed, 5 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/repotools refs/changes/44/8544/1

diff --git a/digium_git.py b/digium_git.py
index c76c953..7cd7c1e 100644
--- a/digium_git.py
+++ b/digium_git.py
@@ -292,7 +292,11 @@
         """
 
         self.deleted_branches.append(branch)
-        self.updated_branches.remove(branch)
+        try:
+            self.updated_branches.remove(branch)
+        except:
+            LOGGER.debug("Branch '{0}' not in updated_branches. "
+                         "Nothing to remove".format(branch))
         try:
             LOGGER.debug("Deleting local branch '{0}'".format(branch))
             self.repo.delete_head(branch)

-- 
To view, visit https://gerrit.asterisk.org/8544
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: repotools
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I78901a5a1a8962245e12f973c522391959d6e84e
Gerrit-Change-Number: 8544
Gerrit-PatchSet: 1
Gerrit-Owner: Benjamin Keith Ford <bford at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180315/577f2e42/attachment.html>


More information about the asterisk-code-review mailing list