'Push data for a task
@param task: the task Row
@return: tuple (error, mtime), with error=None if successful,
else error=message, and mtime=modification timestamp
of the youngest record sent'

def push(self, task):

    xml = current.xml
    repository = self.repository
    resource_name = task.resource_name
    current.log.debug(('S3SyncCommandBridge.push(%s,    %s)' % (repository.url, resource_name)))
    resource = current.s3db.resource(resource_name, include_deleted=True)
    folder = current.request.folder
    import os
    stylesheet = os.path.join(folder, 'static', 'formats', 'mcb', 'export.xsl')
    last_push = task.last_push
    filters = current.sync.get_filters(task.id)
    settings = current.deployment_settings
    identifiers = settings.get_sync_mcb_resource_identifiers()
    resources = ''.join((('[%s:%s]' % (k, v)) for (k, v) in identifiers.items()))
    identifiers = settings.get_sync_mcb_domain_identifiers()
    domains = ''.join((('[%s:%s]' % (k, v)) for (k, v) in identifiers.items()))
    data = resource.export_xml(filters=filters, msince=last_push, stylesheet=stylesheet, pretty_print=True, resources=resources, domains=domains)
    count = (resource.results or 0)
    mtime = resource.muntil
    remote = False
    output = None
    log = repository.log
    if (data and count):
        (response, message) = self._send_request(method='POST', path='BulkStream', data=data)
        if (response is None):
            result = log.FATAL
            remote = True
            if (not message):
                message = 'unknown    error'
            output = message
        else:
            result = log.SUCCESS
            message = ('Data    sent    successfully    (%s    records)' % count)
    else:
        result = log.WARNING
        message = 'No    data    to    send'
    log.write(repository_id=repository.id, resource_name=resource_name, transmission=log.OUT, mode=log.PUSH, action='send', remote=remote, result=result, message=message)
    if (output is not None):
        mtime = None
    return (output, mtime)
