Mercurial > emacs
comparison lisp/vc-cvs.el @ 48965:322a31d667aa
(vc-cvs-checkout): Handle t argument for REV.
author | André Spiegel <spiegel@gnu.org> |
---|---|
date | Thu, 26 Dec 2002 14:05:48 +0000 |
parents | ca7641fe56ba |
children | 02529e3b1f2c d7ddb3e565de |
comparison
equal
deleted
inserted
replaced
48964:7bba5b5ff0d2 | 48965:322a31d667aa |
---|---|
3 ;; Copyright (C) 1995,98,99,2000,2001,2002 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1995,98,99,2000,2001,2002 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.48 2002/10/11 06:47:49 miles Exp $ | 8 ;; $Id: vc-cvs.el,v 1.49 2002/10/17 15:43:48 lektu 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 |
419 (with-temp-file filename | 419 (with-temp-file filename |
420 (apply 'vc-cvs-command | 420 (apply 'vc-cvs-command |
421 (current-buffer) 0 file | 421 (current-buffer) 0 file |
422 "-Q" ; suppress diagnostic output | 422 "-Q" ; suppress diagnostic output |
423 "update" | 423 "update" |
424 (and rev (not (string= rev "")) | 424 (and (stringp rev) |
425 (not (string= rev "")) | |
425 (concat "-r" rev)) | 426 (concat "-r" rev)) |
426 "-p" | 427 "-p" |
427 switches))) | 428 switches))) |
428 (setq failed nil)) | 429 (setq failed nil)) |
429 (if failed | 430 (if failed |
436 (not vc-make-backup-files) | 437 (not vc-make-backup-files) |
437 (delete-file backup-name))))) | 438 (delete-file backup-name))))) |
438 (if (and (file-exists-p file) (not rev)) | 439 (if (and (file-exists-p file) (not rev)) |
439 ;; If no revision was specified, just make the file writable | 440 ;; If no revision was specified, just make the file writable |
440 ;; if necessary (using `cvs-edit' if requested). | 441 ;; if necessary (using `cvs-edit' if requested). |
441 (and editable (not (eq (vc-cvs-checkout-model file) 'implicit)) | 442 (and editable (not (eq (vc-cvs-checkout-model file) 'implicit)) |
442 (if vc-cvs-use-edit | 443 (if vc-cvs-use-edit |
443 (vc-cvs-command nil 0 file "edit") | 444 (vc-cvs-command nil 0 file "edit") |
444 (set-file-modes file (logior (file-modes file) 128)) | 445 (set-file-modes file (logior (file-modes file) 128)) |
445 (if file-buffer (toggle-read-only -1)))) | 446 (if file-buffer (toggle-read-only -1)))) |
446 ;; Check out a particular version (or recreate the file). | 447 ;; Check out a particular version (or recreate the file). |
447 (vc-file-setprop file 'vc-workfile-version nil) | 448 (vc-file-setprop file 'vc-workfile-version nil) |
448 (apply 'vc-cvs-command nil 0 file | 449 (apply 'vc-cvs-command nil 0 file |
449 (and editable | 450 (and editable |
450 (or (not (file-exists-p file)) | 451 (or (not (file-exists-p file)) |
451 (not (eq (vc-cvs-checkout-model file) | 452 (not (eq (vc-cvs-checkout-model file) |
452 'implicit))) | 453 'implicit))) |
453 "-w") | 454 "-w") |
454 "update" | 455 "update" |
455 ;; default for verbose checkout: clear the sticky tag so | 456 ;; default for verbose checkout: clear the sticky tag so |
456 ;; that the actual update will get the head of the trunk | 457 ;; that the actual update will get the head of the trunk |
457 (if (or (not rev) (string= rev "")) | 458 (if (or (not rev) (eq rev t) (string= rev "")) |
458 "-A" | 459 "-A" |
459 (concat "-r" rev)) | 460 (concat "-r" rev)) |
460 switches)))) | 461 switches)))) |
461 (vc-mode-line file) | 462 (vc-mode-line file) |
462 (message "Checking out %s...done" filename))))) | 463 (message "Checking out %s...done" filename))))) |
463 | 464 |
464 (defun vc-cvs-revert (file &optional contents-done) | 465 (defun vc-cvs-revert (file &optional contents-done) |
465 "Revert FILE to the version it was based on." | 466 "Revert FILE to the version it was based on." |