[Libreoffice-commits] dev-tools.git: ciabot/libreoffice-bugzilla2.py

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Mar 8 07:57:28 UTC 2019


 ciabot/libreoffice-bugzilla2.py |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit d979d3d34f5b3007f34f3fc664377af4921a1bb2
Author:     Shubham Goyal <22shubh22 at gmail.com>
AuthorDate: Fri Mar 8 13:19:51 2019 +0530
Commit:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Fri Mar 8 08:57:11 2019 +0100

    Code optimization in dev-tools/ciabot
    
    Previously the get_commit() func was called twice, now with one call,
    the program works as it is.
    
    Change-Id: I3f4ec4d2d94d9c86b1dc8879539a7dbfb3895327
    Reviewed-on: https://gerrit.libreoffice.org/67897
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/ciabot/libreoffice-bugzilla2.py b/ciabot/libreoffice-bugzilla2.py
index f08e42b..626a7d6 100644
--- a/ciabot/libreoffice-bugzilla2.py
+++ b/ciabot/libreoffice-bugzilla2.py
@@ -167,15 +167,14 @@ def get_commit(repo, commit_id):
     commit = repo.commit(commit_id)
     return commit
 
-def find_bugid(repo, commit_id):
-    commit = get_commit(repo, commit_id)
+def find_bugid(commit):
     summary_line = commit.summary
     regex = re.compile(bug_regex)
     m = regex.findall(summary_line)
     if m is None or len(m) == 0:
         print("no bugid found")
         sys.exit()
-    
+
     return m
 
 def read_repo(repo_name):
@@ -220,10 +219,10 @@ def main(argv):
 
     target_version = find_target_version(repo, branch)
 
-    bug_ids = find_bugid(repo, commit_id)
-    
     commit = get_commit(repo, commit_id)
 
+    bug_ids = find_bugid(commit)
+
     if target_version is None:
         print("missing target version")
         print(opts)


More information about the Libreoffice-commits mailing list