[Asterisk-code-review] mkrelease: Use a consistent local branch (repotools[master])

Matt Jordan asteriskteam at digium.com
Tue Jun 9 09:25:05 CDT 2015


Matt Jordan has uploaded a new change for review.

  https://gerrit.asterisk.org/612

Change subject: mkrelease: Use a consistent local branch
......................................................................

mkrelease: Use a consistent local branch

The prepare_branch function does the proper work of calculating what the
local branch should be for all future operations, even in the presence
of a prefix on the tagged version name. However, the resulting name of
the local branch was not used in later operations where the script must
switch back and forth between previous tags and the working local
branch. This patch stores the calculated branch name in the variable
'branch', and makes other operations use that branch name instead of
attempting to recalculate it themselves.

Change-Id: I904407c7f0297d2d9e6092fcbda6fc0e0201f0ac
---
M mkrelease.py
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/repotools refs/changes/12/612/1

diff --git a/mkrelease.py b/mkrelease.py
index ab1706c..b0e7f1d 100755
--- a/mkrelease.py
+++ b/mkrelease.py
@@ -49,6 +49,9 @@
 # Whether or not we should display debug information.
 debug = False
 
+# The working branch for the release
+branch = None
+
 
 class ExitException(Exception):
     """Exception raised by prompt_to_continue to stop the script"""
@@ -130,6 +133,7 @@
     Keyword Arguments:
     repo    - The prepared repo
     """
+    global branch
 
     if version_object.prefix:
         mainline = '{0}/{1}.{2}'.format(version_object.prefix,
@@ -245,7 +249,7 @@
         dprint("Copied '{0}' to '{1}'".format(change_log_path, old_log_path))
 
         # Switch back to our branch
-        repo.switch_local_branch(version[:version.rindex('.')])
+        repo.switch_local_branch(branch)
 
         # Actually create the new ChangeLog
         with open(change_log_path, 'w') as c_file:
@@ -516,7 +520,6 @@
         Keyword Arguments:
         path - The location of the extracted Asterisk release
         """
-        branch = version[:version.index('.')]
         curdir = os.getcwd()
         os.chdir(path)
         dprint("Running build_tools/prep_tarball")

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I904407c7f0297d2d9e6092fcbda6fc0e0201f0ac
Gerrit-PatchSet: 1
Gerrit-Project: repotools
Gerrit-Branch: master
Gerrit-Owner: Matt Jordan <mjordan at digium.com>



More information about the asterisk-code-review mailing list