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

George Joseph asteriskteam at digium.com
Fri Mar 16 07:35:54 CDT 2018


George Joseph has submitted this change and it was merged. ( 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(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve; Verified
  George Joseph: Looks good to me, approved; Approved for Submit



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: merged
Gerrit-Change-Id: I78901a5a1a8962245e12f973c522391959d6e84e
Gerrit-Change-Number: 8544
Gerrit-PatchSet: 1
Gerrit-Owner: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180316/5d024378/attachment.html>


More information about the asterisk-code-review mailing list