From 726843d4f45d2a7247d3e5ed54f0b5df88c655ed Mon Sep 17 00:00:00 2001 From: Casey Dahlin Date: Fri, 25 Jun 2010 21:13:53 -0400 Subject: Add filtering so we only check out branches we want with clone --branches --- src/pyfedpkg/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py index 075608c..5c48d67 100644 --- a/src/pyfedpkg/__init__.py +++ b/src/pyfedpkg/__init__.py @@ -11,7 +11,7 @@ import os import shutil -#import pycurl +import re import subprocess import hashlib import koji @@ -25,6 +25,7 @@ LOOKASIDE = 'http://cvs.fedoraproject.org/repo/pkgs' LOOKASIDEHASH = 'md5' GITBASEURL = 'ssh://%(user)s@pkgs.stg.fedoraproject.org/%(module)s' ANONGITURL = 'git://pkgs.stg.fedoraproject.org/%(module)s' +BRANCHFILTER = 'FC?-\d\d?|master' # Define our own error class class FedpkgError(Exception): @@ -212,7 +213,8 @@ def clone_with_dirs(module, user, path=os.getcwd()): repo_git = git.Git(repo_path) # Get a branch listing - branches = [x for x in repo_git.branch().split() if x != "*"] + branches = [x for x in repo_git.branch().split() if x != "*" and + re.match(BRANCHFILTER, x)] for branch in branches: try: -- cgit