def Commit(self):
    """Commits the transaction, making the new app version available.

    All the files returned by Begin() must have been uploaded with UploadFile()
    before Commit() can be called.

    This tries the new 'deploy' method; if that fails it uses the old 'commit'.

    Raises:
      Exception: Some required files were not uploaded.
    """
    assert self.in_transaction, 'Begin() must be called before Commit().'
    if self.files:
      raise Exception('Not all required files have been uploaded.')

    try:
      self.Deploy()
      if not RetryWithBackoff(1, 2, 8, self.IsReady):
        logging.warning('Version still not ready to serve, aborting.')
        raise Exception('Version not ready.')
      self.StartServing()
    except urllib2.HTTPError, e:
      if e.code != 404:
        raise
      StatusUpdate('Closing update.')
      self.server.Send('/api/appversion/commit', app_id=self.app_id,
                       version=self.version)
      self.in_transaction = False
dataset/ETHPy150Open CollabQ/CollabQ/.google_appengine/google/appengine/tools/appcfg.py/AppVersionUpload.Commit/original