]> git.apps.os.sepia.ceph.com Git - autobuild-ceph.git/commitdiff
branches-local: filter branches by list in 'filter-branches', if it exists wip-filter 58/head
authorSage Weil <sage@redhat.com>
Mon, 10 Aug 2015 13:13:24 +0000 (09:13 -0400)
committerSage Weil <sage@redhat.com>
Mon, 10 Aug 2015 13:13:24 +0000 (09:13 -0400)
If it doesn't exist, behave as before.

Signed-off-by: Sage Weil <sage@redhat.com>
branches-local

index fb90cd4bb9178dc82c097dc88c0c0589788f1db6..6dc2b0fc0decf3db0d1108654fee0a890995bd67 100755 (executable)
@@ -437,10 +437,20 @@ def separate_priority_branches(branches):
     ignore = ['origin/{0}'.format(b) for b in IGNORE]
     ignore_prefix = ['origin/{0}'.format(b) for b in IGNORE_PREFIX]
 
+    require = []
+    try:
+        f = open('/srv/autobuild-ceph/filter-branches')
+        require = f.read().splitlines()
+    except:
+        pass
+
     priority = []
     normal = []
 
     for obj, ref in branches:
+        if require and not any(str in ref for str in require):
+            continue
+
         if ref in prioritize:
             priority.append((obj, ref))
             continue