1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-30 19:53:09 +00:00

(vc-cancel-version): Use search-forward to scan error message. Added

comments.
This commit is contained in:
André Spiegel 1996-01-10 15:24:03 +00:00
parent 4cb4ed4111
commit ae2506d066

View File

@ -1646,10 +1646,16 @@ A prefix argument means do not revert the buffer afterwards."
;; Check out unlocked, and revert buffer.
(vc-checkout (buffer-file-name) nil recent))
(setq done t))
;; If the checkout fails, vc-do-command signals an error.
;; We catch this error, check the reason, correct the
;; version number, and try a second time.
(error (set-buffer "*vc*")
(goto-char (point-min))
(if (re-search-forward "no side branches present for" nil t)
(if (search-forward "no side branches present for" nil t)
(progn (setq recent (vc-branch-part recent))
;; vc-do-command popped up a window with
;; the error message. Get rid of it, by
;; restoring the old window configuration.
(set-window-configuration config))
;; No, it was some other error: re-signal it.
(signal (car err) (cdr err))))))