phase1: support specifying repository source branch
[buildbot.git] / phase1 / master.cfg
index b9fd34ef2452ff62fd244de204e329117b6cdd5b..750763ea877193fa9e3026ad4180b2e0669cdf90 100644 (file)
@@ -59,6 +59,10 @@ if ini.has_option("general", "expire"):
        tree_expire = ini.getint("general", "expire")
 
 repo_url = ini.get("repo", "url")
+repo_branch = "master"
+
+if ini.has_option("repo", "branch"):
+       repo_branch = ini.get_option("repo", "branch")
 
 rsync_bin_url = ini.get("rsync", "binary_url")
 rsync_bin_key = ini.get("rsync", "binary_password")
@@ -89,6 +93,7 @@ targets = [ ]
 
 if not os.path.isdir(home_dir+'/source.git'):
        subprocess.call(["git", "clone", "--depth=1", repo_url, home_dir+'/source.git'])
+       subprocess.call(["git", "checkout", repo_branch], cwd = home_dir+'/source.git')
 
 findtargets = subprocess.Popen([home_dir+'/dumpinfo.pl', 'targets'],
        stdout = subprocess.PIPE, cwd = home_dir+'/source.git')