comparison lisp/vc-dir.el @ 111350:8027e412df98

Backport VC improvements from trunk. * vc/log-edit.el (log-edit-rewrite-fixes): New var. (log-edit-author): New dynamic var. (log-edit-changelog-ours-p, log-edit-insert-changelog-entries): Use it to return the author if different from committer. (log-edit-insert-changelog): Use them to add Author: and Fixes headers. * vc/vc-hooks.el (vc-default-mode-line-string): Doc fix. * vc/vc.el (vc-deduce-backend): New fun. Handle diff buffers. (vc-root-diff, vc-print-root-log, vc-log-incoming) (vc-log-outgoing): Use it. (vc-diff-internal): Set diff-vc-backend. * vc/diff-mode.el (diff-vc-backend): New var. * vc/vc.el (vc-diff-internal): Set `revert-buffer-function' buffer-locally to lambda that re-runs the vc diff command. (Bug#6447) * vc/log-view.el (log-view-mode-map): Bind revert-buffer. Make 'g' (AKA revert-buffer) rerun VC log, log-incoming and log-outgoing commands. * vc/vc.el (vc-log-internal-common): Add a new argument and use it to create a buffer local revert-buffer-function variable. (vc-print-log-internal, vc-log-incoming, vc-log-outgoing): Pass a revert-buffer-function lambda. Improve VC create/retrieve tag/branch. * vc.el (vc-create-tag): Do not read the directory name for VCs with repository revision granularity. Adjust the tag/branch prompt. Reset VC properties. (vc-retrieve-tag): Do not read the directory name for VCs with repository revision granularity. Reset VC properties. Add optional support for resetting VC properties. * vc-dispatcher.el (vc-resynch-window): Add new optional argument, call vc-file-clearprops when true. (vc-resynch-buffer): Add new optional argument, pass it down. (vc-resynch-buffers-in-directory): Likewise. Improve support for special markup in the VC commit message. * vc-mtn.el (vc-mtn-checkin): Support Author: and Date: markup. * vc-hg.el (vc-hg-checkin): Add support for Date:. * vc-git.el (vc-git-checkin): * vc-bzr.el (vc-bzr-checkin): Likewise. Add support for vc-log-incoming, improve vc-log-outgoing for Git. * vc-git.el (vc-git-log-view-mode): Fix font lock for incoming/outgoing logs. (vc-git-log-outgoing, vc-git-log-incoming): New functions. * vc-git.el (vc-git-log-outgoing): Use the same format as the short log. (vc-git-log-incoming): Likewise. Run "git fetch" before the log command Add bindings for vc-log-incoming and vc-log-outgoing. * vc-hooks.el (vc-prefix-map): Add bindings for vc-log-incoming and vc-log-outgoing. * vc-dir.el (vc-dir-menu-map): Add menu bindings for vc-log-incoming and vc-log-outgoing. Improve state updating for VC tag commands. * vc.el (vc-create-tag, vc-retrieve-tag): Call vc-resynch-buffer to update the state of all buffers in the directory. * vc-dir.el (vc-dir): Don't pop-up-windows. (Bug#6204) * vc.el (vc-checkin, vc-modify-change-comment): Adjust to new vc-start/finish-logentry. (vc-find-conflicted-file): New command. (vc-transfer-file): Adjust to new vc-checkin. (vc-next-action): Improve scoping. * vc-git.el (vc-git-checkin): Use log-edit-extract-headers. (vc-git-commits-coding-system): Rename from git-commits-coding-system. * vc-dispatcher.el (vc-log-edit): Shorten names for log-edit-show-files. * vc-bzr.el (vc-bzr-checkin): Use log-edit-extract-headers. (vc-bzr-conflicted-files): New function. * log-edit.el (log-edit-summary, log-edit-header) (log-edit-unknown-header): New faces. (log-edit-headers-alist): New var. (log-edit-header-contents-regexp): New const. (log-edit-match-to-eoh): New function. (log-edit-font-lock-keywords): Use them. (log-edit): Insert a "Summary:" header as default. (log-edit-mode): Mark font-lock rules as case-insensitive. (log-edit-done): Cleanup headers. (log-edit-extract-headers): New function to replace it. * vc-dispatcher.el (vc-finish-logentry): Don't mess so badly with the windows/frames. * vc-bzr.el (vc-bzr-shelve-apply): Don't use *vc-bzr-shelve*. * vc-dir.el (vc-dir-kill-line): New command. (vc-dir-mode-map): Bind it to C-k. (vc-dir-headers): Abbreviate the working dir. * vc-git.el (vc-git-revision-table): Include remote branches. New VC methods: vc-log-incoming and vc-log-outgoing. * vc.el (vc-print-log-setup-buttons, vc-log-internal-common) (vc-incoming-outgoing-internal, vc-log-incoming, vc-log-outgoing): New functions. (vc-print-log-internal): Just call vc-log-internal-common. (vc-log-view-type): New permanent local variable. * vc-hooks.el (vc-menu-map): Bind vc-log-incoming and vc-log-outgoing. * vc-bzr.el (vc-bzr-log-view-mode): Use vc-log-view-type instead of the dynamic bound vc-short-log. (vc-bzr-log-incoming, vc-bzr-log-outgoing): New functions. * vc-git.el (vc-git-log-outgoing): New function. (vc-git-log-view-mode): Use vc-log-view-type instead of the dynamic bound vc-short-log. * vc-hg.el (vc-hg-log-view-mode): Use vc-log-view-type instead of the dynamic bound vc-short-log. Highlight the tag. (vc-hg-log-incoming, vc-hg-log-outgoing): New functions. (vc-hg-outgoing, vc-hg-incoming, vc-hg-outgoing-mode): (vc-hg-incoming-mode): Remove. (vc-hg-extra-menu-map): Do not bind vc-hg-incoming and vc-hg-outgoing. Fix default-directory for vc-root-diff. * vc.el (vc-root-diff): Bind default-directory to the root directory for the diff command. * vc-hg.el (vc-hg-push, vc-hg-pull): Use `apply' when calling `vc-hg-command' with a list of flags. * vc-bzr.el (vc-bzr-log-edit-mode): Add --fixes support to log-edit-before-checkin-process. * vc.el (vc-modify-change-comment): Pass MODE to vc-start-logentry. * vc-bzr.el, vc-hg.el (log-edit-mode): Declare. * vc-dispatcher.el (vc-start-logentry): Doc fix. (log-view-process-buffer, log-edit-extra-flags): Declare. Add special markup processing for commit logs. * log-edit.el (log-edit): Add new argument MODE. Use that mode when non-nil instead of the log-view-mode. * vc.el (vc-default-log-edit-mode): New function. * vc-dispatcher.el (vc-log-edit): Add a mode argument, pass it to log-edit. Support for shelving snapshots and for showing shelves. * vc-bzr.el (vc-bzr-shelve-show, vc-bzr-shelve-show-at-point) (vc-bzr-shelve-apply-and-keep-at-point, vc-bzr-shelve-snapshot): New functions. (vc-bzr-shelve-map, vc-bzr-shelve-menu-map) (vc-bzr-extra-menu-map): Map them.
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 31 Oct 2010 23:13:42 -0400
parents ef318d39a3e6
children 163a7066458a
comparison
equal deleted inserted replaced
111349:518ba8ef471b 111350:8027e412df98
186 '(menu-item "Annotate" vc-annotate 186 '(menu-item "Annotate" vc-annotate
187 :help "Display the edit history of the current file using colors")) 187 :help "Display the edit history of the current file using colors"))
188 (define-key map [diff] 188 (define-key map [diff]
189 '(menu-item "Compare with Base Version" vc-diff 189 '(menu-item "Compare with Base Version" vc-diff
190 :help "Compare file set with the base version")) 190 :help "Compare file set with the base version"))
191 (define-key map [logo]
192 '(menu-item "Show Outgoing Log" vc-log-outgoing
193 :help "Show a log of changes that will be sent with a push operation"))
194 (define-key map [logi]
195 '(menu-item "Show Incoming Log" vc-log-incoming
196 :help "Show a log of changes that will be received with a pull operation"))
191 (define-key map [log] 197 (define-key map [log]
192 '(menu-item "Show history" vc-print-log 198 '(menu-item "Show history" vc-print-log
193 :help "List the change log of the current file set in a window")) 199 :help "List the change log of the current file set in a window"))
200 (define-key map [rlog]
201 '(menu-item "Show Top of the Tree History " vc-print-root-log
202 :help "List the change log for the current tree in a window"))
194 ;; VC commands. 203 ;; VC commands.
195 (define-key map [sepvccmd] '("--")) 204 (define-key map [sepvccmd] '("--"))
196 (define-key map [update] 205 (define-key map [update]
197 '(menu-item "Update to latest version" vc-update 206 '(menu-item "Update to latest version" vc-update
198 :help "Update the current fileset's files to their tip revisions")) 207 :help "Update the current fileset's files to their tip revisions"))
261 (define-key map "\C-c\C-c" 'vc-dir-kill-dir-status-process) 270 (define-key map "\C-c\C-c" 'vc-dir-kill-dir-status-process)
262 (define-key map [down-mouse-3] 'vc-dir-menu) 271 (define-key map [down-mouse-3] 'vc-dir-menu)
263 (define-key map [mouse-2] 'vc-dir-toggle-mark) 272 (define-key map [mouse-2] 'vc-dir-toggle-mark)
264 (define-key map [follow-link] 'mouse-face) 273 (define-key map [follow-link] 'mouse-face)
265 (define-key map "x" 'vc-dir-hide-up-to-date) 274 (define-key map "x" 'vc-dir-hide-up-to-date)
275 (define-key map [?\C-k] 'vc-dir-kill-line)
266 (define-key map "S" 'vc-dir-search) ;; FIXME: Maybe use A like dired? 276 (define-key map "S" 'vc-dir-search) ;; FIXME: Maybe use A like dired?
267 (define-key map "Q" 'vc-dir-query-replace-regexp) 277 (define-key map "Q" 'vc-dir-query-replace-regexp)
268 (define-key map (kbd "M-s a C-s") 'vc-dir-isearch) 278 (define-key map (kbd "M-s a C-s") 'vc-dir-isearch)
269 (define-key map (kbd "M-s a M-C-s") 'vc-dir-isearch-regexp) 279 (define-key map (kbd "M-s a M-C-s") 'vc-dir-isearch-regexp)
270 280
961 (concat 971 (concat
962 ;; First layout the common headers. 972 ;; First layout the common headers.
963 (propertize "VC backend : " 'face 'font-lock-type-face) 973 (propertize "VC backend : " 'face 'font-lock-type-face)
964 (propertize (format "%s\n" backend) 'face 'font-lock-variable-name-face) 974 (propertize (format "%s\n" backend) 'face 'font-lock-variable-name-face)
965 (propertize "Working dir: " 'face 'font-lock-type-face) 975 (propertize "Working dir: " 'face 'font-lock-type-face)
966 (propertize (format "%s\n" dir) 'face 'font-lock-variable-name-face) 976 (propertize (format "%s\n" (abbreviate-file-name dir))
977 'face 'font-lock-variable-name-face)
967 ;; Then the backend specific ones. 978 ;; Then the backend specific ones.
968 (vc-call-backend backend 'dir-extra-headers dir) 979 (vc-call-backend backend 'dir-extra-headers dir)
969 "\n")) 980 "\n"))
970 981
971 (defun vc-dir-refresh-files (files default-state) 982 (defun vc-dir-refresh-files (files default-state)
1098 ;; Remove files in the up-to-date state. 1109 ;; Remove files in the up-to-date state.
1099 (eq (vc-dir-fileinfo->state data) 'up-to-date)) 1110 (eq (vc-dir-fileinfo->state data) 'up-to-date))
1100 (ewoc-delete vc-ewoc crt)) 1111 (ewoc-delete vc-ewoc crt))
1101 (setq crt prev))))) 1112 (setq crt prev)))))
1102 1113
1114 (defun vc-dir-kill-line ()
1115 "Remove the current line from display."
1116 (interactive)
1117 (let ((crt (ewoc-locate vc-ewoc))
1118 (inhibit-read-only t))
1119 (ewoc-delete vc-ewoc crt)))
1120
1103 (defun vc-dir-printer (fileentry) 1121 (defun vc-dir-printer (fileentry)
1104 (vc-call-backend vc-dir-backend 'dir-printer fileentry)) 1122 (vc-call-backend vc-dir-backend 'dir-printer fileentry))
1105 1123
1106 (defun vc-dir-deduce-fileset (&optional state-model-only-files) 1124 (defun vc-dir-deduce-fileset (&optional state-model-only-files)
1107 (let ((marked (vc-dir-marked-files)) 1125 (let ((marked (vc-dir-marked-files))
1167 (mapcar (lambda (b) (list (symbol-name b))) 1185 (mapcar (lambda (b) (list (symbol-name b)))
1168 vc-handled-backends) 1186 vc-handled-backends)
1169 nil t nil nil))))) 1187 nil t nil nil)))))
1170 (unless backend 1188 (unless backend
1171 (setq backend (vc-responsible-backend dir))) 1189 (setq backend (vc-responsible-backend dir)))
1172 (pop-to-buffer (vc-dir-prepare-status-buffer "*vc-dir*" dir backend)) 1190 (let (pop-up-windows) ; based on cvs-examine; bug#6204
1191 (pop-to-buffer (vc-dir-prepare-status-buffer "*vc-dir*" dir backend)))
1173 (if (derived-mode-p 'vc-dir-mode) 1192 (if (derived-mode-p 'vc-dir-mode)
1174 (vc-dir-refresh) 1193 (vc-dir-refresh)
1175 ;; FIXME: find a better way to pass the backend to `vc-dir-mode'. 1194 ;; FIXME: find a better way to pass the backend to `vc-dir-mode'.
1176 (let ((use-vc-backend backend)) 1195 (let ((use-vc-backend backend))
1177 (vc-dir-mode)))) 1196 (vc-dir-mode))))