Commits

Anonymous committed c09e376

conflicts/warnings fixes

  • Participants
  • Parent commits 86808d3

Comments (0)

Files changed (3)

+1998-04-19  Oscar Figueiredo  <Oscar.Figueiredo@di.epfl.ch>
+
+	* pcl-cvs.el (cvs-parse-stderr): Accept standalone conflict
+	warnings as the additional information is on stdout in recent CVS
+	versions.
+	(cvs-parse-stdout): Parse merge information
+
 1998-03-26  Oscar Figueiredo  <Oscar.Figueiredo@di.epfl.ch>
 
 	* pcl-cvs.el: (cvs-examine): Added autoload cookie.  Switch to cvs 
 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 # Boston, MA 02111-1307, USA.
 
-VERSION = 1.04
+VERSION = 1.05
 AUTHOR_VERSION =
 MAINTAINER = XEmacs Development Team <xemacs-beta@xemacs.org>
 PACKAGE = pcl-cvs
 		(setcdr head (list fileinfo))
 		(setq head (cdr head)))))))
 
+	 ;; Full merge messages have been moved to sdtout in recent CVS
+	 ((looking-at
+	   ;; Allow both RCS 5.5 and 5.6.  (5.6 prints "rcs" and " warning").
+	   "^\\(rcs\\)?merge[:]*\\( warning\\)?: \\(overlaps\\|conflicts\\) during merge$")
+	  (forward-line 1)
+	  (cvs-skip-line stdout-buffer stderr-buffer
+			 "^cvs \\(update\\|server\\): conflicts found in "))
+
          ;; Patch failure message with CVS client.
          ;; Ignore, since a failed patch implies that the file proper
          ;; subsequently will be fetched from the server.
 	  (setq head (cdr head))
 	  (forward-line 1)))
 
+       ;; CVS has decided to merge someone elses changes into this document.
+       ;; About to start an rcsmerge operation...
+       ;;
+       ((looking-at
+	 "^RCS file: ")
+
+	(forward-line 1)
+
+	(let ((complex-start (point))
+	      current-dir		; the current subdir of the working directory
+	      base-revision		; the first revision retrieved to merge from
+	      head-revision		; the second revision retrieved to merge from
+	      filename			; the name of the file being merged
+	      backup-file		; the name of the backup of the working file
+	      backup-revision)		; the revision of the original working file
+
+	  (setq base-revision
+		(cvs-skip-line stdout-buffer stderr-buffer
+			       "^retrieving revision \\(.*\\)$"
+			       1))
+	  (setq head-revision
+		(cvs-skip-line stdout-buffer stderr-buffer
+			       "^retrieving revision \\(.*\\)$"
+			       1))
+	  (setq filename
+		(cvs-skip-line stdout-buffer stderr-buffer
+			       "^Merging differences between [0-9.]+ and [0-9.]+ into \\(.*\\)$"
+			       1))
+	  
+	  (if (looking-at "^[CM] \\(.*\\)$")
+	      (setq current-dir
+		    (cvs-get-current-dir
+		     root-dir
+		     (file-name-directory (match-string 1)))))
+
+	  (setq backup-file
+		(cvs-find-backup-file filename current-dir))
+	  (setq backup-revision
+		(cvs-find-backup-revision backup-file))
+
+	  ;; Was there a conflict during the merge?
+
+	  (cond
+
+	   ((looking-at "^C")
+
+	    (let ((fileinfo
+		   (cvs-create-fileinfo
+		    'CONFLICT current-dir
+		    filename
+		    (buffer-substring complex-start (point)))))
+
+	      ;; squirrel away info about the files that were retrieved for merging
+	      (cvs-set-fileinfo->base-revision fileinfo base-revision)
+	      (cvs-set-fileinfo->head-revision fileinfo head-revision)
+	      (cvs-set-fileinfo->backup-revision fileinfo backup-revision)
+	      (cvs-set-fileinfo->backup-file fileinfo backup-file)
+
+	      (setcdr head (list fileinfo))
+	      (setq head (cdr head))))
+
+	   ((looking-at "^M")
+	    (let ((fileinfo
+		   (cvs-create-fileinfo
+		    'MERGED current-dir
+		    filename
+		    (buffer-substring complex-start (point)))))
+	      (cvs-set-fileinfo->base-revision fileinfo base-revision)
+	      (cvs-set-fileinfo->head-revision fileinfo head-revision)
+	      (cvs-set-fileinfo->backup-revision fileinfo backup-revision)
+	      (cvs-set-fileinfo->backup-file fileinfo backup-file)
+	      (setcdr head (list fileinfo))
+	      (setq head (cdr head)))))))
+
        ;; Executing a program because of the -u option in modules.
        ((looking-at
 	 "^cvs \\(update\\|server\\): Executing")