Mercurial > emacs
comparison lisp/vc-hg.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 | 973b5bc5fcfe |
comparison
equal
deleted
inserted
replaced
108008:3ccddf080698 | 108009:17d3324f96dd |
---|---|
294 (1 'change-log-email)) | 294 (1 'change-log-email)) |
295 ("^date: \\(.+\\)" (1 'change-log-date)) | 295 ("^date: \\(.+\\)" (1 'change-log-date)) |
296 ("^tag: +\\([^ ]+\\)$" (1 'highlight)) | 296 ("^tag: +\\([^ ]+\\)$" (1 'highlight)) |
297 ("^summary:[ \t]+\\(.+\\)" (1 'log-view-message))))))) | 297 ("^summary:[ \t]+\\(.+\\)" (1 'log-view-message))))))) |
298 | 298 |
299 (declare-function log-edit-mode "log-edit" ()) | 299 (declare-function log-edit-extract-headers "log-edit" (headers string)) |
300 (defvar log-edit-extra-flags) | |
301 (defvar log-edit-before-checkin-process) | |
302 | |
303 (define-derived-mode vc-hg-log-edit-mode log-edit-mode "Hg-log-edit" | |
304 "Mode for editing Hg commit logs. | |
305 If a line like: | |
306 Author: NAME | |
307 is present in the log, it is removed, and | |
308 --author NAME | |
309 is passed to the hg commit command." | |
310 (set (make-local-variable 'log-edit-extra-flags) nil) | |
311 (set (make-local-variable 'log-edit-before-checkin-process) | |
312 '(("^Author:[ \t]+\\(.*\\)[ \t]*$" . (list "--user" (match-string 1)))))) | |
313 | 300 |
314 (defun vc-hg-diff (files &optional oldvers newvers buffer) | 301 (defun vc-hg-diff (files &optional oldvers newvers buffer) |
315 "Get a difference report using hg between two revisions of FILES." | 302 "Get a difference report using hg between two revisions of FILES." |
316 (let* ((firstfile (car files)) | 303 (let* ((firstfile (car files)) |
317 (working (and firstfile (vc-working-revision firstfile)))) | 304 (working (and firstfile (vc-working-revision firstfile)))) |
432 ;; FIXME: This would remove the file. Is that correct? | 419 ;; FIXME: This would remove the file. Is that correct? |
433 ;; (defun vc-hg-unregister (file) | 420 ;; (defun vc-hg-unregister (file) |
434 ;; "Unregister FILE from hg." | 421 ;; "Unregister FILE from hg." |
435 ;; (vc-hg-command nil nil file "remove")) | 422 ;; (vc-hg-command nil nil file "remove")) |
436 | 423 |
437 (defun vc-hg-checkin (files rev comment &optional extra-args) | 424 (declare-function log-edit-extract-headers "log-edit" (headers string)) |
425 | |
426 (defun vc-hg-checkin (files rev comment) | |
438 "Hg-specific version of `vc-backend-checkin'. | 427 "Hg-specific version of `vc-backend-checkin'. |
439 REV is ignored." | 428 REV is ignored." |
440 (apply 'vc-hg-command nil 0 files | 429 (apply 'vc-hg-command nil 0 files |
441 (nconc (list "commit" "-m" comment) extra-args))) | 430 (nconc (list "commit" "-m") |
431 (log-edit-extract-headers '(("Author" . "--user")) | |
432 comment)))) | |
442 | 433 |
443 (defun vc-hg-find-revision (file rev buffer) | 434 (defun vc-hg-find-revision (file rev buffer) |
444 (let ((coding-system-for-read 'binary) | 435 (let ((coding-system-for-read 'binary) |
445 (coding-system-for-write 'binary)) | 436 (coding-system-for-write 'binary)) |
446 (if rev | 437 (if rev |