Skip to content

Commit

Permalink
Builder: Added a --branch option for autobuild.py
Browse files Browse the repository at this point in the history
Specifies which branch to use for building.
  • Loading branch information
skyjake committed Mar 14, 2012
1 parent 9ea1220 commit ec752cf
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions distrib/autobuild.py
Expand Up @@ -84,7 +84,7 @@ def todays_platform_release():
remote_copy('dsfmod/fmod-out-%s.txt' % sys_id(), ev.file_path('fmod-out-%s.txt' % sys_id()))
remote_copy('dsfmod/fmod-err-%s.txt' % sys_id(), ev.file_path('fmod-err-%s.txt' % sys_id()))

git_checkout('master')
git_checkout(builder.config.BRANCH)


def update_changes(fromTag=None, toTag=None, debChanges=False):
Expand All @@ -94,7 +94,7 @@ def update_changes(fromTag=None, toTag=None, debChanges=False):
# Make sure we have the latest changes.
git_pull()
fromTag = aptrepo_find_latest_tag()
toTag = 'master' # Everything up to now.
toTag = builder.config.BRANCH # Everything up to now.
else:
# Use the two most recent builds by default.
if fromTag is None or toTag is None:
Expand Down
6 changes: 3 additions & 3 deletions distrib/builder/changes.py
Expand Up @@ -74,8 +74,8 @@ def __init__(self, fromTag, toTag):
self.parse()

def should_ignore(self, subject):
if subject.startswith("Merge branch 'master' of"):
# master->master merges are not listed.
if subject.startswith("Merge branch '%s' of" % config.BRANCH):
# Same-branch merges are not listed.
return True
return False

Expand Down Expand Up @@ -144,7 +144,7 @@ def parse(self):

def all_tags(self):
# These words are always considered to be valid tags.
tags = ['Cleanup', 'Fixed', 'Added', 'Refactor', 'Performance', 'Optimize', 'merge branch']
tags = ['Cleanup', 'Fixed', 'Added', 'Refactor', 'Performance', 'Optimize', 'Merge branch']
for e in self.entries:
for t in e.tags + e.guessedTags:
if t not in tags:
Expand Down
4 changes: 4 additions & 0 deletions distrib/builder/config.py
Expand Up @@ -18,6 +18,7 @@ def get_arg(label):
DISTRIB_DIR = '.'
APT_REPO_DIR = ''
TAG_MODIFIER = ''
BRANCH = 'master'

val = get_arg('--distrib')
if val is not None: DISTRIB_DIR = val
Expand All @@ -28,6 +29,9 @@ def get_arg(label):
val = get_arg('--apt')
if val is not None: APT_REPO_DIR = val

val = get_arg('--branch')
if val is not None: BRANCH = val

val = get_arg('--tagmod')
if val is not None: TAG_MODIFIER = val

Expand Down
4 changes: 2 additions & 2 deletions distrib/builder/git.py
Expand Up @@ -18,9 +18,9 @@ def git_checkout(ident):

def git_pull():
"""Updates the source with a git pull."""
print 'Updating source...'
print 'Updating source from branch %s...' % builder.config.BRANCH
os.chdir(builder.config.DISTRIB_DIR)
run_git("git checkout master")
run_git("git checkout " + builder.config.BRANCH)
run_git("git pull")


Expand Down
2 changes: 1 addition & 1 deletion distrib/builder/utils.py
Expand Up @@ -101,7 +101,7 @@ def aptrepo_by_time():

def aptrepo_find_latest_tag():
debs = aptrepo_by_time()
if not debs: return 'master'
if not debs: return config.BRANCH
arch = deb_arch()
biggest = 0
for deb in debs:
Expand Down

0 comments on commit ec752cf

Please sign in to comment.