changeset 14141:dc502b9c237c

(vc-cancel-version): Use search-forward to scan error message. Added comments.
author André Spiegel <spiegel@gnu.org>
date Wed, 10 Jan 1996 15:24:03 +0000
parents db5e78740d5c
children c9cb9dbb2d40
files lisp/vc.el
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/vc.el	Wed Jan 10 15:03:26 1996 +0000
+++ b/lisp/vc.el	Wed Jan 10 15:24:03 1996 +0000
@@ -1646,10 +1646,16 @@
                 ;; 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))))))