Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Unified Diff: scripts/slave/chromium_commands.py

Issue 157073002: Bot update! (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: We dont' actually want to run on chromium.linux yet Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: scripts/slave/chromium_commands.py
diff --git a/scripts/slave/chromium_commands.py b/scripts/slave/chromium_commands.py
index 9c8b82e023311b74aac87c0e6558e0d6e898d511..d3f83a90b2e8351b09ae3eb324b8b1d763288138 100644
--- a/scripts/slave/chromium_commands.py
+++ b/scripts/slave/chromium_commands.py
@@ -269,6 +269,7 @@ class GClient(SourceBaseCommand):
self.no_gclient_revision = args.get('no_gclient_revision', False)
self.gclient_transitive = args.get('gclient_transitive')
self.gclient_jobs = args.get('gclient_jobs')
+ self.do_nothing = False
def start(self):
"""Start the update process.
@@ -287,8 +288,19 @@ class GClient(SourceBaseCommand):
self.sourcedatafile = os.path.join(self.builder.basedir,
self.srcdir,
".buildbot-sourcedata")
+ self.do_nothing = os.path.isfile(os.path.join(self.builder.basedir,
+ self.srcdir,
+ 'update.flag'))
+
+ d = defer.succeed(0)
+
+ if self.do_nothing:
+ # If bot update is run, we don't need to run the traditional update step.
+ self.sendStatus({'header': 'Found flag file, see "bot update" step, '
+ 'exiting\n'})
agable 2014/02/07 04:47:40 This message should match the messages in the othe
Ryan Tseng 2014/02/07 21:23:07 Done.
+ d.addCallback(self._sendRC)
+ return d
- d = defer.succeed(None)
# Do we need to clobber anything?
if self.mode in ("copy", "clobber", "export"):
d.addCallback(self.doClobber, self.workdir)
@@ -343,6 +355,9 @@ class GClient(SourceBaseCommand):
def doGclientUpdate(self):
"""Sync the client
"""
+ self.sendStatus({'header': "In Gclient Update\n"})
+ if self.do_nothing:
+ return defer.Deferred()
dirname = os.path.join(self.builder.basedir, self.srcdir)
command = [chromium_utils.GetGClientCommand(),
'sync', '--verbose', '--reset', '--manually_grab_svn_rev',
@@ -387,6 +402,9 @@ class GClient(SourceBaseCommand):
def getGclientConfigCommand(self):
"""Return the command to run the gclient config step.
"""
+ self.sendStatus({'header': "In Gclient Config\n"})
+ if self.do_nothing:
+ return defer.Deferred()
dirname = os.path.join(self.builder.basedir, self.srcdir)
command = [chromium_utils.GetGClientCommand(), 'config']
@@ -408,6 +426,9 @@ class GClient(SourceBaseCommand):
def doVCUpdate(self):
"""Sync the client
"""
+ self.sendStatus({'header': "In VC Update\n"})
agable 2014/02/07 04:47:40 Not sure why you introduced these sendStatus calls
Ryan Tseng 2014/02/07 21:23:07 Oh weird I totally thought i took these out, fixed
+ if self.do_nothing:
+ return defer.Deferred()
# Make sure the .gclient is updated.
os.remove(os.path.join(self.builder.basedir, self.srcdir, '.gclient'))
c = self.getGclientConfigCommand()
@@ -420,6 +441,9 @@ class GClient(SourceBaseCommand):
def doVCFull(self):
"""Setup the .gclient file and then sync
"""
+ self.sendStatus({'header': "In VC Full\n"})
+ if self.do_nothing:
+ return defer.Deferred()
chromium_utils.MaybeMakeDirectory(self.builder.basedir, self.srcdir)
c = self.getGclientConfigCommand()
@@ -446,6 +470,8 @@ class GClient(SourceBaseCommand):
dummy: unused
dirname: the directory within self.builder.basedir to be clobbered
"""
+ if self.do_nothing:
+ return defer.Deferred()
old_dir = os.path.join(self.builder.basedir, dirname)
dead_dir = old_dir + '.dead'
if os.path.isdir(old_dir):
@@ -471,6 +497,8 @@ class GClient(SourceBaseCommand):
it is assumed that .orig and .rej files will be reverted, e.g. deleted by
the 'gclient revert' command. If the try bot is configured with
'global-ignores=*.orig', patch failure will occur."""
+ if self.do_nothing:
+ return defer.Deferred()
dirname = os.path.join(self.builder.basedir, self.srcdir)
command = [chromium_utils.GetGClientCommand(), 'revert', '--nohooks']
c = runprocess.RunProcess(
@@ -502,6 +530,8 @@ class GClient(SourceBaseCommand):
return d
def doPatch(self, res):
+ if self.do_nothing:
+ return defer.Deferred()
patchlevel = self.patch[0]
diff = FixDiffLineEnding(self.patch[1])
@@ -542,6 +572,8 @@ class GClient(SourceBaseCommand):
return d
def doVCUpdateOnPatch(self, res):
+ if self.do_nothing:
+ return defer.Deferred()
if self.revision and not self.branch and '@' not in str(self.revision):
self.branch = 'src'
self.delete_unversioned_trees_when_updating = False
@@ -562,6 +594,8 @@ class GClient(SourceBaseCommand):
def writeSourcedata(self, res):
"""Write the sourcedata file and remove any dead source directory."""
+ if self.do_nothing:
+ return defer.Deferred()
dead_dir = os.path.join(self.builder.basedir, self.srcdir + '.dead')
if os.path.isdir(dead_dir):
msg = 'Removing dead source dir'

Powered by Google App Engine
This is Rietveld 408576698