summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorAndré Spiegel <spiegel@gnu.org>1996-01-10 15:24:03 +0000
committerAndré Spiegel <spiegel@gnu.org>1996-01-10 15:24:03 +0000
commita02c1c2319b252b4a33a7abbb5d363e2d5530cec (patch)
tree4e0df1d66a48ac8a875bc2bfc0f345c4d110b22b /lisp
parent0b58037d44e9e9fc83bedb5cf71557b7dfe6fa96 (diff)
downloademacs-a02c1c2319b252b4a33a7abbb5d363e2d5530cec.tar.gz
(vc-cancel-version): Use search-forward to scan error message. Added
comments.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/vc.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/vc.el b/lisp/vc.el
index 386b62abe35..59457863b9a 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -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))))))