comparison lisp/vc-arch.el @ 90988:492971a3f31f unicode-xft-base

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 816-823) - Update from CVS - Merge from emacs--rel--22 * emacs--rel--22 (patch 59-69) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 237-238) - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-235
author Miles Bader <miles@gnu.org>
date Tue, 24 Jul 2007 01:23:55 +0000
parents a66921565bcb 066eaef90bfb
children f55f9811f5d7
comparison
equal deleted inserted replaced
90987:b2d8a283f27e 90988:492971a3f31f
196 (vc-file-setprop 196 (vc-file-setprop
197 ;; Check the =tagging-method, in case someone naively manually 197 ;; Check the =tagging-method, in case someone naively manually
198 ;; creates a {arch} directory somewhere. 198 ;; creates a {arch} directory somewhere.
199 file 'arch-root (vc-find-root file "{arch}/=tagging-method")))) 199 file 'arch-root (vc-find-root file "{arch}/=tagging-method"))))
200 200
201 (defun vc-arch-register (file &optional rev comment) 201 (defun vc-arch-register (files &optional rev comment)
202 (if rev (error "Explicit initial revision not supported for Arch")) 202 (if rev (error "Explicit initial revision not supported for Arch"))
203 (let ((tagmet (vc-arch-tagging-method file))) 203 (dolist (file files)
204 (if (and (memq tagmet '(tagline implicit)) comment-start) 204 (let ((tagmet (vc-arch-tagging-method file)))
205 (with-current-buffer (find-file-noselect file) 205 (if (and (memq tagmet '(tagline implicit)) comment-start)
206 (if (buffer-modified-p) 206 (with-current-buffer (find-file-noselect file)
207 (error "Save %s first" (buffer-name))) 207 (if (buffer-modified-p)
208 (vc-arch-add-tagline) 208 (error "Save %s first" (buffer-name)))
209 (save-buffer)) 209 (vc-arch-add-tagline)
210 (vc-arch-command nil 0 file "add")))) 210 (save-buffer)))))
211 (vc-arch-command nil 0 files "add"))
211 212
212 (defun vc-arch-registered (file) 213 (defun vc-arch-registered (file)
213 ;; Don't seriously check whether it's source or not. Checking would 214 ;; Don't seriously check whether it's source or not. Checking would
214 ;; require running TLA, so it's better to not do it, so it also works if 215 ;; require running TLA, so it's better to not do it, so it also works if
215 ;; TLA is not installed. 216 ;; TLA is not installed.
369 ;; so we shouldn't ask the user whether she wants to check it out. 370 ;; so we shouldn't ask the user whether she wants to check it out.
370 ) 371 )
371 372
372 (defun vc-arch-checkout-model (file) 'implicit) 373 (defun vc-arch-checkout-model (file) 'implicit)
373 374
374 (defun vc-arch-checkin (file rev comment) 375 (defun vc-arch-checkin (files rev comment)
375 (if rev (error "Committing to a specific revision is unsupported")) 376 (if rev (error "Committing to a specific revision is unsupported"))
376 (let ((summary (file-relative-name file (vc-arch-root file)))) 377 ;; FIXME: This implementation probably only works for singleton filesets
378 (let ((summary (file-relative-name (car file) (vc-arch-root (car files)))))
377 ;; Extract a summary from the comment. 379 ;; Extract a summary from the comment.
378 (when (or (string-match "\\`Summary:[ \t]*\\(.*[^ \t\n]\\)\\([ \t]*\n\\)*" comment) 380 (when (or (string-match "\\`Summary:[ \t]*\\(.*[^ \t\n]\\)\\([ \t]*\n\\)*" comment)
379 (string-match "\\`[ \t]*\\(.*[^ \t\n]\\)[ \t]*\\(\n?\\'\\|\n\\([ \t]*\n\\)+\\)" comment)) 381 (string-match "\\`[ \t]*\\(.*[^ \t\n]\\)[ \t]*\\(\n?\\'\\|\n\\([ \t]*\n\\)+\\)" comment))
380 (setq summary (match-string 1 comment)) 382 (setq summary (match-string 1 comment))
381 (setq comment (substring comment (match-end 0)))) 383 (setq comment (substring comment (match-end 0))))
382 (vc-arch-command nil 0 file "commit" "-s" summary "-L" comment "--" 384 (vc-arch-command nil 0 files "commit" "-s" summary "-L" comment "--"
383 (vc-switches 'Arch 'checkin)))) 385 (vc-switches 'Arch 'checkin))))
384 386
385 (defun vc-arch-diff (file &optional oldvers newvers buffer) 387 (defun vc-arch-diff (files &optional oldvers newvers buffer)
386 "Get a difference report using Arch between two versions of FILE." 388 "Get a difference report using Arch between two versions of FILES."
387 (if (and newvers 389 ;; FIXME: This implementation only works for singleton filesets. To make
388 (vc-up-to-date-p file) 390 ;; it work for more cases, we have to either call `file-diffs' manually on
389 (equal newvers (vc-workfile-version file))) 391 ;; each and every `file' in the fileset, or use `changes --diffs' (and
390 ;; Newvers is the base revision and the current file is unchanged, 392 ;; variants) and maybe filter the output with `filterdiff' to only include
391 ;; so we can diff with the current file. 393 ;; the files in which we're interested.
392 (setq newvers nil)) 394 (let ((file (car files)))
393 (if newvers 395 (if (and newvers
394 (error "Diffing specific revisions not implemented") 396 (vc-up-to-date-p file)
395 (let* ((async (and (not vc-disable-async-diff) (fboundp 'start-process))) 397 (equal newvers (vc-workfile-version file)))
396 ;; Run the command from the root dir. 398 ;; Newvers is the base revision and the current file is unchanged,
397 (default-directory (vc-arch-root file)) 399 ;; so we can diff with the current file.
398 (status 400 (setq newvers nil))
399 (vc-arch-command 401 (if newvers
400 (or buffer "*vc-diff*") 402 (error "Diffing specific revisions not implemented")
401 (if async 'async 1) 403 (let* ((async (and (not vc-disable-async-diff) (fboundp 'start-process)))
402 nil "file-diffs" 404 ;; Run the command from the root dir.
403 ;; Arch does not support the typical flags. 405 (default-directory (vc-arch-root file))
404 ;; (vc-switches 'Arch 'diff) 406 (status
405 (file-relative-name file) 407 (vc-arch-command
406 (if (equal oldvers (vc-workfile-version file)) 408 (or buffer "*vc-diff*")
407 nil 409 (if async 'async 1)
408 oldvers)))) 410 nil "file-diffs"
409 (if async 1 status)))) ; async diff, pessimistic assumption. 411 ;; Arch does not support the typical flags.
412 ;; (vc-switches 'Arch 'diff)
413 (file-relative-name file)
414 (if (equal oldvers (vc-workfile-version file))
415 nil
416 oldvers))))
417 (if async 1 status))))) ; async diff, pessimistic assumption.
410 418
411 (defun vc-arch-delete-file (file) 419 (defun vc-arch-delete-file (file)
412 (vc-arch-command nil 0 file "rm")) 420 (vc-arch-command nil 0 file "rm"))
413 421
414 (defun vc-arch-rename-file (old new) 422 (defun vc-arch-rename-file (old new)