comparison lisp/vc-sccs.el @ 35823:9396894025fa

(vc-sccs-diff-switches): New customization option. (vc-sccs-diff): Use it via vc-diff-switches-list. (vc-sccs-workfile-unchanged-p): Return correct status.
author André Spiegel <spiegel@gnu.org>
date Thu, 01 Feb 2001 15:12:35 +0000
parents 1b423e7eb1eb
children 037d66685778
comparison
equal deleted inserted replaced
35822:cd59c63d4aac 35823:9396894025fa
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-sccs.el,v 1.6 2001/01/08 16:26:44 spiegel Exp $ 8 ;; $Id: vc-sccs.el,v 1.7 2001/01/09 14:55:30 fx 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
25 ;; Boston, MA 02111-1307, USA. 25 ;; Boston, MA 02111-1307, USA.
26 26
27 ;;; Commentary: 27 ;;; Commentary:
28 28
29 ;;; Code: 29 ;;; Code:
30
31 (eval-when-compile
32 (require 'vc))
30 33
31 ;;; 34 ;;;
32 ;;; Customization options 35 ;;; Customization options
33 ;;; 36 ;;;
34 37
35 (defcustom vc-sccs-register-switches nil 38 (defcustom vc-sccs-register-switches nil
36 "*Extra switches for registering a file in SCCS. 39 "*Extra switches for registering a file in SCCS.
37 A string or list of strings passed to the checkin program by 40 A string or list of strings passed to the checkin program by
38 \\[vc-sccs-register]." 41 \\[vc-sccs-register]."
39 :type '(choice (const :tag "None" nil) 42 :type '(choice (const :tag "None" nil)
43 (string :tag "Argument String")
44 (repeat :tag "Argument List"
45 :value ("")
46 string))
47 :version "21.1"
48 :group 'vc)
49
50 (defcustom vc-sccs-diff-switches nil
51 "*A string or list of strings specifying extra switches for `vcdiff',
52 the diff utility used for SCCS under VC."
53 :type '(choice (const :tag "None" nil)
40 (string :tag "Argument String") 54 (string :tag "Argument String")
41 (repeat :tag "Argument List" 55 (repeat :tag "Argument List"
42 :value ("") 56 :value ("")
43 string)) 57 string))
44 :version "21.1" 58 :version "21.1"
126 "SCCS-specific version of `vc-checkout-model'." 140 "SCCS-specific version of `vc-checkout-model'."
127 'locking) 141 'locking)
128 142
129 (defun vc-sccs-workfile-unchanged-p (file) 143 (defun vc-sccs-workfile-unchanged-p (file)
130 "SCCS-specific implementation of vc-workfile-unchanged-p." 144 "SCCS-specific implementation of vc-workfile-unchanged-p."
131 (apply 'vc-do-command nil 1 "vcdiff" (vc-name file) 145 (zerop (apply 'vc-do-command nil 1 "vcdiff" (vc-name file)
132 (list "--brief" "-q" 146 (list "--brief" "-q"
133 (concat "-r" (vc-workfile-version file))))) 147 (concat "-r" (vc-workfile-version file))))))
134 148
135 149
136 ;;; 150 ;;;
137 ;;; State-changing functions 151 ;;; State-changing functions
138 ;;; 152 ;;;
289 303
290 (defun vc-sccs-diff (file &optional oldvers newvers) 304 (defun vc-sccs-diff (file &optional oldvers newvers)
291 "Get a difference report using SCCS between two versions of FILE." 305 "Get a difference report using SCCS between two versions of FILE."
292 (setq oldvers (vc-sccs-lookup-triple file oldvers)) 306 (setq oldvers (vc-sccs-lookup-triple file oldvers))
293 (setq newvers (vc-sccs-lookup-triple file newvers)) 307 (setq newvers (vc-sccs-lookup-triple file newvers))
294 (let* ((diff-switches-list (if (listp diff-switches) 308 (apply 'vc-do-command t 1 "vcdiff" (vc-name file)
295 diff-switches 309 (append (list "-q"
296 (list diff-switches))) 310 (and oldvers (concat "-r" oldvers))
297 (options (append (list "-q" 311 (and newvers (concat "-r" newvers)))
298 (and oldvers (concat "-r" oldvers)) 312 (vc-diff-switches-list sccs))))
299 (and newvers (concat "-r" newvers)))
300 diff-switches-list)))
301 (apply 'vc-do-command t 1 "vcdiff" (vc-name file) options)))
302 313
303 314
304 ;;; 315 ;;;
305 ;;; Snapshot system 316 ;;; Snapshot system
306 ;;; 317 ;;;