Mercurial > emacs
diff lisp/vc-git.el @ 108009:17d3324f96dd
Make the log-edit comments use RFC822 format throughout.
* 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-hg.el (vc-hg-log-edit-mode): Remove.
(vc-hg-checkin): Remove extra arg. Use log-edit-extract-headers.
* vc-git.el (vc-git-log-edit-mode): Remove.
(vc-git-checkin): Remove extra arg. 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-start-logentry): Remove argument `extra'.
(vc-finish-logentry): Remove extra args.
* vc-bzr.el (vc-bzr-log-edit-mode): Remove.
(vc-bzr-checkin): Remove extra arg. Use log-edit-extract-headers.
(vc-bzr-conflicted-files): New function.
* log-edit.el (log-edit-extra-flags)
(log-edit-before-checkin-process): Remove.
(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-view-process-buffer): Remove.
(log-edit-extract-headers): New function to replace it.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Tue, 20 Apr 2010 22:05:24 -0400 |
parents | c168d4537385 |
children | 2ad33f941be2 |
line wrap: on
line diff
--- a/lisp/vc-git.el Wed Apr 21 02:49:40 2010 +0200 +++ b/lisp/vc-git.el Tue Apr 20 22:05:24 2010 -0400 @@ -118,7 +118,7 @@ :version "23.1" :group 'vc) -(defvar git-commits-coding-system 'utf-8 +(defvar vc-git-commits-coding-system 'utf-8 "Default coding system for git commits.") ;;; BACKEND PROPERTIES @@ -548,11 +548,15 @@ (defun vc-git-unregister (file) (vc-git-command nil 0 file "rm" "-f" "--cached" "--")) +(declare-function log-edit-extract-headers "log-edit" (headers string)) -(defun vc-git-checkin (files rev comment &optional extra-args) - (let ((coding-system-for-write git-commits-coding-system)) +(defun vc-git-checkin (files rev comment) + (let ((coding-system-for-write vc-git-commits-coding-system)) (apply 'vc-git-command nil 0 files - (nconc (list "commit" "-m" comment) extra-args (list "--only" "--"))))) + (nconc (list "commit" "-m") + (log-edit-extract-headers '(("Author" . "--author")) + comment) + (list "--only" "--"))))) (defun vc-git-find-revision (file rev buffer) (let* (process-file-side-effects @@ -582,7 +586,7 @@ "Get change log associated with FILES. Note that using SHORTLOG requires at least Git version 1.5.6, for the --graph option." - (let ((coding-system-for-read git-commits-coding-system)) + (let ((coding-system-for-read vc-git-commits-coding-system)) ;; `vc-do-command' creates the buffer, but we need it before running ;; the command. (vc-setup-buffer buffer) @@ -793,21 +797,6 @@ (progn (forward-line 1) (1- (point))))))))) (or (vc-git-symbolic-commit next-rev) next-rev))) -(declare-function log-edit-mode "log-edit" ()) -(defvar log-edit-extra-flags) -(defvar log-edit-before-checkin-process) - -(define-derived-mode vc-git-log-edit-mode log-edit-mode "Git-log-edit" - "Mode for editing Git commit logs. -If a line like: -Author: NAME -is present in the log, it is removed, and ---author=NAME -is passed to the git commit command." - (set (make-local-variable 'log-edit-extra-flags) nil) - (set (make-local-variable 'log-edit-before-checkin-process) - '(("^Author:[ \t]+\\(.*\\)[ \t]*$" . (list "--author" (match-string 1)))))) - (defun vc-git-delete-file (file) (vc-git-command nil 0 file "rm" "-f" "--"))