Skip to content

Commit

Permalink
Merge commit 'd8fddfa5b0250204a0fa0820d6864e14f09e1bed' into jinja
Browse files Browse the repository at this point in the history
Conflicts:
	buildbot/status/web/step.py
  • Loading branch information
marcus-sonestedt committed Dec 19, 2009
2 parents 94f2070 + d8fddfa commit 204e6d3
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 72 deletions.
89 changes: 40 additions & 49 deletions buildbot/slave/commands.py
Expand Up @@ -1469,6 +1469,11 @@ def sourcedataMatches(self):
return False
return True

def sourcedirIsPatched(self):
return os.path.exists(os.path.join(self.builder.basedir,
self.srcdir,
".buildbot-patched"))

def _handleGotRevision(self, res):
d = defer.maybeDeferred(self.parseGotRevision)
d.addCallback(lambda got_revision:
Expand Down Expand Up @@ -1496,12 +1501,15 @@ def writeSourcedata(self, res):
return res

def sourcedirIsUpdateable(self):
"""Returns True if the tree can be updated."""
raise NotImplementedError("this must be implemented in a subclass")

def doVCUpdate(self):
"""Returns a deferred with the steps to update a checkout."""
raise NotImplementedError("this must be implemented in a subclass")

def doVCFull(self):
"""Returns a deferred with the steps to do a fresh checkout."""
raise NotImplementedError("this must be implemented in a subclass")

def maybeDoVCFallback(self, rc):
Expand Down Expand Up @@ -1688,11 +1696,9 @@ def setup(self, args):
self.branch)

def sourcedirIsUpdateable(self):
if os.path.exists(os.path.join(self.builder.basedir,
self.srcdir, ".buildbot-patched")):
return False
return os.path.isdir(os.path.join(self.builder.basedir,
self.srcdir, "CVS"))
return (not self.sourcedirIsPatched() and
os.path.isdir(os.path.join(self.builder.basedir,
self.srcdir, "CVS")))

def start(self):
if self.login is not None:
Expand Down Expand Up @@ -1746,7 +1752,7 @@ def doVCFull(self):
if self.revision:
command += ['-D', self.revision]
command += [self.cvsmodule]

c = ShellCommand(self.builder, command, d,
sendRC=False, timeout=self.timeout,
maxTime=self.maxTime, usePTY=False)
Expand Down Expand Up @@ -1788,11 +1794,9 @@ def setup(self, args):
self.svn_args.extend(args['extra_args'])

def sourcedirIsUpdateable(self):
if os.path.exists(os.path.join(self.builder.basedir,
self.srcdir, ".buildbot-patched")):
return False
return os.path.isdir(os.path.join(self.builder.basedir,
self.srcdir, ".svn"))
return (not self.sourcedirIsPatched() and
os.path.isfile(os.path.join(self.builder.basedir,
self.srcdir, ".svn", "format")))

def doVCUpdate(self):
revision = self.args['revision'] or 'HEAD'
Expand Down Expand Up @@ -1890,14 +1894,11 @@ def setup(self, args):
self.revision = self.args.get('revision')

def sourcedirIsUpdateable(self):
if os.path.exists(os.path.join(self.builder.basedir,
self.srcdir, ".buildbot-patched")):
return False
if self.revision:
# checking out a specific revision requires a full 'darcs get'
return False
return os.path.isdir(os.path.join(self.builder.basedir,
self.srcdir, "_darcs"))
# checking out a specific revision requires a full 'darcs get'
return (not self.revision and
not self.sourcedirIsPatched() and
os.path.isdir(os.path.join(self.builder.basedir,
self.srcdir, "_darcs")))

def doVCUpdate(self):
assert not self.revision
Expand Down Expand Up @@ -1985,11 +1986,9 @@ def _makefulls(self):

def sourcedirIsUpdateable(self):
self._makefulls()
if os.path.exists(os.path.join(self.full_srcdir,
".buildbot_patched")):
return False
return (os.path.isfile(self.full_db_path)
and os.path.isdir(os.path.join(self.full_srcdir, "MT")))
return (not self.sourcedirIsPatched() and
os.path.isfile(self.full_db_path) and
os.path.isdir(os.path.join(self.full_srcdir, "MT")))

def doVCUpdate(self):
return self._withFreshDb(self._doUpdate)
Expand Down Expand Up @@ -2217,18 +2216,15 @@ def setup(self, args):
self.buildconfig)

def sourcedirIsUpdateable(self):
if self.revision:
# Arch cannot roll a directory backwards, so if they ask for a
# specific revision, clobber the directory. Technically this
# could be limited to the cases where the requested revision is
# later than our current one, but it's too hard to extract the
# current revision from the tree.
return False
if os.path.exists(os.path.join(self.builder.basedir,
self.srcdir, ".buildbot-patched")):
return False
return os.path.isdir(os.path.join(self.builder.basedir,
self.srcdir, "{arch}"))
# Arch cannot roll a directory backwards, so if they ask for a
# specific revision, clobber the directory. Technically this
# could be limited to the cases where the requested revision is
# later than our current one, but it's too hard to extract the
# current revision from the tree.
return (not self.revision and
not self.sourcedirIsPatched() and
os.path.isdir(os.path.join(self.builder.basedir,
self.srcdir, "{arch}")))

def doVCUpdate(self):
# update: possible for mode in ('copy', 'update')
Expand Down Expand Up @@ -2407,14 +2403,11 @@ def setup(self, args):
self.forceSharedRepo = args.get('forceSharedRepo')

def sourcedirIsUpdateable(self):
if os.path.exists(os.path.join(self.builder.basedir,
self.srcdir, ".buildbot-patched")):
return False
if self.revision:
# checking out a specific revision requires a full 'bzr checkout'
return False
return os.path.isdir(os.path.join(self.builder.basedir,
self.srcdir, ".bzr"))
# checking out a specific revision requires a full 'bzr checkout'
return (not self.revision and
not self.sourcedirIsPatched() and
os.path.isdir(os.path.join(self.builder.basedir,
self.srcdir, ".bzr")))

def start(self):
def cont(res):
Expand Down Expand Up @@ -2879,14 +2872,12 @@ def setup(self, args):


def sourcedirIsUpdateable(self):
if os.path.exists(os.path.join(self.builder.basedir,
self.srcdir, ".buildbot-patched")):
return False
# We assume our client spec is still around.
# We just say we aren't updateable if the dir doesn't exist so we
# don't get ENOENT checking the sourcedata.
return os.path.isdir(os.path.join(self.builder.basedir,
self.srcdir))
return (not self.sourcedirIsPatched() and
os.path.isdir(os.path.join(self.builder.basedir,
self.srcdir)))

def doVCUpdate(self):
return self._doP4Sync(force=False)
Expand Down
33 changes: 17 additions & 16 deletions buildbot/status/web/step.py
Expand Up @@ -30,25 +30,26 @@ def body(self, req):
logs.append({'log': l,
'link': req.childLink("logs/%s" % urllib.quote(l.getName())), })

dict = {}
cxt = {}
start, end = s.getTimes()
if end:
dict['elapsed'] = util.formatInterval(end - start)
dict['end'] = ctime(end)
else:
now = util.now()
dict['elapsed'] = util.formatInterval(now - start)

start = ctime(start)

if start:
cxt['start'] = ctime(start)
if end:
cxt['end'] = ctime(end)
cxt['elapsed'] = util.formatInterval(end - start)
else:
cxt['end'] = "Not Finished"
cxt['elapsed'] = util.formatInterval(util.now() - start)

cxt.update(dict(builder_link = path_to_builder(req, b.getBuilder()),
build_link = path_to_build(req, b),
b = b,
s = s,
logs = logs))

template = req.site.buildbot_service.templates.get_template("buildstep.html");
data = template.render(builder_link = path_to_builder(req, b.getBuilder()),
build_link = path_to_build(req, b),
b = b,
s = s,
logs = logs,
start = start,
**dict)
data = template.render(**cxt)


return data + self.footer(req)
Expand Down
16 changes: 9 additions & 7 deletions buildbot/status/web/templates/buildstep.html
Expand Up @@ -26,13 +26,15 @@ <h2>Expectations</h2>
{% endif %}

<h2>Timing</h2>
<table>
<tr><td>Start</td><td>{{ start }}</td></tr>
{% if end %}
<tr><td>End</td><td>{{ end }}</td></tr>
{% endif %}
<tr><td>Elapsed</td><td>{{ elapsed }}</td></tr>
</table>
{% if start %}
<table>
<tr><td>Start</td><td>{{ start }}</td></tr>
<tr><td>End</td><td>{{ end or "Not finished" }}</td></tr>
<tr><td>Elapsed</td><td>{{ elapsed }}</td></tr>
</table>
{% else %}
<b>Not started</b>
{% endif %}

<h2>Logs</h2>
<ul>
Expand Down

0 comments on commit 204e6d3

Please sign in to comment.