aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré Spiegel1995-08-29 10:52:14 +0000
committerAndré Spiegel1995-08-29 10:52:14 +0000
commit8dd7134575917efb320054b8eb3132736b3cd7a6 (patch)
treec8298a5569e1cf540d6996a6ea27d6f686a591f8
parentb23a2306f755d4e65552dfe8cc32f8bc67460f87 (diff)
downloademacs-8dd7134575917efb320054b8eb3132736b3cd7a6.tar.gz
emacs-8dd7134575917efb320054b8eb3132736b3cd7a6.zip
(vc-dired-update-line): Don't use dired-do-redisplay.
(vc-next-action-dired): Adjust default-directory before calling vc-next-action-on-file. (vc-next-action-on-file): Handle CVS merge in vc-dired-mode correctly. (vc-next-action): Ask for a check-in comment if there are "added" CVS files. Don't special-case single files in vc-dired-mode. (vc-file-clear-masterprops): Typo fix. (vc-latest-on-branch-p): Always true for CVS. (vc-directory): Header change. Do display the buffer, even if no locked/registered files were found.
-rw-r--r--lisp/vc.el100
1 files changed, 62 insertions, 38 deletions
diff --git a/lisp/vc.el b/lisp/vc.el
index eda2225c1bf..96f6d6fd66c 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -303,7 +303,7 @@ If nil, VC itself computes this value when it is first needed.")
303 (progn ;; RCS 303 (progn ;; RCS
304 (vc-file-setprop file 'vc-default-branch nil) 304 (vc-file-setprop file 'vc-default-branch nil)
305 (vc-file-setprop file 'vc-head-version nil) 305 (vc-file-setprop file 'vc-head-version nil)
306 (vc-file-setprop file 'vc-master-workfile--version nil) 306 (vc-file-setprop file 'vc-master-workfile-version nil)
307 (vc-file-setprop file 'vc-master-locks nil)) 307 (vc-file-setprop file 'vc-master-locks nil))
308 (progn 308 (progn
309 (vc-file-setprop file 'vc-cvs-status nil)))) 309 (vc-file-setprop file 'vc-cvs-status nil))))
@@ -345,8 +345,7 @@ If nil, VC itself computes this value when it is first needed.")
345 (kill-buffer (get-buffer "*vc-info*"))) 345 (kill-buffer (get-buffer "*vc-info*")))
346 (string= tip-version workfile-version)))) 346 (string= tip-version workfile-version))))
347 ;; CVS 347 ;; CVS
348 (or (string= (vc-workfile-version file) "0") ;; added but not committed. 348 t))
349 (string= (vc-workfile-version file) (vc-latest-version file)))))
350 349
351(defun vc-registration-error (file) 350(defun vc-registration-error (file)
352 (if file 351 (if file
@@ -572,7 +571,7 @@ to an optional list of FLAGS."
572 ;;; If comment is specified, it will be used as an admin or checkin comment. 571 ;;; If comment is specified, it will be used as an admin or checkin comment.
573 (let ((vc-file (vc-name file)) 572 (let ((vc-file (vc-name file))
574 (vc-type (vc-backend file)) 573 (vc-type (vc-backend file))
575 owner version) 574 owner version buffer)
576 (cond 575 (cond
577 576
578 ;; if there is no master file corresponding, create one 577 ;; if there is no master file corresponding, create one
@@ -588,14 +587,23 @@ to an optional list of FLAGS."
588 ((and (eq vc-type 'CVS) 587 ((and (eq vc-type 'CVS)
589 (or (eq (vc-cvs-status file) 'needs-checkout) 588 (or (eq (vc-cvs-status file) 'needs-checkout)
590 (eq (vc-cvs-status file) 'needs-merge))) 589 (eq (vc-cvs-status file) 'needs-merge)))
591 (vc-buffer-sync) 590 (if (or vc-dired-mode
592 (if (yes-or-no-p (format "%s is not up-to-date. Merge in changes now? " 591 (yes-or-no-p
593 (buffer-name))) 592 (format "%s is not up-to-date. Merge in changes now? "
593 (buffer-name))))
594 (progn 594 (progn
595 (if (and (buffer-modified-p) 595 (if vc-dired-mode
596 (and (setq buffer (get-file-buffer file))
597 (buffer-modified-p buffer)
598 (switch-to-buffer-other-window buffer)
599 (vc-buffer-sync t))
600 (setq buffer (current-buffer))
601 (vc-buffer-sync t))
602 (if (and buffer (buffer-modified-p buffer)
596 (not (yes-or-no-p 603 (not (yes-or-no-p
597 "Buffer %s modified; merge file on disc anyhow? " 604 (format
598 (buffer-name)))) 605 "Buffer %s modified; merge file on disc anyhow? "
606 (buffer-name buffer)))))
599 (error "Merge aborted")) 607 (error "Merge aborted"))
600 (if (not (zerop (vc-backend-merge-news file))) 608 (if (not (zerop (vc-backend-merge-news file)))
601 ;; Overlaps detected - what now? Should use some 609 ;; Overlaps detected - what now? Should use some
@@ -603,7 +611,8 @@ to an optional list of FLAGS."
603 ;; emerge, but for now, simply warn the user with a 611 ;; emerge, but for now, simply warn the user with a
604 ;; message. 612 ;; message.
605 (message "Conflicts detected!")) 613 (message "Conflicts detected!"))
606 (vc-resynch-window file t (not (buffer-modified-p)))) 614 (and buffer
615 (vc-resynch-buffer file t (not (buffer-modified-p buffer)))))
607 (error "%s needs update" (buffer-name)))) 616 (error "%s needs update" (buffer-name))))
608 617
609 ;; if there is no lock on the file, assert one and get it 618 ;; if there is no lock on the file, assert one and get it
@@ -689,12 +698,17 @@ to an optional list of FLAGS."
689 ;; Do a vc-next-action-on-file on all the marked files, possibly 698 ;; Do a vc-next-action-on-file on all the marked files, possibly
690 ;; passing on the log comment we've just entered. 699 ;; passing on the log comment we've just entered.
691 (let ((configuration (current-window-configuration)) 700 (let ((configuration (current-window-configuration))
692 (dired-buffer (current-buffer))) 701 (dired-buffer (current-buffer))
702 (dired-dir default-directory))
693 (dired-map-over-marks 703 (dired-map-over-marks
694 (let ((file (dired-get-filename)) p) 704 (let ((file (dired-get-filename)) p)
695 (message "Processing %s..." file) 705 (message "Processing %s..." file)
706 ;; Adjust the default directory so that checkouts
707 ;; go to the right place.
708 (setq default-directory (file-name-directory file))
696 (vc-next-action-on-file file nil comment) 709 (vc-next-action-on-file file nil comment)
697 (set-buffer dired-buffer) 710 (set-buffer dired-buffer)
711 (setq default-directory dired-dir)
698 (vc-dired-update-line file) 712 (vc-dired-update-line file)
699 (set-window-configuration configuration) 713 (set-window-configuration configuration)
700 (message "Processing %s...done" file)) 714 (message "Processing %s...done" file))
@@ -745,13 +759,12 @@ merge in the changes into your working copy."
745 (catch 'nogo 759 (catch 'nogo
746 (if vc-dired-mode 760 (if vc-dired-mode
747 (let ((files (dired-get-marked-files))) 761 (let ((files (dired-get-marked-files)))
748 (if (= (length files) 1) 762 (if (string= ""
749 (find-file-other-window (car files)) 763 (mapconcat
750 (if (string= ""
751 (mapconcat
752 (function (lambda (f) 764 (function (lambda (f)
753 (if (eq (vc-backend f) 'CVS) 765 (if (eq (vc-backend f) 'CVS)
754 (if (eq (vc-cvs-status f) 'locally-modified) 766 (if (or (eq (vc-cvs-status f) 'locally-modified)
767 (eq (vc-cvs-status f) 'locally-added))
755 "@" "") 768 "@" "")
756 (if (vc-locking-user f) "@" "")))) 769 (if (vc-locking-user f) "@" ""))))
757 files "")) 770 files ""))
@@ -759,7 +772,7 @@ merge in the changes into your working copy."
759 (vc-start-entry nil nil nil 772 (vc-start-entry nil nil nil
760 "Enter a change comment for the marked files." 773 "Enter a change comment for the marked files."
761 'vc-next-action-dired)) 774 'vc-next-action-dired))
762 (throw 'nogo nil)))) 775 (throw 'nogo nil)))
763 (while vc-parent-buffer 776 (while vc-parent-buffer
764 (pop-to-buffer vc-parent-buffer)) 777 (pop-to-buffer vc-parent-buffer))
765 (if buffer-file-name 778 (if buffer-file-name
@@ -1284,10 +1297,21 @@ on a buffer attached to the file named in the current Dired buffer line."
1284 1297
1285(defun vc-dired-update-line (file) 1298(defun vc-dired-update-line (file)
1286 ;; Update the vc-dired listing line of file -- it is assumed 1299 ;; Update the vc-dired listing line of file -- it is assumed
1287 ;; that point is already on this line. 1300 ;; that point is already on this line. Don't use dired-do-redisplay
1288 (dired-do-redisplay 1) 1301 ;; for this, because it cannot handle the way vc-dired deals with
1289 (dired-previous-line 1) 1302 ;; subdirectories.
1290 (beginning-of-line) 1303 (beginning-of-line)
1304 (forward-char 2)
1305 (let ((start (point)))
1306 (forward-line 1)
1307 (beginning-of-line)
1308 (delete-region start (point))
1309 (insert-directory file dired-listing-switches)
1310 (forward-line -1)
1311 (end-of-line)
1312 (delete-char (- (length file)))
1313 (insert (substring file (length (expand-file-name default-directory))))
1314 (goto-char start))
1291 (vc-dired-reformat-line (vc-dired-state-info file))) 1315 (vc-dired-reformat-line (vc-dired-state-info file)))
1292 1316
1293;;; Note in Emacs 18 the following defun gets overridden 1317;;; Note in Emacs 18 the following defun gets overridden
@@ -1332,22 +1356,20 @@ in all these directories. With a prefix argument, it lists all files."
1332 (cons dir (nreverse filelist)) 1356 (cons dir (nreverse filelist))
1333 dired-listing-switches) 1357 dired-listing-switches)
1334 (setq dired-buf (current-buffer)) 1358 (setq dired-buf (current-buffer))
1335 (setq nonempty (not (eq 2 (count-lines (point-min) 1359 (setq nonempty (not (eq 0 (length filelist)))))))
1336 (point-max)))))))) 1360 (switch-to-buffer dired-buf)
1361 (vc-dired-mode)
1362 ;; Make a few modifications to the header
1363 (setq buffer-read-only nil)
1364 (goto-char (point-min))
1365 (forward-line 1) ;; Skip header line
1366 (let ((start (point))) ;; Erase (but don't remove) the
1367 (end-of-line) ;; "wildcard" line.
1368 (delete-region start (point)))
1369 (beginning-of-line)
1337 (if nonempty 1370 (if nonempty
1338 (progn 1371 (progn
1339 (switch-to-buffer dired-buf) 1372 ;; Plug the version information into the individual lines
1340 (vc-dired-mode)
1341 ;; Make a few aesthetical modifications to the header
1342 (setq buffer-read-only nil)
1343 (goto-char (point-min))
1344 (insert "\n") ;; Insert a blank line
1345 (forward-line 1) ;; Skip header line
1346 (let ((start (point))) ;; Erase (but don't remove) the
1347 (end-of-line) ;; "wildcard" line.
1348 (delete-region start (point)))
1349 (beginning-of-line)
1350 ;; Now plug the version information into the individual lines
1351 (mapcar 1373 (mapcar
1352 (function 1374 (function
1353 (lambda (x) 1375 (lambda (x)
@@ -1357,9 +1379,11 @@ in all these directories. With a prefix argument, it lists all files."
1357 (nreverse statelist)) 1379 (nreverse statelist))
1358 (setq buffer-read-only t) 1380 (setq buffer-read-only t)
1359 (goto-char (point-min)) 1381 (goto-char (point-min))
1360 (dired-next-line 3) 1382 (dired-next-line 2)
1361 ) 1383 )
1362 (kill-buffer dired-buf) 1384 (dired-next-line 1)
1385 (insert " ")
1386 (setq buffer-read-only t)
1363 (message "No files are currently %s under %s" 1387 (message "No files are currently %s under %s"
1364 (if verbose "registered" "locked") default-directory)) 1388 (if verbose "registered" "locked") default-directory))
1365 )) 1389 ))
@@ -1883,7 +1907,7 @@ From a program, any arguments are passed to the `rcs2log' script."
1883 (setq failed nil)) 1907 (setq failed nil))
1884 (and failed (file-exists-p filename) (delete-file filename)))) 1908 (and failed (file-exists-p filename) (delete-file filename))))
1885 ;; default for verbose checkout: clear the sticky tag 1909 ;; default for verbose checkout: clear the sticky tag
1886 ;; so that the actual update will go to the head of the trunk 1910 ;; so that the actual update will get the head of the trunk
1887 (and rev (string= rev "") 1911 (and rev (string= rev "")
1888 (vc-do-command nil 0 "cvs" file 'WORKFILE "update" "-A")) 1912 (vc-do-command nil 0 "cvs" file 'WORKFILE "update" "-A"))
1889 ;; If a revision was specified, check that out. 1913 ;; If a revision was specified, check that out.