comparison lisp/vc-rcs.el @ 32096:e7f273d850bf

(vc-rcs-receive-file): Rewritten to contain only backend-specific code.
author André Spiegel <spiegel@gnu.org>
date Tue, 03 Oct 2000 12:08:40 +0000
parents 027fb880735d
children da206bbad86b
comparison
equal deleted inserted replaced
32095:728e4747aae1 32096:e7f273d850bf
3 ;; Copyright (C) 1992,93,94,95,96,97,98,99,2000 Free Software Foundation, Inc. 3 ;; Copyright (C) 1992,93,94,95,96,97,98,99,2000 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-rcs.el,v 1.9 2000/10/01 19:35:24 monnier Exp $ 8 ;; $Id: vc-rcs.el,v 1.10 2000/10/03 11:33:59 spiegel 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
733 (not (directory-files dir nil 733 (not (directory-files dir nil
734 "^\\([^.]\\|\\.[^.]\\|\\.\\.[^.]\\).*")) 734 "^\\([^.]\\|\\.[^.]\\|\\.\\.[^.]\\).*"))
735 (yes-or-no-p (format "Directory %s is empty; remove it? " dir)) 735 (yes-or-no-p (format "Directory %s is empty; remove it? " dir))
736 (delete-directory dir)))) 736 (delete-directory dir))))
737 737
738 (defun vc-rcs-receive-file (file move) 738 (defun vc-rcs-receive-file (file rev)
739 "Implementation of receive-file for RCS." 739 "Implementation of receive-file for RCS."
740 (let ((old-backend (vc-backend file)) 740 (let ((checkout-model (vc-checkout-model file)))
741 (rev (vc-workfile-version file)) 741 (vc-rcs-register file rev "")
742 (state (vc-state file)) 742 (when (eq checkout-model 'implicit)
743 (checkout-model (vc-checkout-model file)) 743 (vc-rcs-set-non-strict-locking file))
744 (comment (and move (vc-call comment-history file)))) 744 (vc-rcs-set-default-branch file (concat rev ".1"))))
745 (if move (vc-unregister file))
746 (vc-file-clearprops file)
747 (if (not (vc-rcs-registered file))
748 (progn
749 ;; TODO: If the file was 'edited under the old backend,
750 ;; this should actually register the version
751 ;; it was based on.
752 (vc-rcs-register file rev "")
753 (vc-file-setprop file 'vc-backend 'RCS)
754 (if (eq checkout-model 'implicit)
755 (vc-rcs-set-non-strict-locking file))
756 (if (not move)
757 (vc-do-command nil 0 "rcs" file (concat "-b" rev ".1"))))
758 (vc-file-setprop file 'vc-backend 'RCS)
759 (vc-file-setprop file 'vc-state 'edited)
760 (set-file-modes file
761 (logior (file-modes file) 128)))
762 (when (or move (eq state 'edited))
763 (vc-file-setprop file 'vc-state 'edited)
764 ;; Explicit branch revision number will cause vc-rcs-checkin
765 ;; to use "ci -f". This is a trick to force creation of
766 ;; the branch, even if we couldn't use the unmodified base
767 ;; version for registration above.
768 (vc-checkin file (concat rev ".1.1") comment (stringp comment)))))
769 745
770 (defun vc-rcs-set-non-strict-locking (file) 746 (defun vc-rcs-set-non-strict-locking (file)
771 (vc-do-command nil 0 "rcs" file "-U") 747 (vc-do-command nil 0 "rcs" file "-U")
772 (vc-file-setprop file 'vc-checkout-model 'implicit) 748 (vc-file-setprop file 'vc-checkout-model 'implicit)
773 (set-file-modes file (logior (file-modes file) 128))) 749 (set-file-modes file (logior (file-modes file) 128)))