/[emacs]/emacs/lisp/vc-sccs.el
ViewVC logotype

Diff of /emacs/lisp/vc-sccs.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.15.2.1 by miles, Fri Apr 4 06:20:11 2003 UTC revision 1.15.2.2 by miles, Tue Oct 14 23:51:27 2003 UTC
# Line 130  For a description of possible values, se Line 130  For a description of possible values, se
130                (if (file-ownership-preserved-p file)                (if (file-ownership-preserved-p file)
131                    'edited                    'edited
132                  (vc-user-login-name owner-uid))                  (vc-user-login-name owner-uid))
133            ;; Strange permissions.              ;; Strange permissions.
134            ;; Fall through to real state computation.              ;; Fall through to real state computation.
135            (vc-sccs-state file)))              (vc-sccs-state file))))
136      (vc-sccs-state file))))      (vc-sccs-state file)))
137    
138  (defun vc-sccs-workfile-version (file)  (defun vc-sccs-workfile-version (file)
139    "SCCS-specific version of `vc-workfile-version'."    "SCCS-specific version of `vc-workfile-version'."
140    (with-temp-buffer    (with-temp-buffer
141      (vc-insert-file (vc-name file) "^\001e")      ;; The workfile version is always the latest version number.
142        ;; To find this number, search the entire delta table,
143        ;; rather than just the first entry, because the
144        ;; first entry might be a deleted ("R") version.
145        (vc-insert-file (vc-name file) "^\001e\n\001[^s]")
146      (vc-parse-buffer "^\001d D \\([^ ]+\\)" 1)))      (vc-parse-buffer "^\001d D \\([^ ]+\\)" 1)))
147    
148  (defun vc-sccs-checkout-model (file)  (defun vc-sccs-checkout-model (file)
# Line 166  the SCCS command (in that order). Line 170  the SCCS command (in that order).
170    
171  Automatically retrieve a read-only version of the file with keywords  Automatically retrieve a read-only version of the file with keywords
172  expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile."  expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile."
173      (let* ((switches (append      (let* ((dirname (or (file-name-directory file) ""))
                      (if (stringp vc-register-switches)  
                          (list vc-register-switches)  
                        vc-register-switches)  
                      (if (stringp vc-sccs-register-switches)  
                          (list vc-sccs-register-switches)  
                        vc-sccs-register-switches)))  
            (dirname (or (file-name-directory file) ""))  
174             (basename (file-name-nondirectory file))             (basename (file-name-nondirectory file))
175             (project-file (vc-sccs-search-project-dir dirname basename)))             (project-file (vc-sccs-search-project-dir dirname basename)))
176        (let ((vc-name        (let ((vc-name
177               (or project-file               (or project-file
178                   (format (car vc-sccs-master-templates) dirname basename)))|)                   (format (car vc-sccs-master-templates) dirname basename))))
179          (apply 'vc-do-command nil 0 "admin" vc-name          (apply 'vc-do-command nil 0 "admin" vc-name
180                 (and rev (concat "-r" rev))                 (and rev (concat "-r" rev))
181                 "-fb"                 "-fb"
182                 (concat "-i" (file-relative-name file))                 (concat "-i" (file-relative-name file))
183                 (and comment (concat "-y" comment))                 (and comment (concat "-y" comment))
184                 switches))                 (vc-switches 'SCCS 'register)))
185        (delete-file file)        (delete-file file)
186        (if vc-keep-workfiles        (if vc-keep-workfiles
187            (vc-do-command nil 0 "get" (vc-name file)))))            (vc-do-command nil 0 "get" (vc-name file)))))
# Line 198  expanded if `vc-keep-workfiles' is non-n Line 195  expanded if `vc-keep-workfiles' is non-n
195    
196  (defun vc-sccs-checkin (file rev comment)  (defun vc-sccs-checkin (file rev comment)
197    "SCCS-specific version of `vc-backend-checkin'."    "SCCS-specific version of `vc-backend-checkin'."
198    (let ((switches (if (stringp vc-checkin-switches)    (apply 'vc-do-command nil 0 "delta" (vc-name file)
199                        (list vc-checkin-switches)           (if rev (concat "-r" rev))
200                      vc-checkin-switches)))           (concat "-y" comment)
201      (apply 'vc-do-command nil 0 "delta" (vc-name file)           (vc-switches 'SCCS 'checkin))
202             (if rev (concat "-r" rev))    (if vc-keep-workfiles
203             (concat "-y" comment)        (vc-do-command nil 0 "get" (vc-name file))))
            switches)  
     (if vc-keep-workfiles  
         (vc-do-command nil 0 "get" (vc-name file)))))  
204    
205  (defun vc-sccs-find-version (file rev buffer)  (defun vc-sccs-find-version (file rev buffer)
206    (apply 'vc-do-command    (apply 'vc-do-command
# Line 216  expanded if `vc-keep-workfiles' is non-n Line 210  expanded if `vc-keep-workfiles' is non-n
210           (and rev           (and rev
211                (concat "-r"                (concat "-r"
212                        (vc-sccs-lookup-triple file rev)))                        (vc-sccs-lookup-triple file rev)))
213           (if (stringp vc-checkout-switches)           (vc-switches 'SCCS 'checkout)))
              (list vc-checkout-switches)  
            vc-checkout-switches)))  
214    
215  (defun vc-sccs-checkout (file &optional editable rev)  (defun vc-sccs-checkout (file &optional editable rev)
216    "Retrieve a copy of a saved version of SCCS controlled FILE.    "Retrieve a copy of a saved version of SCCS controlled FILE.
# Line 230  locked.  REV is the revision to check ou Line 222  locked.  REV is the revision to check ou
222      (save-excursion      (save-excursion
223        ;; Change buffers to get local value of vc-checkout-switches.        ;; Change buffers to get local value of vc-checkout-switches.
224        (if file-buffer (set-buffer file-buffer))        (if file-buffer (set-buffer file-buffer))
225        (setq switches (if (stringp vc-checkout-switches)        (setq switches (vc-switches 'SCCS 'checkout))
                          (list vc-checkout-switches)  
                        vc-checkout-switches))  
226        ;; Save this buffer's default-directory        ;; Save this buffer's default-directory
227        ;; and use save-excursion to make sure it is restored        ;; and use save-excursion to make sure it is restored
228        ;; in the same buffer it was saved in.        ;; in the same buffer it was saved in.
# Line 298  EDITABLE non-nil means previous version Line 288  EDITABLE non-nil means previous version
288           (append (list "-q"           (append (list "-q"
289                         (and oldvers (concat "-r" oldvers))                         (and oldvers (concat "-r" oldvers))
290                         (and newvers (concat "-r" newvers)))                         (and newvers (concat "-r" newvers)))
291                   (vc-diff-switches-list 'SCCS))))                   (vc-switches 'SCCS 'diff))))
292    
293    
294  ;;;  ;;;
# Line 407  If NAME is nil or a version number strin Line 397  If NAME is nil or a version number strin
397    
398  (provide 'vc-sccs)  (provide 'vc-sccs)
399    
400    ;;; arch-tag: d751dee3-d7b3-47e1-95e3-7ae98c052041
401  ;;; vc-sccs.el ends here  ;;; vc-sccs.el ends here

Legend:
Removed from v.1.15.2.1  
changed lines
  Added in v.1.15.2.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26