comparison lisp/vc-cvs.el @ 47807:b5920ffc1070

(vc-cvs-find-version): Fix vc-checkout-switches use.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 08 Oct 2002 20:25:21 +0000
parents 0d2f83a91144
children 8b1c72f30fea
comparison
equal deleted inserted replaced
47806:10d173c975ef 47807:b5920ffc1070
3 ;; Copyright (C) 1995,98,99,2000,2001 Free Software Foundation, Inc. 3 ;; Copyright (C) 1995,98,99,2000,2001 Free Software Foundation, Inc.
4 4
5 ;; Author: FSF (see vc.el for full credits) 5 ;; Author: FSF (see vc.el for full credits)
6 ;; Maintainer: Andre Spiegel <spiegel@gnu.org> 6 ;; Maintainer: Andre Spiegel <spiegel@gnu.org>
7 7
8 ;; $Id: vc-cvs.el,v 1.43 2002/10/04 18:38:53 monnier Exp $ 8 ;; $Id: vc-cvs.el,v 1.44 2002/10/08 15:38:28 monnier Exp $
9 9
10 ;; This file is part of GNU Emacs. 10 ;; This file is part of GNU Emacs.
11 11
12 ;; GNU Emacs is free software; you can redistribute it and/or modify 12 ;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by 13 ;; it under the terms of the GNU General Public License as published by
374 "-Q" ; suppress diagnostic output 374 "-Q" ; suppress diagnostic output
375 "update" 375 "update"
376 (and rev (not (string= rev "")) 376 (and rev (not (string= rev ""))
377 (concat "-r" rev)) 377 (concat "-r" rev))
378 "-p" 378 "-p"
379 vc-checkout-switches)) 379 (if (stringp vc-checkout-switches)
380 (list vc-checkout-switches)
381 vc-checkout-switches)))
380 382
381 (defun vc-cvs-checkout (file &optional editable rev workfile) 383 (defun vc-cvs-checkout (file &optional editable rev workfile)
382 "Retrieve a revision of FILE into a WORKFILE. 384 "Retrieve a revision of FILE into a WORKFILE.
383 EDITABLE non-nil means that the file should be writable. 385 EDITABLE non-nil means that the file should be writable.
384 REV is the revision to check out into WORKFILE." 386 REV is the revision to check out into WORKFILE."
434 (not vc-make-backup-files) 436 (not vc-make-backup-files)
435 (delete-file backup-name))))) 437 (delete-file backup-name)))))
436 (if (and (file-exists-p file) (not rev)) 438 (if (and (file-exists-p file) (not rev))
437 ;; If no revision was specified, just make the file writable 439 ;; If no revision was specified, just make the file writable
438 ;; if necessary (using `cvs-edit' if requested). 440 ;; if necessary (using `cvs-edit' if requested).
439 (and editable (not (eq (vc-cvs-checkout-model file) 'implicit)) 441 (and editable (not (eq (vc-cvs-checkout-model file) 'implicit))
440 (if vc-cvs-use-edit 442 (if vc-cvs-use-edit
441 (vc-cvs-command nil 0 file "edit") 443 (vc-cvs-command nil 0 file "edit")
442 (set-file-modes file (logior (file-modes file) 128)) 444 (set-file-modes file (logior (file-modes file) 128))
443 (if file-buffer (toggle-read-only -1)))) 445 (if file-buffer (toggle-read-only -1))))
444 ;; Check out a particular version (or recreate the file). 446 ;; Check out a particular version (or recreate the file).
445 (vc-file-setprop file 'vc-workfile-version nil) 447 (vc-file-setprop file 'vc-workfile-version nil)
446 (apply 'vc-cvs-command nil 0 file 448 (apply 'vc-cvs-command nil 0 file
447 (and editable 449 (and editable
448 (or (not (file-exists-p file)) 450 (or (not (file-exists-p file))
449 (not (eq (vc-cvs-checkout-model file) 451 (not (eq (vc-cvs-checkout-model file)
450 'implicit))) 452 'implicit)))
451 "-w") 453 "-w")
452 "update" 454 "update"
453 ;; default for verbose checkout: clear the sticky tag so 455 ;; default for verbose checkout: clear the sticky tag so
454 ;; that the actual update will get the head of the trunk 456 ;; that the actual update will get the head of the trunk
455 (if (or (not rev) (string= rev "")) 457 (if (or (not rev) (string= rev ""))
456 "-A" 458 "-A"
457 (concat "-r" rev)) 459 (concat "-r" rev))
458 switches)))) 460 switches))))
459 (vc-mode-line file) 461 (vc-mode-line file)