aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/vc/vc-rcs.el23
-rw-r--r--lisp/vc/vc-sccs.el22
-rw-r--r--lisp/vc/vc-src.el13
-rw-r--r--lisp/vc/vc.el11
4 files changed, 26 insertions, 43 deletions
diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el
index 40a102789b9..5b375868a80 100644
--- a/lisp/vc/vc-rcs.el
+++ b/lisp/vc/vc-rcs.el
@@ -158,14 +158,9 @@ For a description of possible values, see `vc-check-master-templates'."
158(autoload 'vc-expand-dirs "vc") 158(autoload 'vc-expand-dirs "vc")
159 159
160(defun vc-rcs-dir-status (dir update-function) 160(defun vc-rcs-dir-status (dir update-function)
161 ;; FIXME: this function should be rewritten or `vc-expand-dirs'
162 ;; should be changed to take a backend parameter. Using
163 ;; `vc-expand-dirs' is not TRTD because it returns files from
164 ;; multiple backends. It should also return 'unregistered files.
165
166 ;; Doing individual vc-state calls is painful but there 161 ;; Doing individual vc-state calls is painful but there
167 ;; is no better way in RCS-land. 162 ;; is no better way in RCS-land.
168 (let ((flist (vc-expand-dirs (list dir))) 163 (let ((flist (vc-expand-dirs (list dir) 'RCS))
169 (result nil)) 164 (result nil))
170 (dolist (file flist) 165 (dolist (file flist)
171 (let ((state (vc-state file)) 166 (let ((state (vc-state file))
@@ -319,7 +314,7 @@ whether to remove it."
319 "RCS-specific version of `vc-backend-checkin'." 314 "RCS-specific version of `vc-backend-checkin'."
320 (let (rev (switches (vc-switches 'RCS 'checkin))) 315 (let (rev (switches (vc-switches 'RCS 'checkin)))
321 ;; Now operate on the files 316 ;; Now operate on the files
322 (dolist (file (vc-expand-dirs files)) 317 (dolist (file (vc-expand-dirs files 'RCS))
323 (let ((old-version (vc-working-revision file)) new-version 318 (let ((old-version (vc-working-revision file)) new-version
324 (default-branch (vc-file-getprop file 'vc-rcs-default-branch))) 319 (default-branch (vc-file-getprop file 'vc-rcs-default-branch)))
325 ;; Force branch creation if an appropriate 320 ;; Force branch creation if an appropriate
@@ -378,7 +373,7 @@ whether to remove it."
378 "Retrieve a copy of a saved version of FILE. If FILE is a directory, 373 "Retrieve a copy of a saved version of FILE. If FILE is a directory,
379attempt the checkout for all registered files beneath it." 374attempt the checkout for all registered files beneath it."
380 (if (file-directory-p file) 375 (if (file-directory-p file)
381 (mapc 'vc-rcs-checkout (vc-expand-dirs (list file))) 376 (mapc 'vc-rcs-checkout (vc-expand-dirs (list file) 'RCS))
382 (let ((file-buffer (get-file-buffer file)) 377 (let ((file-buffer (get-file-buffer file))
383 switches) 378 switches)
384 (message "Checking out %s..." file) 379 (message "Checking out %s..." file)
@@ -445,7 +440,7 @@ attempt the checkout for all registered files beneath it."
445expanded to all registered subfiles in them." 440expanded to all registered subfiles in them."
446 (if (not files) 441 (if (not files)
447 (error "RCS backend doesn't support directory-level rollback")) 442 (error "RCS backend doesn't support directory-level rollback"))
448 (dolist (file (vc-expand-dirs files)) 443 (dolist (file (vc-expand-dirs files 'RCS))
449 (let* ((discard (vc-working-revision file)) 444 (let* ((discard (vc-working-revision file))
450 (previous (if (vc-rcs-trunk-p discard) "" (vc-branch-part discard))) 445 (previous (if (vc-rcs-trunk-p discard) "" (vc-branch-part discard)))
451 (config (current-window-configuration)) 446 (config (current-window-configuration))
@@ -481,7 +476,7 @@ expanded to all registered subfiles in them."
481 "Revert FILE to the version it was based on. If FILE is a directory, 476 "Revert FILE to the version it was based on. If FILE is a directory,
482revert all registered files beneath it." 477revert all registered files beneath it."
483 (if (file-directory-p file) 478 (if (file-directory-p file)
484 (mapc 'vc-rcs-revert (vc-expand-dirs (list file))) 479 (mapc 'vc-rcs-revert (vc-expand-dirs (list file) 'RCS))
485 (vc-do-command "*vc*" 0 "co" (vc-master-name file) "-f" 480 (vc-do-command "*vc*" 0 "co" (vc-master-name file) "-f"
486 (concat (if (eq (vc-state file) 'edited) "-u" "-r") 481 (concat (if (eq (vc-state file) 'edited) "-u" "-r")
487 (vc-working-revision file))))) 482 (vc-working-revision file)))))
@@ -524,7 +519,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
524If FILE is a directory, steal the lock on all registered files beneath it. 519If FILE is a directory, steal the lock on all registered files beneath it.
525Needs RCS 5.6.2 or later for -M." 520Needs RCS 5.6.2 or later for -M."
526 (if (file-directory-p file) 521 (if (file-directory-p file)
527 (mapc 'vc-rcs-steal-lock (vc-expand-dirs (list file))) 522 (mapc 'vc-rcs-steal-lock (vc-expand-dirs (list file) 'RCS))
528 (vc-do-command "*vc*" 0 "rcs" (vc-master-name file) "-M" (concat "-u" rev)) 523 (vc-do-command "*vc*" 0 "rcs" (vc-master-name file) "-M" (concat "-u" rev))
529 ;; Do a real checkout after stealing the lock, so that we see 524 ;; Do a real checkout after stealing the lock, so that we see
530 ;; expanded headers. 525 ;; expanded headers.
@@ -548,7 +543,7 @@ Needs RCS 5.6.2 or later for -M."
548(defun vc-rcs-modify-change-comment (files rev comment) 543(defun vc-rcs-modify-change-comment (files rev comment)
549 "Modify the change comments change on FILES on a specified REV. If FILE is a 544 "Modify the change comments change on FILES on a specified REV. If FILE is a
550directory the operation is applied to all registered files beneath it." 545directory the operation is applied to all registered files beneath it."
551 (dolist (file (vc-expand-dirs files)) 546 (dolist (file (vc-expand-dirs files 'RCS))
552 (vc-do-command "*vc*" 0 "rcs" (vc-master-name file) 547 (vc-do-command "*vc*" 0 "rcs" (vc-master-name file)
553 (concat "-m" rev ":" comment)))) 548 (concat "-m" rev ":" comment))))
554 549
@@ -575,7 +570,7 @@ Remaining arguments are ignored.
575If FILE is a directory the operation is applied to all registered 570If FILE is a directory the operation is applied to all registered
576files beneath it." 571files beneath it."
577 (vc-do-command (or buffer "*vc*") 0 "rlog" 572 (vc-do-command (or buffer "*vc*") 0 "rlog"
578 (mapcar 'vc-master-name (vc-expand-dirs files))) 573 (mapcar 'vc-master-name (vc-expand-dirs files 'RCS)))
579 (with-current-buffer (or buffer "*vc*") 574 (with-current-buffer (or buffer "*vc*")
580 (vc-rcs-print-log-cleanup)) 575 (vc-rcs-print-log-cleanup))
581 (when limit 'limit-unsupported)) 576 (when limit 'limit-unsupported))
@@ -584,7 +579,7 @@ files beneath it."
584 "Get a difference report using RCS between two sets of files." 579 "Get a difference report using RCS between two sets of files."
585 (apply #'vc-do-command (or buffer "*vc-diff*") 580 (apply #'vc-do-command (or buffer "*vc-diff*")
586 (if async 'async 1) 581 (if async 'async 1)
587 "rcsdiff" (vc-expand-dirs files) 582 "rcsdiff" (vc-expand-dirs files 'RCS)
588 (append (list "-q" 583 (append (list "-q"
589 (and oldvers (concat "-r" oldvers)) 584 (and oldvers (concat "-r" oldvers))
590 (and newvers (concat "-r" newvers))) 585 (and newvers (concat "-r" newvers)))
diff --git a/lisp/vc/vc-sccs.el b/lisp/vc/vc-sccs.el
index 8a9e0b11289..514748e8283 100644
--- a/lisp/vc/vc-sccs.el
+++ b/lisp/vc/vc-sccs.el
@@ -135,13 +135,9 @@ For a description of possible values, see `vc-check-master-templates'."
135(autoload 'vc-expand-dirs "vc") 135(autoload 'vc-expand-dirs "vc")
136 136
137(defun vc-sccs-dir-status (dir update-function) 137(defun vc-sccs-dir-status (dir update-function)
138 ;; FIXME: this function should be rewritten, using `vc-expand-dirs'
139 ;; is not TRTD because it returns files from multiple backends.
140 ;; It should also return 'unregistered files.
141
142 ;; Doing lots of individual VC-state calls is painful, but 138 ;; Doing lots of individual VC-state calls is painful, but
143 ;; there is no better option in SCCS-land. 139 ;; there is no better option in SCCS-land.
144 (let ((flist (vc-expand-dirs (list dir))) 140 (let ((flist (vc-expand-dirs (list dir) 'SCCS))
145 (result nil)) 141 (result nil))
146 (dolist (file flist) 142 (dolist (file flist)
147 (let ((state (vc-state file)) 143 (let ((state (vc-state file))
@@ -232,7 +228,7 @@ expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile."
232 228
233(defun vc-sccs-checkin (files comment) 229(defun vc-sccs-checkin (files comment)
234 "SCCS-specific version of `vc-backend-checkin'." 230 "SCCS-specific version of `vc-backend-checkin'."
235 (dolist (file (vc-expand-dirs files)) 231 (dolist (file (vc-expand-dirs files 'SCCS))
236 (apply 'vc-sccs-do-command nil 0 "delta" (vc-master-name file) 232 (apply 'vc-sccs-do-command nil 0 "delta" (vc-master-name file)
237 (concat "-y" comment) 233 (concat "-y" comment)
238 (vc-switches 'SCCS 'checkin)) 234 (vc-switches 'SCCS 'checkin))
@@ -255,7 +251,7 @@ If FILE is a directory, all version-controlled files beneath are checked out.
255EDITABLE non-nil means that the file should be writable and 251EDITABLE non-nil means that the file should be writable and
256locked. REV is the revision to check out." 252locked. REV is the revision to check out."
257 (if (file-directory-p file) 253 (if (file-directory-p file)
258 (mapc 'vc-sccs-checkout (vc-expand-dirs (list file))) 254 (mapc 'vc-sccs-checkout (vc-expand-dirs (list file) 'SCCS))
259 (let ((file-buffer (get-file-buffer file)) 255 (let ((file-buffer (get-file-buffer file))
260 switches) 256 switches)
261 (message "Checking out %s..." file) 257 (message "Checking out %s..." file)
@@ -284,7 +280,7 @@ locked. REV is the revision to check out."
284(defun vc-sccs-rollback (files) 280(defun vc-sccs-rollback (files)
285 "Roll back, undoing the most recent checkins of FILES. Directories 281 "Roll back, undoing the most recent checkins of FILES. Directories
286are expanded to all version-controlled subfiles." 282are expanded to all version-controlled subfiles."
287 (setq files (vc-expand-dirs files)) 283 (setq files (vc-expand-dirs files 'SCCS))
288 (if (not files) 284 (if (not files)
289 (error "SCCS backend doesn't support directory-level rollback")) 285 (error "SCCS backend doesn't support directory-level rollback"))
290 (dolist (file files) 286 (dolist (file files)
@@ -301,7 +297,7 @@ are expanded to all version-controlled subfiles."
301 "Revert FILE to the version it was based on. If FILE is a directory, 297 "Revert FILE to the version it was based on. If FILE is a directory,
302revert all subfiles." 298revert all subfiles."
303 (if (file-directory-p file) 299 (if (file-directory-p file)
304 (mapc 'vc-sccs-revert (vc-expand-dirs (list file))) 300 (mapc 'vc-sccs-revert (vc-expand-dirs (list file) 'SCCS))
305 (vc-sccs-do-command nil 0 "unget" (vc-master-name file)) 301 (vc-sccs-do-command nil 0 "unget" (vc-master-name file))
306 (vc-sccs-do-command nil 0 "get" (vc-master-name file)) 302 (vc-sccs-do-command nil 0 "get" (vc-master-name file))
307 ;; Checking out explicit revisions is not supported under SCCS, yet. 303 ;; Checking out explicit revisions is not supported under SCCS, yet.
@@ -312,7 +308,7 @@ revert all subfiles."
312(defun vc-sccs-steal-lock (file &optional rev) 308(defun vc-sccs-steal-lock (file &optional rev)
313 "Steal the lock on the current workfile for FILE and revision REV." 309 "Steal the lock on the current workfile for FILE and revision REV."
314 (if (file-directory-p file) 310 (if (file-directory-p file)
315 (mapc 'vc-sccs-steal-lock (vc-expand-dirs (list file))) 311 (mapc 'vc-sccs-steal-lock (vc-expand-dirs (list file) 'SCCS))
316 (vc-sccs-do-command nil 0 "unget" 312 (vc-sccs-do-command nil 0 "unget"
317 (vc-master-name file) "-n" (if rev (concat "-r" rev))) 313 (vc-master-name file) "-n" (if rev (concat "-r" rev)))
318 (vc-sccs-do-command nil 0 "get" 314 (vc-sccs-do-command nil 0 "get"
@@ -320,7 +316,7 @@ revert all subfiles."
320 316
321(defun vc-sccs-modify-change-comment (files rev comment) 317(defun vc-sccs-modify-change-comment (files rev comment)
322 "Modify (actually, append to) the change comments for FILES on a specified REV." 318 "Modify (actually, append to) the change comments for FILES on a specified REV."
323 (dolist (file (vc-expand-dirs files)) 319 (dolist (file (vc-expand-dirs files 'SCCS))
324 (vc-sccs-do-command nil 0 "cdc" (vc-master-name file) 320 (vc-sccs-do-command nil 0 "cdc" (vc-master-name file)
325 (concat "-y" comment) (concat "-r" rev)))) 321 (concat "-y" comment) (concat "-r" rev))))
326 322
@@ -332,7 +328,7 @@ revert all subfiles."
332(defun vc-sccs-print-log (files buffer &optional _shortlog _start-revision-ignored limit) 328(defun vc-sccs-print-log (files buffer &optional _shortlog _start-revision-ignored limit)
333 "Print commit log associated with FILES into specified BUFFER. 329 "Print commit log associated with FILES into specified BUFFER.
334Remaining arguments are ignored." 330Remaining arguments are ignored."
335 (setq files (vc-expand-dirs files)) 331 (setq files (vc-expand-dirs files 'SCCS))
336 (vc-sccs-do-command buffer 0 "prs" (mapcar 'vc-master-name files)) 332 (vc-sccs-do-command buffer 0 "prs" (mapcar 'vc-master-name files))
337 (when limit 'limit-unsupported)) 333 (when limit 'limit-unsupported))
338 334
@@ -344,7 +340,7 @@ Remaining arguments are ignored."
344;; FIXME use sccsdiff if present? 340;; FIXME use sccsdiff if present?
345(defun vc-sccs-diff (files &optional _async oldvers newvers buffer) 341(defun vc-sccs-diff (files &optional _async oldvers newvers buffer)
346 "Get a difference report using SCCS between two filesets." 342 "Get a difference report using SCCS between two filesets."
347 (setq files (vc-expand-dirs files)) 343 (setq files (vc-expand-dirs files 'SCCS))
348 (setq oldvers (vc-sccs-lookup-triple (car files) oldvers)) 344 (setq oldvers (vc-sccs-lookup-triple (car files) oldvers))
349 (setq newvers (vc-sccs-lookup-triple (car files) newvers)) 345 (setq newvers (vc-sccs-lookup-triple (car files) newvers))
350 (or buffer (setq buffer "*vc-diff*")) 346 (or buffer (setq buffer "*vc-diff*"))
diff --git a/lisp/vc/vc-src.el b/lisp/vc/vc-src.el
index f3d0585b30c..9e17d058a91 100644
--- a/lisp/vc/vc-src.el
+++ b/lisp/vc/vc-src.el
@@ -180,13 +180,8 @@ For a description of possible values, see `vc-check-master-templates'."
180(autoload 'vc-expand-dirs "vc") 180(autoload 'vc-expand-dirs "vc")
181 181
182(defun vc-src-dir-status (dir update-function) 182(defun vc-src-dir-status (dir update-function)
183 ;; FIXME: this function should be rewritten or `vc-expand-dirs'
184 ;; should be changed to take a backend parameter. Using
185 ;; `vc-expand-dirs' is not TRTD because it returns files from
186 ;; multiple backends. It should also return 'unregistered files.
187
188 ;; FIXME: Use one src status -a call for this 183 ;; FIXME: Use one src status -a call for this
189 (let ((flist (vc-expand-dirs (list dir))) 184 (let ((flist (vc-expand-dirs (list dir) 'SRC))
190 (result nil)) 185 (result nil))
191 (dolist (file flist) 186 (dolist (file flist)
192 (let ((state (vc-state file)) 187 (let ((state (vc-state file))
@@ -253,13 +248,13 @@ REV is the revision to check out into WORKFILE."
253 "Revert FILE to the version it was based on. If FILE is a directory, 248 "Revert FILE to the version it was based on. If FILE is a directory,
254revert all registered files beneath it." 249revert all registered files beneath it."
255 (if (file-directory-p file) 250 (if (file-directory-p file)
256 (mapc 'vc-src-revert (vc-expand-dirs (list file))) 251 (mapc 'vc-src-revert (vc-expand-dirs (list file) 'SRC))
257 (vc-src-command nil file "co"))) 252 (vc-src-command nil file "co")))
258 253
259(defun vc-src-modify-change-comment (files rev comment) 254(defun vc-src-modify-change-comment (files rev comment)
260 "Modify the change comments change on FILES on a specified REV. If FILE is a 255 "Modify the change comments change on FILES on a specified REV. If FILE is a
261directory the operation is applied to all registered files beneath it." 256directory the operation is applied to all registered files beneath it."
262 (dolist (file (vc-expand-dirs files)) 257 (dolist (file (vc-expand-dirs files 'SRC))
263 (vc-src-command nil file "amend" "-m" comment rev))) 258 (vc-src-command nil file "amend" "-m" comment rev)))
264 259
265;; History functions 260;; History functions
@@ -271,7 +266,7 @@ directory the operation is applied to all registered files beneath it."
271 (repeat :tag "Argument List" :value ("") string)) 266 (repeat :tag "Argument List" :value ("") string))
272 :group 'vc-src) 267 :group 'vc-src)
273 268
274(defun vc-src-print-log (files buffer &optional shortlog start-revision limit) 269(defun vc-src-print-log (files buffer &optional shortlog _start-revision limit)
275 "Print commit log associated with FILES into specified BUFFER. 270 "Print commit log associated with FILES into specified BUFFER.
276If SHORTLOG is non-nil, use the list method. 271If SHORTLOG is non-nil, use the list method.
277If START-REVISION is non-nil, it is the newest revision to show. 272If START-REVISION is non-nil, it is the newest revision to show.
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 52deb13e4dd..ad3a2c49735 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -631,9 +631,6 @@
631;; 631;;
632;;;; Internal cleanups: 632;;;; Internal cleanups:
633;; 633;;
634;; - vc-expand-dirs should take a backend parameter and only look for
635;; files managed by that backend.
636;;
637;; - Another important thing: merge all the status-like backend operations. 634;; - Another important thing: merge all the status-like backend operations.
638;; We should remove dir-status, state, and dir-status-files, and 635;; We should remove dir-status, state, and dir-status-files, and
639;; replace them with just `status' which takes a fileset and a continuation 636;; replace them with just `status' which takes a fileset and a continuation
@@ -955,14 +952,14 @@ responsible for FILE is returned."
955 (throw 'found backend)))) 952 (throw 'found backend))))
956 (error "No VC backend is responsible for %s" file))) 953 (error "No VC backend is responsible for %s" file)))
957 954
958(defun vc-expand-dirs (file-or-dir-list) 955(defun vc-expand-dirs (file-or-dir-list backend)
959 "Expands directories in a file list specification. 956 "Expands directories in a file list specification.
960Within directories, only files already under version control are noticed." 957Within directories, only files already under version control are noticed."
961 (let ((flattened '())) 958 (let ((flattened '()))
962 (dolist (node file-or-dir-list) 959 (dolist (node file-or-dir-list)
963 (when (file-directory-p node) 960 (when (file-directory-p node)
964 (vc-file-tree-walk 961 (vc-file-tree-walk
965 node (lambda (f) (when (vc-backend f) (push f flattened))))) 962 node (lambda (f) (when (eq (vc-backend f) backend) (push f flattened)))))
966 (unless (file-directory-p node) (push node flattened))) 963 (unless (file-directory-p node) (push node flattened)))
967 (nreverse flattened))) 964 (nreverse flattened)))
968 965
@@ -1000,8 +997,8 @@ Otherwise, throw an error.
1000STATE-MODEL-ONLY-FILES if non-nil, means that the caller needs 997STATE-MODEL-ONLY-FILES if non-nil, means that the caller needs
1001the FILESET-ONLY-FILES STATE and MODEL info. Otherwise, that 998the FILESET-ONLY-FILES STATE and MODEL info. Otherwise, that
1002part may be skipped. 999part may be skipped.
1003BEWARE: this function may change the 1000
1004current buffer." 1001BEWARE: this function may change the current buffer."
1005 ;; FIXME: OBSERVER is unused. The name is not intuitive and is not 1002 ;; FIXME: OBSERVER is unused. The name is not intuitive and is not
1006 ;; documented. It's set to t when called from diff and print-log. 1003 ;; documented. It's set to t when called from diff and print-log.
1007 (let (backend) 1004 (let (backend)