<p>Benjamin Keith Ford has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/repotools/+/11408">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">mkrelease.py: Remove staging changes code.<br><br>This removes the staging changes code from the mkrelease script, since<br>issues were popping up when dealing with files. The CHANGES /<br>UPGRADE.txt files would not be updated, and files removed during this<br>were not added to the commit. The script itself (process-staging-changes<br>and commit-staging-changes) works fine, both utilizing<br>staging_changes.py. For whatever reason, the conflict is<br>staging_changes.py being used during mkrelease.py. An issue will be<br>created to look into this further. For now, the manual scripts work, so<br>use those.<br><br>Also includes a couple other minor changes, such as correcting a typo<br>and using 'git rm' instead of os.remove, as combuilder doesn't seem to<br>like the latter.<br><br>Change-Id: Ib4d96ab5930a41c15201d5874f377aba8eb9a803<br>---<br>M digium_git.py<br>M mkrelease.py<br>M staging_changes.py<br>3 files changed, 5 insertions(+), 21 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/repotools refs/changes/08/11408/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/digium_git.py b/digium_git.py</span><br><span>index 3ac01ef..bbf1463 100644</span><br><span>--- a/digium_git.py</span><br><span>+++ b/digium_git.py</span><br><span>@@ -543,11 +543,13 @@</span><br><span>     def add_and_commit_all_unstaged(self, commit_msg):</span><br><span>         """Add and commit all unstaged changes</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+        Note that this does include deleted files when done via mkrelease.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>         Keyword Arguments:</span><br><span>         commit_msg - Out commit message for the changes</span><br><span>         """</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-        LOGGER.debug("Adding and commit all unstaged changes to branch {0}"</span><br><span style="color: hsl(120, 100%, 40%);">+        LOGGER.debug("Adding and committing all unstaged changes to branch {0}"</span><br><span>                      .format(self.current_branch))</span><br><span> </span><br><span>         files = self.repo.index.diff(None)</span><br><span>diff --git a/mkrelease.py b/mkrelease.py</span><br><span>index 9705802..6826c10 100755</span><br><span>--- a/mkrelease.py</span><br><span>+++ b/mkrelease.py</span><br><span>@@ -152,24 +152,6 @@</span><br><span>     # need to be created off of that anyways</span><br><span>     repo.checkout(mainline)</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-    # Only update CHANGES and UPGRADE.txt if this is a full release (not beta,</span><br><span style="color: hsl(0, 100%, 40%);">-    # rc, etc.) for the Asterisk project</span><br><span style="color: hsl(0, 100%, 40%);">-    if len(version_object.modifiers) == 0 and project == 'asterisk':</span><br><span style="color: hsl(0, 100%, 40%);">-        s_version = version_object.get_previous_version()</span><br><span style="color: hsl(0, 100%, 40%);">-        start = "{0}.{1}.{2}".format(s_version.major, s_version.minor,</span><br><span style="color: hsl(0, 100%, 40%);">-                                     s_version.patch)</span><br><span style="color: hsl(0, 100%, 40%);">-        end = "{0}.{1}.{2}".format(version_object.major, version_object.minor,</span><br><span style="color: hsl(0, 100%, 40%);">-                                   version_object.patch)</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-        sce = StagingChangesExtractor(options.local_root, start, end)</span><br><span style="color: hsl(0, 100%, 40%);">-        ret = sce.run()</span><br><span style="color: hsl(0, 100%, 40%);">-        if ret is not 0:</span><br><span style="color: hsl(0, 100%, 40%);">-            LOGGER.error("Failed to prepare staging changes")</span><br><span style="color: hsl(0, 100%, 40%);">-            sys.exit(1)</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-        repo.add_and_commit_all_unstaged("Update CHANGES and UPGRADE.txt for {0}"</span><br><span style="color: hsl(0, 100%, 40%);">-                                         .format(version))</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>     repo.checkout(branch)</span><br><span> </span><br><span> def extract_tags(options, repo):</span><br><span>diff --git a/staging_changes.py b/staging_changes.py</span><br><span>index 8eceb48..f471e7d 100644</span><br><span>--- a/staging_changes.py</span><br><span>+++ b/staging_changes.py</span><br><span>@@ -195,9 +195,9 @@</span><br><span>             for sub in subjects:</span><br><span>                 self.add_data(sub, message, timestamp)</span><br><span>         # Once we are done with the file, remove it from the staging directory.</span><br><span style="color: hsl(0, 100%, 40%);">-        # We don't need it anymore.</span><br><span style="color: hsl(120, 100%, 40%);">+        # We don't need it anymore. Must be done with 'git rm' for combuilder.</span><br><span>         LOGGER.debug("Removing file {0}".format(filename))</span><br><span style="color: hsl(0, 100%, 40%);">-        os.remove(os.path.join(staging_path, filename))</span><br><span style="color: hsl(120, 100%, 40%);">+        os.popen("(cd {0} && git rm {1})".format(self.ast_path, os.path.join(staging_path, filename)))</span><br><span>         return 0</span><br><span> </span><br><span>     def get_staging_changes(self, mode):</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/repotools/+/11408">change 11408</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/repotools/+/11408"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: repotools </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ib4d96ab5930a41c15201d5874f377aba8eb9a803 </div>
<div style="display:none"> Gerrit-Change-Number: 11408 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>