[Asterisk-code-review] mkrelease.py: Remove staging changes code. (...repotools[master])

Benjamin Keith Ford asteriskteam at digium.com
Fri May 24 08:34:58 CDT 2019


Benjamin Keith Ford has uploaded this change for review. ( https://gerrit.asterisk.org/c/repotools/+/11408


Change subject: mkrelease.py: Remove staging changes code.
......................................................................

mkrelease.py: Remove staging changes code.

This removes the staging changes code from the mkrelease script, since
issues were popping up when dealing with files. The CHANGES /
UPGRADE.txt files would not be updated, and files removed during this
were not added to the commit. The script itself (process-staging-changes
and commit-staging-changes) works fine, both utilizing
staging_changes.py. For whatever reason, the conflict is
staging_changes.py being used during mkrelease.py. An issue will be
created to look into this further. For now, the manual scripts work, so
use those.

Also includes a couple other minor changes, such as correcting a typo
and using 'git rm' instead of os.remove, as combuilder doesn't seem to
like the latter.

Change-Id: Ib4d96ab5930a41c15201d5874f377aba8eb9a803
---
M digium_git.py
M mkrelease.py
M staging_changes.py
3 files changed, 5 insertions(+), 21 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/repotools refs/changes/08/11408/1

diff --git a/digium_git.py b/digium_git.py
index 3ac01ef..bbf1463 100644
--- a/digium_git.py
+++ b/digium_git.py
@@ -543,11 +543,13 @@
     def add_and_commit_all_unstaged(self, commit_msg):
         """Add and commit all unstaged changes
 
+        Note that this does include deleted files when done via mkrelease.
+
         Keyword Arguments:
         commit_msg - Out commit message for the changes
         """
 
-        LOGGER.debug("Adding and commit all unstaged changes to branch {0}"
+        LOGGER.debug("Adding and committing all unstaged changes to branch {0}"
                      .format(self.current_branch))
 
         files = self.repo.index.diff(None)
diff --git a/mkrelease.py b/mkrelease.py
index 9705802..6826c10 100755
--- a/mkrelease.py
+++ b/mkrelease.py
@@ -152,24 +152,6 @@
     # need to be created off of that anyways
     repo.checkout(mainline)
 
-    # Only update CHANGES and UPGRADE.txt if this is a full release (not beta,
-    # rc, etc.) for the Asterisk project
-    if len(version_object.modifiers) == 0 and project == 'asterisk':
-        s_version = version_object.get_previous_version()
-        start = "{0}.{1}.{2}".format(s_version.major, s_version.minor,
-                                     s_version.patch)
-        end = "{0}.{1}.{2}".format(version_object.major, version_object.minor,
-                                   version_object.patch)
-
-        sce = StagingChangesExtractor(options.local_root, start, end)
-        ret = sce.run()
-        if ret is not 0:
-            LOGGER.error("Failed to prepare staging changes")
-            sys.exit(1)
-
-        repo.add_and_commit_all_unstaged("Update CHANGES and UPGRADE.txt for {0}"
-                                         .format(version))
-
     repo.checkout(branch)
 
 def extract_tags(options, repo):
diff --git a/staging_changes.py b/staging_changes.py
index 8eceb48..f471e7d 100644
--- a/staging_changes.py
+++ b/staging_changes.py
@@ -195,9 +195,9 @@
             for sub in subjects:
                 self.add_data(sub, message, timestamp)
         # Once we are done with the file, remove it from the staging directory.
-        # We don't need it anymore.
+        # We don't need it anymore. Must be done with 'git rm' for combuilder.
         LOGGER.debug("Removing file {0}".format(filename))
-        os.remove(os.path.join(staging_path, filename))
+        os.popen("(cd {0} && git rm {1})".format(self.ast_path, os.path.join(staging_path, filename)))
         return 0
 
     def get_staging_changes(self, mode):

-- 
To view, visit https://gerrit.asterisk.org/c/repotools/+/11408
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

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


More information about the asterisk-code-review mailing list