Undo the last metadata change.

        Returns
        -------

        up : UpdateInfo instance
511058
def undo(self):
        
        args = self._undo_stack.back()
        if args is None:
            return
        self._data = deepcopy(self._data_base)
        for clusters, field, value, up, undo_state in self._undo_stack:
            if clusters is not None:
                self.set(field, clusters, value, add_to_stack=False)

        # Return the UpdateInfo instance of the undo action.
        up, undo_state = args[-2:]
        up.history = 'undo'
        up.undo_state = undo_state

        self.emit('cluster', up)
        return up
1063583
def _update_resume_for_completed(self):
        # type: (Descriptor) -> None
        
        if not self.is_resumable:
            return
        with self._meta_lock:
            self._resume_mgr.add_or_update_record(
                self.final_path, self._ase, self._chunk_size,
                self._next_integrity_chunk, True, None,
            )
635221
def _strip_metadata(self, my_dict):
        
        new_dict = copy.deepcopy(my_dict)
        if const.START in new_dict:
            del new_dict[const.START]
        if const.END in new_dict:
            del new_dict[const.END]
        if const.WHITELIST in new_dict:
            del new_dict[const.WHITELIST]
        if const.WHITELIST_START in new_dict:
            del new_dict[const.WHITELIST_START]
        if const.WHITELIST_END in new_dict:
            del new_dict[const.WHITELIST_END]
        return new_dict
361771
def update(cls, spec, updates, upsert=False):
        '''
        
        '''
        if 'key' in spec:
            previous = cls.get(spec['key'])
        else:
            previous = None
        if previous:
            # Update existing data.
            current = cls(**previous.__dict__)
        elif upsert:
            # Create new data.
            current = cls(**spec)
        else:
            current = None
        # XXX Should there be any error thrown if this is a noop?
        if current:
            current.__dict__.update(updates)
            current.save()
        return current
1322410
def revert(self):
        
        for attr, value in self._changed.items():
            setattr(django_settings, attr, value)
        for attr in self._added:
            delattr(django_settings, attr)
        self._changed = {}
        self._added = []
        if self.isolated:
            self._isolated_overrides = BaseSettings()
359358
def clear(self):
        
        self.__modified_data__ = {}
        self.__deleted_fields__ = [field for field in self.__original_data__.keys()]
303788
def last_updated(self):
        '''
        
        '''
        derived_path = self.context.request.url
        timestamp_key = self.timestamp_key_for(derived_path)

        if self.exists(self.timestamp_key_for, derived_path):
            return self.storage.get(timestamp_key)

        return None
310519
def undo(self):
        
        log = getLogger('ocrd.workspace_backup.undo')
        backups = self.list()
        if backups:
            last_backup = backups[0]
            self.restore(last_backup.chksum, choose_first=True)
        else:
            log.info("No backups, nothing to undo.")
207128
def _doCleanup(self):
        
        # pass on this if we're not configured yet
        if not self.configured_url:
            return

        d = self.changes.pruneChanges(self.master.config.changeHorizon)
        d.addErrback(log.err, 'while pruning changes')
        return d
385775
def reset(rev_name, opts = {})
      args = []
      args << '--hard' if opts[:hard]
      args << rev_name

      logger.info { "Resetting #{opts[:hard] ? '(hard)' : ''} to #{rev_name}" }

      command(:reset, args)
    end
161213
def last_modified(self, last_modified):
        """"""
        self._indicator_data['lastModified'] = self._utils.format_datetime(
            last_modified, date_format='%Y-%m-%dT%H:%M:%SZ'
        )
1201529
def undo(self):
        
        if self.grouping_level() == 1:
            self.end_grouping()
        if self._open:
            raise IndexError
        self.undo_nested_group()
        self.notify()
724990
def revert_snapshot(self, name, *args, **kwargs):
        
        return self.provider.revert_snapshot(name, *args, **kwargs)
1141653
def wiki_revert(self, title, version):
        
        params = {'title': title, 'version': version}
        return self._get('wiki/revert', params, method='PUT')
33130
def last_revision(self, mod: YangIdentifier) -> ModuleId:
        
        revs = [mn for mn in self.modules if mn[0] == mod]
        if not revs:
            raise ModuleNotRegistered(mod)
        return sorted(revs, key=lambda x: x[1])[-1]
704140
def remove_metadata_key(self, obj, key):
        
        meta_dict = {key: ""}
        return self.set_metadata(obj, meta_dict)
934519
def undo_action_name(self):
        
        if self._open:
            return self._open[-1].name
        elif self._undo:
            return self._undo[-1].name
        return ""