emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange VC/CVS failure


From: Andre Spiegel
Subject: Re: Strange VC/CVS failure
Date: 27 Oct 2000 08:28:44 +0200
User-agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7

I wrote:

> A remote theory that vaguely springs to my mind is that the check-in
> might fail because the repository contains more recent changes and
> these need to be merged into your workfile first.  It could be that
> this merge actually happens, but you are not properly informed of it.
> After any recent changes have been picked up into your working file,
> the check-in will finally succeed.

Even without further information, I suspect a problem in the code
below, from vc-cvs-checkin.  It relies entirely on the presence of a
certain string in cvs output to see if changes need to be merged back.
If that string isn't present, the error is simply ignored.  I will
install the indicated change to make it safe, however before that, I
would like to know what actually happens.  Could somebody verify that
WinCVS (or any other versions of CVS, for that matter) indeed use the
string "Up-to-date check failed" to indicate this condition?

--- vc-cvs.el.#1.6#     Sun Oct 22 17:31:11 2000
+++ vc-cvs.el   Fri Oct 27 08:17:07 2000
@@ -519,14 +519,21 @@
                        "ci" (if rev (concat "-r" rev))
                        (concat "-m" comment)
                        switches))
-    ;; determine and store the new workfile version
     (set-buffer "*vc*")
     (goto-char (point-min))
-    ;; Check checkin problem.  We could check `status' as well.
-    (when (re-search-forward "Up-to-date check failed" nil t)
-      (vc-file-setprop file 'vc-state 'needs-merge)
-      (error (substitute-command-keys
-             "Up-to-date check failed: type \\[vc-next-action] to merge in 
changes")))
+    (when (not (zerop status))
+      ;; Check checkin problem.
+      (cond
+       ((re-search-forward "Up-to-date check failed" nil t)
+        (vc-file-setprop file 'vc-state 'needs-merge)
+        (error (substitute-command-keys
+                (concat "Up-to-date check failed: "
+                        "type \\[vc-next-action] to merge in changes"))))
+       (t
+        (pop-to-buffer (current-buffer))
+        (goto-char (point-min))
+        (shrink-window-if-larger-than-buffer)
+        (error "Check-in failed"))))
     ;; Update file properties
     (vc-file-setprop
      file 'vc-workfile-version



reply via email to

[Prev in Thread] Current Thread [Next in Thread]