comparison lisp/vc.el @ 927:587a08c3a70b

*** empty log message ***
author Jim Blandy <jimb@redhat.com>
date Tue, 04 Aug 1992 07:27:12 +0000
parents 4a1ac370d57a
children ba6a993500d4
comparison
equal deleted inserted replaced
926:faa1d84dfe50 927:587a08c3a70b
230 (vc-file-setprop file 'vc-checkout-time '(0 . 0)) 230 (vc-file-setprop file 'vc-checkout-time '(0 . 0))
231 nil 231 nil
232 )) 232 ))
233 ))) 233 )))
234 234
235 ;; Here's the major entry point 235 ;; Here's the major entry point.
236 236
237 ;;;###autoload
237 (defun vc-next-action (verbose) 238 (defun vc-next-action (verbose)
238 "Do the next logical checkin or checkout operation on the current file. 239 "Do the next logical checkin or checkout operation on the current file.
239 If the file is not already registered, this registers it for version 240 If the file is not already registered, this registers it for version
240 control and then retrieves a writeable, locked copy for editing. 241 control and then retrieves a writeable, locked copy for editing.
241 If the file is registered and not locked by anyone, this checks out 242 If the file is registered and not locked by anyone, this checks out
297 (vc-checkin file version)))))) 298 (vc-checkin file version))))))
298 (error "There is no file associated with buffer %s" (buffer-name)))) 299 (error "There is no file associated with buffer %s" (buffer-name))))
299 300
300 ;;; These functions help the vc-next-action entry point 301 ;;; These functions help the vc-next-action entry point
301 302
303 ;;;###autoload
302 (defun vc-register (&optional override) 304 (defun vc-register (&optional override)
303 "Register the current file into your version-control system." 305 "Register the current file into your version-control system."
304 (interactive "P") 306 (interactive "P")
305 (if (vc-name buffer-file-name) 307 (if (vc-name buffer-file-name)
306 (error "This file is already registered.")) 308 (error "This file is already registered."))
471 (mark-page) 473 (mark-page)
472 (narrow-to-page)) 474 (narrow-to-page))
473 475
474 ;; Additional entry points for examining version histories 476 ;; Additional entry points for examining version histories
475 477
478 ;;;###autoload
476 (defun vc-diff (historic) 479 (defun vc-diff (historic)
477 "Display diffs between file versions." 480 "Display diffs between file versions."
478 (interactive "P") 481 (interactive "P")
479 (if historic 482 (if historic
480 (call-interactively 'vc-version-diff) 483 (call-interactively 'vc-version-diff)
536 ) 539 )
537 ) 540 )
538 541
539 ;; Header-insertion code 542 ;; Header-insertion code
540 543
544 ;;;###autoload
541 (defun vc-insert-headers () 545 (defun vc-insert-headers ()
542 "Insert headers in a file for use with your version-control system. 546 "Insert headers in a file for use with your version-control system.
543 Headers desired are inserted at the start of the buffer, and are pulled from 547 Headers desired are inserted at the start of the buffer, and are pulled from
544 the variable vc-header-strings" 548 the variable vc-header-strings"
545 (interactive) 549 (interactive)
565 ) 569 )
566 ))))) 570 )))))
567 571
568 ;; Status-checking functions 572 ;; Status-checking functions
569 573
574 ;;;###autoload
570 (defun vc-directory (verbose) 575 (defun vc-directory (verbose)
571 "Show version-control status of all files under the current directory." 576 "Show version-control status of all files under the current directory."
572 (interactive "P") 577 (interactive "P")
573 (let ((dir (substring default-directory 0 (1- (length default-directory)))) 578 (let ((dir (substring default-directory 0 (1- (length default-directory))))
574 nonempty) 579 nonempty)
634 (if (and (vc-registered f) (vc-locking-user f)) 639 (if (and (vc-registered f) (vc-locking-user f))
635 (throw 'quiet nil)))) 640 (throw 'quiet nil))))
636 dir) 641 dir)
637 t))) 642 t)))
638 643
644 ;;;###autoload
639 (defun vc-create-snapshot (name) 645 (defun vc-create-snapshot (name)
640 "Make a snapshot called NAME. 646 "Make a snapshot called NAME.
641 The snapshot is made from all registered files at or below the current 647 The snapshot is made from all registered files at or below the current
642 directory. For each file, the version level of its latest 648 directory. For each file, the version level of its latest
643 version becomes part of the named configuration." 649 version becomes part of the named configuration."
650 (vc-name f) 656 (vc-name f)
651 (vc-backend-assign-name f name)))) 657 (vc-backend-assign-name f name))))
652 default-directory) 658 default-directory)
653 )) 659 ))
654 660
661 ;;;###autoload
655 (defun vc-retrieve-snapshot (name) 662 (defun vc-retrieve-snapshot (name)
656 "Retrieve the snapshot called NAME. 663 "Retrieve the snapshot called NAME.
657 This function fails if any files are locked at or below the current directory 664 This function fails if any files are locked at or below the current directory
658 Otherwise, all registered files are checked out (unlocked) at their version 665 Otherwise, all registered files are checked out (unlocked) at their version
659 levels in the snapshot." 666 levels in the snapshot."
668 default-directory) 675 default-directory)
669 )) 676 ))
670 677
671 ;; Miscellaneous other entry points 678 ;; Miscellaneous other entry points
672 679
680 ;;;###autoload
673 (defun vc-print-log () 681 (defun vc-print-log ()
674 "List the change log of the current buffer in a window." 682 "List the change log of the current buffer in a window."
675 (interactive) 683 (interactive)
676 (if (and buffer-file-name (vc-name buffer-file-name)) 684 (if (and buffer-file-name (vc-name buffer-file-name))
677 (progn 685 (progn
681 ) 689 )
682 (error "There is no version-control master associated with this buffer") 690 (error "There is no version-control master associated with this buffer")
683 ) 691 )
684 ) 692 )
685 693
694 ;;;###autoload
686 (defun vc-revert-buffer () 695 (defun vc-revert-buffer ()
687 "Revert the current buffer's file back to the latest version." 696 "Revert the current buffer's file back to the latest version."
688 (interactive) 697 (interactive)
689 (let ((file buffer-file-name) 698 (let ((file buffer-file-name)
690 (obuf (current-buffer)) (changed (vc-diff nil))) 699 (obuf (current-buffer)) (changed (vc-diff nil)))
698 (vc-backend-revert file) 707 (vc-backend-revert file)
699 (vc-resynch-window file t) 708 (vc-resynch-window file t)
700 ) 709 )
701 ) 710 )
702 711
712 ;;;###autoload
703 (defun vc-cancel-version (norevert) 713 (defun vc-cancel-version (norevert)
704 "Undo your latest checkin." 714 "Undo your latest checkin."
705 (interactive "P") 715 (interactive "P")
706 (let ((target (vc-your-latest-version (buffer-file-name)))) 716 (let ((target (vc-your-latest-version (buffer-file-name))))
707 (if (null target) 717 (if (null target)
742 (vc-backend-dispatch file 752 (vc-backend-dispatch file
743 (vc-record-rename old new) 753 (vc-record-rename old new)
744 nil) 754 nil)
745 ) 755 )
746 756
757 ;;;###autoload
747 (defun vc-update-change-log () 758 (defun vc-update-change-log ()
748 "Find change log file and add entries from recent RCS logs." 759 "Find change log file and add entries from recent RCS logs."
749 (interactive) 760 (interactive)
750 (find-file-other-window "ChangeLog") 761 (find-file-other-window "ChangeLog")
751 (vc-buffer-sync) 762 (vc-buffer-sync)