You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2013/12/20 00:55:33 UTC

git commit: Allow filterting contributors by release version.

Updated Branches:
  refs/heads/trunk 5613f0f77 -> f75780f13


Allow filterting contributors by release version.


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/f75780f1
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/f75780f1
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/f75780f1

Branch: refs/heads/trunk
Commit: f75780f13cbffb992d1bfab7286492201e2a59aa
Parents: 5613f0f
Author: Tomaz Muraus <to...@apache.org>
Authored: Fri Dec 20 00:41:54 2013 +0100
Committer: Tomaz Muraus <to...@apache.org>
Committed: Fri Dec 20 00:41:54 2013 +0100

----------------------------------------------------------------------
 contrib/generate_contributor_list.py | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/f75780f1/contrib/generate_contributor_list.py
----------------------------------------------------------------------
diff --git a/contrib/generate_contributor_list.py b/contrib/generate_contributor_list.py
index 324da1c..63a7f01 100755
--- a/contrib/generate_contributor_list.py
+++ b/contrib/generate_contributor_list.py
@@ -30,7 +30,7 @@ JIRA_URL = 'https://issues.apache.org/jira/browse/LIBCLOUD-%s'
 GITHUB_URL = 'https://github.com/apache/libcloud/pull/%s'
 
 
-def parse_changes_file(file_path):
+def parse_changes_file(file_path, version=None):
     """
     Parse CHANGES file and return a dictionary with contributors.
 
@@ -41,12 +41,22 @@ def parse_changes_file(file_path):
     contributors_map = defaultdict(set)
 
     in_entry = False
+    active_version = None
     active_tickets = []
 
     with open(file_path, 'r') as fp:
         for line in fp:
             line = line.strip()
 
+            match = re.search(r'Changes with Apache Libcloud '
+                              '(\d+\.\d+\.\d+(-\w+)?).*?$', line)
+
+            if match:
+                active_version = match.groups()[0]
+
+            if version and active_version != version:
+                continue
+
             if line.startswith('-') or line.startswith('*)'):
                 in_entry = True
                 active_tickets = []
@@ -124,9 +134,13 @@ if __name__ == '__main__':
                                                  ' in a single image')
     parser.add_argument('--changes-path', action='store',
                         help='Path to the changes file')
+    parser.add_argument('--version', action='store',
+                        help='Only return contributors for the provided '
+                             'version')
     args = parser.parse_args()
 
-    contributors_map = parse_changes_file(file_path=args.changes_path)
+    contributors_map = parse_changes_file(file_path=args.changes_path,
+                                          version=args.version)
     markdown = convert_to_markdown(contributors_map=contributors_map)
 
     print(markdown)