Function: vc-revert-or-delete-revision

vc-revert-or-delete-revision is an autoloaded, interactive and byte-compiled function defined in vc.el.gz.

Signature

(vc-revert-or-delete-revision REV &optional INTERACTIVE DELETE COMMENT INITIAL-CONTENTS BACKEND)

Documentation

Undo the effects of revision REV.

When called interactively, prompts for REV.

When called interactively (or with optional argument INTERACTIVE non-nil), then if the underlying VCS is distributed and REV has not been pushed, offer to entirely delete REV. This is instead of creating a new commit undoing the effects of REV.

With a prefix argument (or with optional argument DELETE non-nil), only consider deleting REV, never create a new commit. In this case INTERACTIVE is ignored. This works only if REV has not been pushed, unless you have customized vc-allow-rewriting-published-history to a non-nil value.

When called from Lisp, there are three calling conventions for the COMMENT and INITIAL-CONTENTS optional arguments:
- COMMENT a string, INITIAL-CONTENTS nil means use that comment string
  without prompting the user to edit it.
- COMMENT a string, INITIAL-CONTENTS non-nil means use that comment
  string as the initial contents of the log entry buffer but stop for
  editing.
- COMMENT t means use BACKEND's default revert comment for REV without
  prompting for editing, and ignore INITIAL-CONTENTS.

Optional argument BACKEND is the VC backend to use.

See also vc-revert-revision.

View in manual

Probably introduced at or before Emacs version 31.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc.el.gz
;;;###autoload
(defun vc-revert-or-delete-revision
    (rev &optional interactive delete comment initial-contents backend)
  "Undo the effects of revision REV.
When called interactively, prompts for REV.

When called interactively (or with optional argument INTERACTIVE
non-nil), then if the underlying VCS is distributed and REV has not been
pushed, offer to entirely delete REV.
This is instead of creating a new commit undoing the effects of REV.

With a prefix argument (or with optional argument DELETE non-nil),
only consider deleting REV, never create a new commit.
In this case INTERACTIVE is ignored.
This works only if REV has not been pushed, unless you have customized
`vc-allow-rewriting-published-history' to a non-nil value.

When called from Lisp, there are three calling conventions for the
COMMENT and INITIAL-CONTENTS optional arguments:
- COMMENT a string, INITIAL-CONTENTS nil means use that comment string
  without prompting the user to edit it.
- COMMENT a string, INITIAL-CONTENTS non-nil means use that comment
  string as the initial contents of the log entry buffer but stop for
  editing.
- COMMENT t means use BACKEND's default revert comment for REV without
  prompting for editing, and ignore INITIAL-CONTENTS.

Optional argument BACKEND is the VC backend to use.

See also `vc-revert-revision'."
  (interactive (list (vc-read-revision (if current-prefix-arg
                                           "Revision to delete: "
                                         "Revision to revert: "))
                     t current-prefix-arg))
  (vc--pick-or-revert rev t interactive delete
                      comment initial-contents backend))