comparison lisp/ediff-vers.el @ 85825:13163bbed0bf

* progmodes/mixal-mode.el (mixal-run, mixal-debug): Call mixvm only if it is bound. * textmodes/reftex.el: Move autoloads for before all uses. (reftex-make-overlay, reftex-overlay-put, reftex-move-overlay) (reftex-delete-overlay): Move to the top level with the condition in the body. * progmodes/simula.el: Use when instead of if. * iimage.el (iimage-locate-file): Define unconditionally. * mail/mailabbrev.el (mail-abbrev-next-line): * emulation/vip.el (vip-enlarge-region, vip-line) (vip-next-line-at-bol, vip-previous-line) (vip-previous-line-at-bol, vip-find-char, vip-put-back, ex-read): Wrap with-no-warnings around uses of next-line and previous-line. * ediff.el (run-ediff-from-cvs-buffer): * ediff-vers.el (cvs-run-ediff-on-file-descriptor): Remove function not used by pcl-cvs anymore. (noninteractive, generic-sc-get-latest-rev) (ediff-generic-sc-internal, ediff-generic-sc-merge-internal): Delete support for long obsolete generic-sc.el.
author Dan Nicolaescu <dann@ics.uci.edu>
date Wed, 31 Oct 2007 06:28:09 +0000
parents 708abc311fa6
children d505125b0b46
comparison
equal deleted inserted replaced
85824:f1fcb6e1fb24 85825:13163bbed0bf
37 (and noninteractive 37 (and noninteractive
38 (eval-when-compile 38 (eval-when-compile
39 (let ((load-path (cons (expand-file-name ".") load-path))) 39 (let ((load-path (cons (expand-file-name ".") load-path)))
40 (load "pcl-cvs" 'noerror) 40 (load "pcl-cvs" 'noerror)
41 (load "rcs" 'noerror) 41 (load "rcs" 'noerror)
42 ;; On 8+3 MS-DOS filesystems, generic-x.el is loaded
43 ;; instead of (the missing) generic-sc.el. Since the
44 ;; version of Emacs which supports MS-DOS doesn't have
45 ;; generic-sc, we simply avoid loading it.
46 (or (and (fboundp 'msdos-long-file-names)
47 (not (msdos-long-file-names)))
48 (load "generic-sc" 'noerror))
49 ;; (load "vc" 'noerror) ; this sometimes causes compiler error 42 ;; (load "vc" 'noerror) ; this sometimes causes compiler error
50 (or (featurep 'ediff-init) 43 (or (featurep 'ediff-init)
51 (load "ediff-init.el" nil nil 'nosuffix)) 44 (load "ediff-init.el" nil nil 'nosuffix))
52 ))) 45 )))
53 ;; end pacifier 46 ;; end pacifier
154 147
155 ;; rcs.el doesn't create temp version files, so we don't have to delete 148 ;; rcs.el doesn't create temp version files, so we don't have to delete
156 ;; anything in startup hooks to ediff-buffers 149 ;; anything in startup hooks to ediff-buffers
157 (ediff-buffers rev1buf rev2buf startup-hooks 'ediff-revision) 150 (ediff-buffers rev1buf rev2buf startup-hooks 'ediff-revision)
158 )) 151 ))
159
160
161 ;; GENERIC-SC.el support
162
163 (defun generic-sc-get-latest-rev ()
164 (cond ((eq sc-mode 'CCASE)
165 (eval "main/LATEST"))
166 (t (eval ""))))
167
168 (defun ediff-generic-sc-internal (rev1 rev2 &optional startup-hooks)
169 ;; Run Ediff on versions of the current buffer.
170 ;; If REV2 is "" then compare current buffer with REV1.
171 ;; If the current buffer is named `F', the version is named `F.~REV~'.
172 ;; If `F.~REV~' already exists, it is used instead of being re-created.
173 (let (rev1buf rev2buf)
174 (save-excursion
175 (if (or (not rev1) (string= rev1 ""))
176 (setq rev1 (generic-sc-get-latest-rev)))
177 (sc-visit-previous-revision rev1)
178 (setq rev1buf (current-buffer)))
179 (save-excursion
180 (or (string= rev2 "") ; use current buffer
181 (sc-visit-previous-revision rev2))
182 (setq rev2buf (current-buffer)))
183 (ediff-buffers rev1buf rev2buf startup-hooks 'ediff-revision)))
184
185 152
186 ;;; Merge with Version Control 153 ;;; Merge with Version Control
187 154
188 (defun ediff-vc-merge-internal (rev1 rev2 ancestor-rev 155 (defun ediff-vc-merge-internal (rev1 rev2 ancestor-rev
189 &optional startup-hooks merge-buffer-file) 156 &optional startup-hooks merge-buffer-file)
243 buf1 buf2 ancestor-buf 210 buf1 buf2 ancestor-buf
244 startup-hooks 'ediff-merge-revisions-with-ancestor merge-buffer-file) 211 startup-hooks 'ediff-merge-revisions-with-ancestor merge-buffer-file)
245 (ediff-merge-buffers 212 (ediff-merge-buffers
246 buf1 buf2 startup-hooks 'ediff-merge-revisions merge-buffer-file)))) 213 buf1 buf2 startup-hooks 'ediff-merge-revisions merge-buffer-file))))
247 214
248 (defun ediff-generic-sc-merge-internal (rev1 rev2 ancestor-rev
249 &optional
250 startup-hooks merge-buffer-file)
251 ;; If ANCESTOR-REV non-nil, merge with ancestor
252 (let (buf1 buf2 ancestor-buf)
253 (save-excursion
254 (if (string= rev1 "")
255 (setq rev1 (generic-sc-get-latest-rev)))
256 (sc-visit-previous-revision rev1)
257 (setq buf1 (current-buffer)))
258 (save-excursion
259 (or (string= rev2 "")
260 (sc-visit-previous-revision rev2))
261 (setq buf2 (current-buffer)))
262 (if ancestor-rev
263 (save-excursion
264 (or (string= ancestor-rev "")
265 (sc-visit-previous-revision ancestor-rev))
266 (setq ancestor-buf (current-buffer))))
267 (if ancestor-rev
268 (ediff-merge-buffers-with-ancestor
269 buf1 buf2 ancestor-buf
270 startup-hooks 'ediff-merge-revisions-with-ancestor merge-buffer-file)
271 (ediff-merge-buffers
272 buf1 buf2 startup-hooks 'ediff-merge-revisions merge-buffer-file))))
273
274
275 ;; PCL-CVS.el support
276
277 ;; MK: Check. This function doesn't seem to be used any more by pcvs or pcl-cvs
278 (defun cvs-run-ediff-on-file-descriptor (tin)
279 ;; This is a replacement for cvs-emerge-mode
280 ;; Runs after cvs-update.
281 ;; Ediff-merge appropriate revisions of the selected file.
282 (let* ((fileinfo (tin-cookie cvs-cookie-handle tin))
283 (type (cvs-fileinfo->type fileinfo))
284 (tmp-file
285 (cvs-retrieve-revision-to-tmpfile fileinfo))
286 (default-directory
287 (file-name-as-directory (cvs-fileinfo->dir fileinfo)))
288 ancestor-file)
289
290 (or (memq type '(MERGED CONFLICT MODIFIED))
291 (error
292 "Can only merge `Modified', `Merged' or `Conflict' files"))
293
294 (cond ((memq type '(MERGED CONFLICT))
295 (setq ancestor-file
296 (cvs-retrieve-revision-to-tmpfile
297 fileinfo
298 ;; revision
299 (cvs-fileinfo->base-revision fileinfo)))
300 (ediff-merge-buffers-with-ancestor
301 (find-file-noselect tmp-file)
302 (find-file-noselect (cvs-fileinfo->backup-file fileinfo))
303 (find-file-noselect ancestor-file)
304 nil ; startup-hooks
305 'ediff-merge-revisions-with-ancestor))
306 ((eq type 'MODIFIED)
307 (ediff-buffers
308 (find-file-noselect tmp-file)
309 (if (featurep 'xemacs)
310 ;; XEmacs doesn't seem to have cvs-fileinfo->full-name
311 (find-file-noselect (cvs-fileinfo->full-path fileinfo))
312 (find-file-noselect (cvs-fileinfo->full-name fileinfo)))
313 nil ; startup-hooks
314 'ediff-revisions)))
315 (if (stringp tmp-file) (ediff-delete-version-file tmp-file))
316 (if (stringp ancestor-file) (ediff-delete-version-file ancestor-file))))
317
318 215
319 ;; delete version file on exit unless ediff-keep-tmp-versions is true 216 ;; delete version file on exit unless ediff-keep-tmp-versions is true
320 (defun ediff-delete-version-file (file) 217 (defun ediff-delete-version-file (file)
321 (or ediff-keep-tmp-versions (delete-file file))) 218 (or ediff-keep-tmp-versions (delete-file file)))
322 219