Function: vc-revert-revision
vc-revert-revision is an autoloaded, interactive and byte-compiled
function defined in vc.el.gz.
Signature
(vc-revert-revision REV &optional COMMENT INITIAL-CONTENTS BACKEND)
Documentation
Make a commit undoing the effects of revision REV.
When called interactively, prompts for REV.
This is like vc-revert-or-delete-revision except that it only ever
makes a new commit undoing the effects of REV, instead of considering
VCS-specific alternative mechanisms to undo the effects of REV.
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.
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-revision
(rev &optional comment initial-contents backend)
"Make a commit undoing the effects of revision REV.
When called interactively, prompts for REV.
This is like `vc-revert-or-delete-revision' except that it only ever
makes a new commit undoing the effects of REV, instead of considering
VCS-specific alternative mechanisms to undo the effects of REV.
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."
(interactive (list (vc-read-revision "Revision to revert: ")))
(vc--pick-or-revert rev t nil 'never comment initial-contents backend))