Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/extensions/bin/createNightlies.py

Issue 29358368: Issue 4540 - Add Platform Specific Branch Support to createNightlies.py (Closed)
Patch Set: Created Oct. 20, 2016, 7:51 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/extensions/bin/createNightlies.py
===================================================================
--- a/sitescripts/extensions/bin/createNightlies.py
+++ b/sitescripts/extensions/bin/createNightlies.py
@@ -60,16 +60,22 @@
"""
def __init__(self, config):
"""
Creates a NightlyBuild instance; we are simply
recording the configuration settings here.
"""
self.config = config
+ try:
+ self.branch = self.config.get('extensions', 'abp_{}_branch'.format(
Vasily Kuznetsov 2016/10/20 16:54:39 As we discussed, `xxx_branch` seems nicer than `ab
kzar 2016/10/21 08:17:19 u1. I think bookmark is a better word to use than
+ self.config.type))
Jon Sonesen 2016/10/20 07:55:54 Not sure exactly how you want to implement the con
+ except ConfigParser.NoOptionError:
+ self.branch = 'master'
+
self.revision = self.getCurrentRevision()
try:
self.previousRevision = config.latestRevision
except:
self.previousRevision = '0'
self.buildNum = None
self.tempdir = None
self.outputFilename = None
@@ -78,53 +84,56 @@
def hasChanges(self):
return self.revision != self.previousRevision
def getCurrentRevision(self):
"""
retrieves the current revision ID from the repository
"""
command = [
- 'hg', 'id', '-i', '-r', 'default', '--config', 'defaults.id=',
- self.config.repository
+ 'hg', 'id', '-i', '-r', 'default', '-b', self.branch, '--config',
Vasily Kuznetsov 2016/10/20 16:54:39 If I understand correctly it should be '-r', self.
Sebastian Noack 2016/10/20 17:36:16 As far as I understand, if we want to use bookmark
kzar 2016/10/21 08:17:19 I think that's correct, from the issue description
+ 'defaults.id=', self.config.repository
]
return subprocess.check_output(command).strip()
def getCurrentBuild(self):
"""
calculates the (typically numerical) build ID for the current build
"""
- command = ['hg', 'id', '-n', '--config', 'defaults.id=', self.tempdir]
+ command = [
+ 'hg', 'id', '-b', self.branch, '-n', '--config', 'defaults.id=',
kzar 2016/10/21 08:17:19 Again this should be `'-r', self.bookmark`, but ac
+ self.tempdir]
build = subprocess.check_output(command).strip()
if self.config.type == 'gecko':
build += '-beta'
return build
def getChanges(self):
"""
retrieve changes between the current and previous ("first") revision
"""
command = ['hg', 'log', '-R', self.tempdir, '-r', 'tip:0',
- '-b', 'default', '-l', '50', '--encoding', 'utf-8',
+ '-b', self.branch, '-l', '50', '--encoding', 'utf-8',
kzar 2016/10/21 08:17:19 I'm not 100% sure but I think this command is retu
kzar 2016/10/21 08:22:57 Actually I think the second part of my comment was
kzar 2016/10/25 08:13:00 Please could you add the `'-b', 'default'` back ag
'--template', '{date|isodate}\\0{author|person}\\0{rev}\\0{desc}\\0\\0',
'--config', 'defaults.log=']
result = subprocess.check_output(command).decode('utf-8')
for change in result.split('\x00\x00'):
if change:
date, author, revision, description = change.split('\x00')
yield {'date': date, 'author': author, 'revision': revision, 'description': description}
def copyRepository(self):
"""
Create a repository copy in a temporary directory
"""
self.tempdir = tempfile.mkdtemp(prefix=self.config.repositoryName)
- command = ['hg', 'clone', '-q', self.config.repository, '-u', 'default', self.tempdir]
+ command = ['hg', 'clone', '-q', self.config.repository, '-b',
kzar 2016/10/21 08:17:19 I don't think change is required at all.
+ self.branch, '-u', 'default', self.tempdir]
subprocess.check_call(command)
# Make sure to run ensure_dependencies.py if present
depscript = os.path.join(self.tempdir, 'ensure_dependencies.py')
if os.path.isfile(depscript):
subprocess.check_call([sys.executable, depscript, '-q'])
def writeChangelog(self, changes):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld