Rolls back to previous release
962896
def rollback():
    

    init_tasks()

    run_hook("before_rollback")

    # Remove current version
    current_release = paths.get_current_release_path()
    if current_release:
        env.run("rm -rf %s" % current_release)

    # Restore previous version
    old_release = paths.get_current_release_name()
    if old_release:
        paths.symlink(paths.get_source_path(old_release),
                      paths.get_current_path())

    run_hook("rollback")
    run_hook("after_rollback")

    logger.info("Rollback complete")
1170996
function proceedWithBackup() {
    if (options.resume) {
      // pick up from existing log file from previous run
      downloadRemainingBatches(options.log, db, ee, start, batchesPerDownloadSession, options.parallelism);
    } else {
      // create new log file and process
      spoolchanges(db, options.log, options.bufferSize, ee, function(err) {
        if (err) {
          ee.emit('error', err);
        } else {
          downloadRemainingBatches(options.log, db, ee, start, batchesPerDownloadSession, options.parallelism);
        }
      });
    }
  }
778161
def rollback(self):
        """"""
        filename = self.rollback_cfg
        cfg_file = self._gen_full_path(filename)
        if not self._check_file_exists(cfg_file):
            raise ReplaceConfigException("Rollback config file does not exist")
        cmd = "configure replace {} force".format(cfg_file)
        self.device.send_command_expect(cmd)

        # After a rollback - we no longer know whether this is configured or not.
        self.prompt_quiet_configured = None

        # Save config to startup
        self.device.save_config()
1334932
def rollback(self, label, plane):
        """"""
        cm_label = 'condoor-{}'.format(int(time.time()))
        self.device.send(self.rollback_cmd.format(label), timeout=120)
        return cm_label
600873
public void rollback() {
        try {
            ldapOperations.rename(temporaryDn, originalDn);
        } catch (Exception e) {
            log.warn("Filed to rollback unbind operation, temporaryDn: "
                    + temporaryDn + "; originalDn: " + originalDn);
        }
    }
1081712
@Override
    protected void rollbackRuntime(OperationContext context, ModelNode operation, Resource resource) {
        revertReload(context);
    }
885107
def rollback(awsclient, function_name, alias_name=ALIAS_NAME, version=None):
    
    if version:
        log.info('rolling back to version {}'.format(version))
    else:
        log.info('rolling back to previous version')
        version = _get_previous_version(awsclient, function_name, alias_name)
        if version == '0':
            log.error('unable to find previous version of lambda function')
            return 1

        log.info('new version is %s' % str(version))

    _update_alias(awsclient, function_name, version, alias_name)
    return 0
1034233
def rollback(self):
        """"""
        if not self._in_transaction:
            raise NotInTransaction
        self._init_cache()
        self._in_transaction = False
480354
function restore_options() {
  // Use default value showChangeLog = true.
  chrome.storage.sync.get({
    showChangeLog: true
  }, function (items) {
    document.getElementById('show_changelog').checked = items.showChangeLog;
  });
}
1094144
def rollback(self, dt):
        
        if not self.onOffset(dt):
            businesshours = self._get_business_hours_by_sec
            if self.n >= 0:
                dt = self._prev_opening_time(
                    dt) + timedelta(seconds=businesshours)
            else:
                dt = self._next_opening_time(
                    dt) + timedelta(seconds=businesshours)
        return dt
373324
function(version, cb) {
  var version_path = join(paths.versions, version),
      opts         = { env: process.env, cwd: version_path },
      args         = ['config', 'activate'];

  opts.env.UPGRADING_FROM = common.version;

  if (process.platform == 'win32') {
    var bin  = join(version_path, 'bin', 'node.exe');
    args     = [join('lib', 'conf', 'cli.js')].concat(args);
  } else {
    var bin  = join(version_path, 'bin', paths.bin);
  }

  run_synced(bin, args, opts, function(err, code) {
    if (!err && code === 0) return cb();

    shared.log('Failed. Rolling back!');

    // something went wrong while upgrading.
    // remove new package & undo pre_uninstall
    shared.version_manager.remove(version, function(er) {
      cb(er || err);
    });
  });
}
1103791
def _refresh_nvr(self):
        
        rpm_info = juicer.utils.rpm_info(self.path)
        self.name = rpm_info['name']
        self.version = rpm_info['version']
        self.release = rpm_info['release']
938903
public function rollback()
    {
        if (!$this->recv) {
            $this->receive();
            App::error('You forget to getResult() before rollback !');
        }
        $this->connection->query('rollback;');
    }
651863
def rollback(self):
        """"""
        self._state_machine.transition_to_rollback()
        for action in reversed(self._executed_actions):
            try:
                self.execute_with_retries(action, lambda a: a.rollback())
            except:  # pylint: disable=bare-except
                pass  # on exception, carry on with rollback of other steps
        self._state_machine.transition_to_rollback_complete()
769932
def _backup_previous_version(func: Callable = None):
    """"""

    @wraps(func)
    def wrapper(self, *args, **kwargs):
        self.old_path = None
        if self.is_local:
            self.old_path = join(gettempdir(), self.name)
            if exists(self.old_path):
                rmtree(self.old_path)
            shutil.copytree(self.path, self.old_path)
        try:
            func(self, *args, **kwargs)

        # Modified skill or GitError should not restore working copy
        except (SkillModified, GitError, GitException):
            raise
        except Exception:
            LOG.info('Problem performing action. Restoring skill to '
                     'previous state...')
            if exists(self.path):
                rmtree(self.path)
            if self.old_path and exists(self.old_path):
                shutil.copytree(self.old_path, self.path)
            self.is_local = exists(self.path)
            raise

    return wrapper
186067
def rollback(self):
        
        # This is slightly complicated because of Python's freakish
        # assignment semantics and because we don't store multiple
        # copies of the log.
        if self.contents['rollback'] is None:
            raise ValueError("No operation to roll back on refpkg")
        future_msg = self.contents['log'][0]
        rolledback_log = self.contents['log'][1:]
        rollforward = copy.deepcopy(self.contents)
        rollforward.pop('rollback')
        self.contents = self.contents['rollback']
        self.contents['log'] = rolledback_log
        self.contents['rollforward'] = [future_msg, rollforward]
        self._sync_to_disk()
435641
def _run_down(self, path, migration, pretend=False):
        
        migration_file = migration['migration']

        instance = self._resolve(path, migration_file)

        if pretend:
            return self._pretend_to_run(instance, 'down')

        instance.down()

        self._repository.delete(migration)

        self._note('<info>✓ Rolled back</info> %s' % migration_file)