• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/

Lines Matching +defs:window +defs:system +defs:version

1 ;;; vc.el --- drive a version-control system from within Emacs
16 ;; the Free Software Foundation; either version 2, or (at your option)
17 ;; any later version.
49 ;; Supported version-control systems presently include CVS, RCS, GNU Arch,
53 ;; appropriate, VC finds out which version you have, and allows or
56 ;; Even initial checkins will fail if your RCS version is so old that ci
71 ;; version-control operations to a minimum. Some names are only computed
72 ;; once. If you perform version control operations with the backend while
81 ;; VC can use arbitrary version control systems as a backend. To add
93 ;; `vc-sys-workfile-version' should compute the workfile version and
112 ;; Return the current version control state of FILE. For a list of
120 ;; If provided, this function is used to estimate the version control
127 ;; If provided, this function is used to find the version control state
132 ;; * workfile-version (file)
134 ;; Return the current workfile version of FILE.
138 ;; Return non-nil if the current workfile version of FILE is the latest
151 ;; version. This function should do a brief comparison of FILE's
152 ;; contents with those of the master version. If the backend does not
179 ;; - init-version (file)
181 ;; The initial version to use when registering FILE if one is not
183 ;; vc-default-init-version is used instead.
218 ;; * find-version (file rev buffer)
230 ;; is the revision to check out (default is current workfile version).
238 ;; Revert FILE back to the current workfile version. If optional
240 ;; already been reverted from a version backup, and this function
243 ;; - cancel-version (file editable)
245 ;; Cancel the current workfile version of FILE, i.e. remove it from the
249 ;; version is caught as an error.
259 ;; - steal-lock (file &optional version)
261 ;; Steal any lock on the current workfile version of FILE, or on
273 ;; - show-log-entry (version)
276 ;; and make sure it is displayed in the buffer's window. The default
311 ;; version (as found in the repository) as the older version; if
313 ;; version. This function should pass the value of (vc-switches
328 ;; of FILE in BUF, relative to version REV. Annotation means each line
329 ;; of FILE displayed is prefixed with version information associated with
376 ;; Give name NAME to the current version of FILE, assuming it is
377 ;; up-to-date. Only used by the default version of `create-snapshot'.
390 ;; - make-version-backups-p (file)
394 ;; `revert' operations itself, without calling the backend system. The
405 ;; - previous-version (file rev)
407 ;; Return the version number that precedes REV for FILE, or nil if no such
408 ;; version exists.
410 ;; - next-version (file rev)
412 ;; Return the version number that follows REV for FILE, or nil if no such
413 ;; version exists.
417 ;; Return non-nil if the current buffer contains any version headers.
421 ;; In the current buffer, reset all version headers to their unexpanded
423 ;; for this backend uses the version headers to determine the state of
425 ;; version control state in such a way that the headers would give
468 "Version-control system in Emacs."
476 (defcustom vc-delete-logbuf-window t
477 "If non-nil, delete the *VC-log* buffer and window after each logical action.
489 (defcustom vc-default-init-version "1.1"
490 "A string used as the default version number when a new file is registered.
495 :version "20.3")
536 :version "21.1")
542 :version "20.3")
548 :version "20.3")
560 contain switches that are specific to version control, but not
568 :version "21.1")
584 :version "22.1")
592 :version "21.1")
621 version control backend imposes itself."
707 (define-key m "N" 'vc-annotate-next-version)
708 (define-key m "P" 'vc-annotate-prev-version)
709 (define-key m "W" 'vc-annotate-workfile-version)
720 the file's version control type in `vc-header-alist'."
768 (defvar vc-log-version)
793 "Return the minor version number of a revision number REV."
797 (defun vc-default-previous-version (backend file rev)
798 "Return the version number immediately preceding REV for FILE,
799 or nil if there is no previous version. This default
800 implementation works for MAJOR.MINOR-style version numbers as
806 ;; version does probably not start a branch or release
813 ;; return version of starting point
816 (defun vc-default-next-version (backend file rev)
817 "Return the version number immediately following REV for FILE,
818 or nil if there is no next version. This default implementation
819 works for MAJOR.MINOR-style version numbers as used by RCS
821 (when (not (string= rev (vc-workfile-version file)))
861 `save-excursion'. If FILE is not under version control, or locked by
867 (error "File not under version control: `%s'" file))
879 "Edit FILE under version control, executing body.
893 "Make sure that the current buffer visits a version-controlled file."
901 (error "File %s is not under version control" buffer-file-name)))))
992 ;; it doesn't look at the actual file-system to see if symlinks
1011 (unless (active-minibuffer-window)
1016 `(unless (active-minibuffer-window)
1025 (shrink-window-if-larger-than-buffer)
1150 Try to be clever in the face of changes due to expanded version control
1184 "Do The Right Thing for a given FILE under version control.
1188 state version)
1191 (switch-to-buffer-other-window visited)
1222 ;; go to a different version
1223 (setq version
1224 (read-string "Branch, version, or backend to move to: "))
1225 (let ((vsym (intern-soft (upcase version))))
1229 version))))
1260 (if (not visited) (find-file-other-window file))
1261 (if (yes-or-no-p "Revert to master version? ")
1266 (setq version (read-string "New version or backend: "))
1267 (let ((vsym (intern (upcase version))))
1270 (vc-checkin file version comment)))))))
1279 (vc-workfile-version file))
1285 "%s is not up-to-date. Get latest version? "
1289 (yes-or-no-p "Lock this version? "))
1303 (if (not visited) (find-file-other-window file))
1304 (if (save-window-excursion
1305 (vc-version-diff file (vc-workfile-version file) nil)
1321 "Revert to checked-in version, instead? "))
1326 (defvar vc-dired-window-configuration)
1337 (set-window-configuration vc-dired-window-configuration)
1346 "Do the next logical version control operation on the current file.
1357 A prefix argument lets you specify the version number to use.
1360 If the file is not already registered, this registers it for version
1376 If the file is not already registered, this registers it for version
1390 (set (make-local-variable 'vc-dired-window-configuration)
1391 (current-window-configuration))
1410 (defun vc-default-init-version (backend) vc-default-init-version)
1413 (defun vc-register (&optional set-version comment)
1414 "Register the current file into a version control system.
1415 With prefix argument SET-VERSION, allow user to specify initial version
1418 The version control system to use is found by cycling through the list
1440 (if set-version
1441 (read-string (format "Initial version level for %s: "
1444 'init-version))
1461 "Return the name of a backend system that is responsible for FILE.
1508 (defun vc-resynch-window (file &optional keep noquery)
1513 difference between the buffer and the file is due to version control
1536 (vc-resynch-window file keep noquery)
1540 (vc-resynch-window file keep noquery)))))
1572 (setq vc-log-version rev)
1588 (vc-call make-version-backups-p file)
1590 (vc-make-version-backup file))
1640 The optional argument REV may be a string specifying the new version
1647 that the version control system supports this mode of operation.
1665 (vc-delete-automatic-version-backups file)))
1668 (vc-workfile-version . nil)))
1693 (log-version vc-log-version)
1702 log-version
1704 ;; Remove checkin window (after the checkin so that if that fails
1707 (cond ((and logbuf vc-delete-logbuf-window)
1723 ;; Additional entry points for examining version histories
1729 recent checked in version of that file. This uses no arguments. With
1731 version designators specifying which versions to compare. The
1736 (call-interactively 'vc-version-diff)
1741 (message "No changes to %s since latest version" file)
1742 (vc-version-diff file nil nil)))))
1744 (defun vc-version-diff (file rev1 rev2)
1746 If REV1 is empty or nil it means to use the current workfile version;
1759 ;; if it's a directory, don't supply any version default
1762 ;; if the file is not up-to-date, use current version as older version
1764 (setq rev1-default (vc-workfile-version file)))
1765 ;; if the file is not locked, use last and previous version as default
1767 (setq rev1-default (vc-call previous-version file
1768 (vc-workfile-version file)))
1770 (setq rev2-default (vc-workfile-version file))))
1774 (concat "Older version (default "
1776 "Older version: ")
1779 (concat "Newer version (default "
1781 "Newer version (default current source): ")
1791 (or rev1 "last version checked in")
1812 (message "No changes to %s since latest version" file))
1822 (shrink-window-if-larger-than-buffer)))
1836 This function takes care to set up a proper coding system for diff output.
1840 (setq rev1 (vc-workfile-version file)))
1843 (let ((file-rev1 (vc-version-backup-file file rev1))
1846 (vc-version-backup-file file rev2)))
1847 (coding-system-for-read (vc-coding-system-for-diff file)))
1902 The meaning of REV1 and REV2 is the same as for `vc-version-diff'."
1914 `(let ((coding-system-for-read (vc-coding-system-for-diff ',f)))
1919 (defun vc-coding-system-for-diff (file)
1920 "Return the coding system for reading diff output for FILE."
1921 (or coding-system-for-read
1923 ;; use the buffer's coding system
1926 buffer-file-coding-system)))
1928 (car (find-operation-coding-system 'insert-file-contents file))
1933 (defun vc-version-other-window (rev)
1934 "Visit version REV of the current file in another window.
1935 If the current file is named `F', the version is named `F.~REV~'.
1937 (interactive "sVersion to visit (default is workfile version): ")
1940 (version (if (string-equal rev "")
1941 (vc-workfile-version file)
1943 (switch-to-buffer-other-window (vc-find-version file version))))
1945 (defun vc-find-version (file version)
1947 (let ((automatic-backup (vc-version-backup-file-name file version))
1949 (filename (vc-version-backup-file-name file version 'manual)))
1957 (let ((coding-system-for-read 'no-conversion)
1958 (coding-system-for-write 'no-conversion))
1964 (vc-call find-version file version outbuf))))
1972 (defun vc-default-find-version (backend file rev buffer)
1973 "Provide the new `find-version' op based on the old `checkout' op.
1975 to provide the `find-version' operation instead."
1988 "Insert headers into a file for use with a version control system.
2013 "Clear all version headers in the current buffer (or FILE).
2035 first version is a branch number, then merge all changes from that
2036 branch. If the first version is empty, merge news, i.e. recent changes
2046 first-version second-version status)
2055 (setq first-version
2056 (read-string (concat "Branch or version to merge from "
2058 (if (string= first-version "")
2064 (if (not (vc-branch-p first-version))
2065 (setq second-version
2066 (read-string "Second version: "
2067 (concat (vc-branch-part first-version) ".")))
2070 (setq second-version first-version)
2071 ;; first-version must be the starting point of the branch
2072 (setq first-version (vc-branch-part first-version)))
2073 (setq status (vc-call merge file first-version second-version))))
2103 It works like Dired, but lists only files under version control, with
2110 is redefined as the version control prefix, so that you can type
2194 Replace various columns with version control information, VC-INFO.
2206 "Reformat the listing according to version control.
2208 (message "Getting version information... ")
2259 (message "Getting version information... done")
2355 For each registered file, the version level of its latest version
2424 "List the change log of the current buffer in a window.
2429 (or focus-rev (setq focus-rev (vc-workfile-version file)))
2461 ;; (shrink-window-if-larger-than-buffer)
2462 ;; move point to the log entry for the current version
2502 "Revert the current buffer's file to the version it was based on.
2504 to that version. This function does not automatically pick up newer
2521 ;; vc-diff selects the new window, which is not what we want:
2522 ;; if the new window is on another frame, that'd require the user
2525 (win (save-selected-window
2526 (setq status (vc-diff nil t)) (selected-window))))
2532 (select-window win)
2533 (if (one-window-p t)
2534 (if (window-dedicated-p (selected-window))
2536 (delete-window))))))
2545 "Update the current buffer's file to the latest version on its branch.
2547 the working file with the latest version on its branch. If the file contains
2569 (vc-resynch-window file t t))))))
2571 (defun vc-version-backup-file (file &optional rev)
2573 If version backups should be used for FILE, and there exists
2574 such a backup for REV or the current workfile version of file,
2576 (when (vc-call make-version-backups-p file)
2577 (let ((backup-file (vc-version-backup-file-name file rev)))
2581 (setq backup-file (vc-version-backup-file-name file rev 'manual))
2587 (let ((rev (vc-workfile-version file))
2597 (let ((coding-system-for-read 'no-conversion)
2598 (coding-system-for-write 'no-conversion))
2604 (vc-call find-version file rev outbuf)))))
2613 "Revert FILE back to the version it was based on."
2616 (let ((backup-file (vc-version-backup-file file)))
2619 (vc-delete-automatic-version-backups file))
2626 (defun vc-cancel-version (norevert)
2627 "Get rid of most recently checked in version of this file.
2633 (target (vc-workfile-version file)))
2635 ((not (vc-find-backend-function backend 'cancel-version))
2638 (error "This is not the latest version; VC cannot cancel it"))
2641 (if (null (yes-or-no-p (format "Remove version %s from master? " target)))
2644 (yes-or-no-p "Revert buffer to most recent remaining version? "))))
2649 (vc-call cancel-version file norevert)
2654 (vc-workfile-version . nil)))
2658 (norevert ;; clear version headers and mark the buffer modified
2674 "Make BACKEND the current version control system for FILE.
2683 (error "There is no version-controlled file in this buffer"))
2689 (error "File %s is not under version control" buffer-file-name))
2723 "Transfer FILE to another version control system NEW-BACKEND.
2726 NEW-BACKEND, using the version number from the current backend as the
2746 (let* ((rev (vc-workfile-version file))
2748 (unmodified-file (and modified-file (vc-version-backup-file file))))
2760 (if (y-or-n-p "Get base version from master? ")
2784 "Let BACKEND receive FILE from another version control system."
2812 (error "New file lacks a version control directory")))))
2815 "Delete file and mark it as such in the version control system."
2820 (error "File %s is not under version control"
2866 ;; to some checked in version. However, testing for this is tricky....
2877 "Find change log file and add entries from recent version control logs.
2884 files that are under version control. This puts all the entries in the
2932 (find-file-other-window changelog)
3073 ["Annotate previous revision" vc-annotate-prev-version]
3074 ["Annotate next revision" vc-annotate-next-version]
3077 ["Annotate latest revision" vc-annotate-workfile-version]
3117 minibuffer. First, you may enter a version number; then the buffer
3118 displays and annotates that version instead of the current version
3135 (let ((def (vc-workfile-version buffer-file-name)))
3138 (format "Annotate from version (default %s): " def)
3178 (defun vc-annotate-prev-version (prefix)
3179 "Visit the annotation of the version previous to this one.
3181 With a numeric prefix argument, annotate the version that many
3184 (vc-annotate-warp-version (- 0 prefix)))
3186 (defun vc-annotate-next-version (prefix)
3187 "Visit the annotation of the version after this one.
3189 With a numeric prefix argument, annotate the version that many
3192 (vc-annotate-warp-version prefix))
3194 (defun vc-annotate-workfile-version ()
3195 "Visit the annotation of the workfile version of this file."
3199 (let ((warp-rev (vc-workfile-version vc-annotate-parent-file)))
3201 (message "Already at version %s" warp-rev)
3202 (vc-annotate-warp-version warp-rev)))))
3210 "Visit the annotation of the version identified in the current line."
3218 (message "Already at version %s" rev-at-line)
3219 (vc-annotate-warp-version rev-at-line))))))
3222 "Visit the annotation of the version before the version at line."
3231 (vc-call previous-version vc-annotate-parent-file rev-at-line))
3232 (vc-annotate-warp-version prev-rev)))))
3235 "Visit the log of the version at line."
3245 "Visit the diff of the version at line from its previous version."
3254 (vc-call previous-version vc-annotate-parent-file rev-at-line))
3256 (message "Cannot diff from any version prior to %s" rev-at-line)
3257 (save-window-excursion
3258 (vc-version-diff vc-annotate-parent-file prev-rev rev-at-line))
3261 (defun vc-annotate-warp-version (revspec)
3262 "Annotate the version described by REVSPEC.
3280 (setq newrev (vc-call next-version
3284 (message "Cannot increment %d versions from version %s"
3289 (setq newrev (vc-call previous-version
3293 (message "Cannot decrement %d versions from version %s"
3296 (t (error "Invalid argument to vc-annotate-warp-version")))
3406 (make-local-variable 'vc-log-version)
3444 ;; vc-next-action's computations of the file's version-control state and
3445 ;; the actions that change it. This is a window open to lossage in a
3517 ;; admin/checkin in vc-buffer-admin (apparent state A). This window may
3526 ;; checkin (apparent state D). This window may never close.
3530 ;; revert operation (apparent state C). Included in window Q.
3541 ;; D). This window may never be closed if the user fails to complete the
3542 ;; checkin message. Includes window R.
3546 ;; state E). This window may never close if the user fails to complete
3547 ;; the steal-lock message. Includes window X.
3551 ;; steal-lock operation (apparent state E). This window may never close
3560 ;; Potential cause: someone else's admin during window P, with
3563 ;; RCS: Prior to version 5.6.4, ci fails with message
3572 ;; Potential cause: self-race during window P.
3574 ;; RCS: Prior to version 5.6.4, reverts the file to the last saved
3575 ;; version and unlocks it. From 5.6.4 onwards, VC uses the new
3583 ;; Potential cause: self-race during window P.
3585 ;; RCS: Prior to version 5.6.4, VC registers the caller's workfile as
3593 ;; Potential cause: someone else's admin during window P, with
3596 ;; RCS: Prior to version 5.6.4, ci fails with a
3608 ;; Potential cause: master file got nuked during window P.
3618 ;; Potential cause: self-race during window T.
3635 ;; Potential cause: someone else checks it out during window T.
3651 ;; Potential cause: a self-race in window U, or by the revert's
3652 ;; landing during window X of some other user's steal-lock or window S
3655 ;; RCS: succeeds, refreshing the file from the identical version in
3665 ;; during window Q.
3673 ;; Potential cause: a steal-lock in window V.
3685 ;; Potential cause: master file got nuked during window P.
3687 ;; RCS: Prior to version 5.6.4, checks in the user's version as an
3692 ;; This case is kind of nasty. Under RCS prior to version 5.6.4,
3693 ;; VC may fail to detect the loss of previous version information.
3698 ;; Potential cause: self-race in window V, or the checkin happening
3699 ;; during the window X of someone else's steal-lock or window S of
3709 ;; sequence by the calling user would have to land in window R.
3735 ;; Potential cause: someone released a lock during window W.
3746 ;; a self-race, both in window W.
3765 ;; if the master file gets nuked in window P.
3769 ;; window P or R respectively.