From e1483c383115cc874a07ce2353567125ec36941f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Spiegel?= Date: Fri, 27 Oct 2000 15:07:46 +0000 Subject: [PATCH] (vc-cvs-merge-news): Be prepared for no news at all. --- lisp/ChangeLog | 3 ++- lisp/vc-cvs.el | 54 ++++++++++++++++++++++++++------------------------ 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5e1e3a6e21e..8bffdf12c67 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -11,7 +11,8 @@ * vc-cvs.el (vc-cvs-checkin): Check both status and error message after command. If there's an unexpected error, signal it instead of being silent. - + (vc-cvs-merge-news): Be prepared for no news at all. + 2000-10-27 Miles Bader * shell.el (shell): Add BUFFER argument. diff --git a/lisp/vc-cvs.el b/lisp/vc-cvs.el index fbe6b9a2b33..e1665068e10 100644 --- a/lisp/vc-cvs.el +++ b/lisp/vc-cvs.el @@ -5,7 +5,7 @@ ;; Author: FSF (see vc.el for full credits) ;; Maintainer: Andre Spiegel -;; $Id: vc-cvs.el,v 1.6 2000/10/22 15:31:11 spiegel Exp $ +;; $Id: vc-cvs.el,v 1.7 2000/10/27 11:37:17 spiegel Exp $ ;; This file is part of GNU Emacs. @@ -422,31 +422,33 @@ The changes are between FIRST-VERSION and SECOND-VERSION." (vc-file-setprop file 'vc-workfile-version nil)) ;; get file status (prog1 - (if (re-search-forward - (concat "^\\([CMUP] \\)?" - (regexp-quote (file-name-nondirectory file)) - "\\( already contains the differences between \\)?") - nil t) - (cond - ;; Merge successful, we are in sync with repository now - ((or (match-string 2) - (string= (match-string 1) "U ") - (string= (match-string 1) "P ")) - (vc-file-setprop file 'vc-state 'up-to-date) - (vc-file-setprop file 'vc-checkout-time - (nth 5 (file-attributes file))) - 0);; indicate success to the caller - ;; Merge successful, but our own changes are still in the file - ((string= (match-string 1) "M ") - (vc-file-setprop file 'vc-state 'edited) - 0);; indicate success to the caller - ;; Conflicts detected! - (t - (vc-file-setprop file 'vc-state 'edited) - 1);; signal the error to the caller - ) - (pop-to-buffer "*vc*") - (error "Couldn't analyze cvs update result")) + (if (eq (buffer-size) 0) + 0 ;; there were no news; indicate success + (if (re-search-forward + (concat "^\\([CMUP] \\)?" + (regexp-quote (file-name-nondirectory file)) + "\\( already contains the differences between \\)?") + nil t) + (cond + ;; Merge successful, we are in sync with repository now + ((or (match-string 2) + (string= (match-string 1) "U ") + (string= (match-string 1) "P ")) + (vc-file-setprop file 'vc-state 'up-to-date) + (vc-file-setprop file 'vc-checkout-time + (nth 5 (file-attributes file))) + 0);; indicate success to the caller + ;; Merge successful, but our own changes are still in the file + ((string= (match-string 1) "M ") + (vc-file-setprop file 'vc-state 'edited) + 0);; indicate success to the caller + ;; Conflicts detected! + (t + (vc-file-setprop file 'vc-state 'edited) + 1);; signal the error to the caller + ) + (pop-to-buffer "*vc*") + (error "Couldn't analyze cvs update result"))) (message "Merging changes into %s...done" file)))) (defun vc-cvs-check-headers () -- 2.39.2