diff options
| author | Dan Nicolaescu | 2007-06-22 17:22:17 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2007-06-22 17:22:17 +0000 |
| commit | 7c1912afa81bf064a8ed0ebc1364b731a5588a33 (patch) | |
| tree | 47f3c52d90dabe41ee568d76daf75874990928f5 | |
| parent | 092c4936336cb4cd705258471373400b060e9e46 (diff) | |
| download | emacs-7c1912afa81bf064a8ed0ebc1364b731a5588a33.tar.gz emacs-7c1912afa81bf064a8ed0ebc1364b731a5588a33.zip | |
(vc-hg-print-log): Insert the file name.
(vc-hg-log-view-mode): Fontify the file name.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/vc-hg.el | 21 |
2 files changed, 22 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 24257e1c1f3..94edeb944a1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2007-06-22 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 2 | |||
| 3 | * vc-hg.el (vc-hg-print-log): Insert the file name. | ||
| 4 | (vc-hg-log-view-mode): Fontify the file name. | ||
| 5 | |||
| 1 | 2007-06-22 Jay Belanger <jay.p.belanger@gmail.com> | 6 | 2007-06-22 Jay Belanger <jay.p.belanger@gmail.com> |
| 2 | 7 | ||
| 3 | * calc/calc-forms.el (math-format-date-part) | 8 | * calc/calc-forms.el (math-format-date-part) |
diff --git a/lisp/vc-hg.el b/lisp/vc-hg.el index 1c1c47fcf03..5d27cf432e3 100644 --- a/lisp/vc-hg.el +++ b/lisp/vc-hg.el | |||
| @@ -36,7 +36,6 @@ | |||
| 36 | ;;; Todo: | 36 | ;;; Todo: |
| 37 | 37 | ||
| 38 | ;; Implement the rest of the vc interface: | 38 | ;; Implement the rest of the vc interface: |
| 39 | ;; - regexps for log-view to understand the "hg log" output | ||
| 40 | ;; - dired | 39 | ;; - dired |
| 41 | ;; - snapshot? | 40 | ;; - snapshot? |
| 42 | 41 | ||
| @@ -106,6 +105,19 @@ | |||
| 106 | 105 | ||
| 107 | (defun vc-hg-print-log(file &optional buffer) | 106 | (defun vc-hg-print-log(file &optional buffer) |
| 108 | "Get change log associated with FILE." | 107 | "Get change log associated with FILE." |
| 108 | ;; `log-view-mode' needs to have the file name in order to function | ||
| 109 | ;; correctly. "hg log" does not print it, so we insert it here by | ||
| 110 | ;; hand. | ||
| 111 | |||
| 112 | ;; `vc-do-command' creates the buffer, but we need it before running | ||
| 113 | ;; the command. | ||
| 114 | (vc-setup-buffer buffer) | ||
| 115 | ;; If the buffer exists from a previous invocation it might be | ||
| 116 | ;; read-only. | ||
| 117 | (let ((inhibit-read-only t)) | ||
| 118 | (with-current-buffer | ||
| 119 | buffer | ||
| 120 | (insert "File: " (file-name-nondirectory file) "\n"))) | ||
| 109 | (vc-hg-command | 121 | (vc-hg-command |
| 110 | buffer | 122 | buffer |
| 111 | (if (and (vc-stay-local-p file) (fboundp 'start-process)) 'async 0) | 123 | (if (and (vc-stay-local-p file) (fboundp 'start-process)) 'async 0) |
| @@ -119,13 +131,14 @@ | |||
| 119 | (define-derived-mode vc-hg-log-view-mode log-view-mode "HG-Log-View" | 131 | (define-derived-mode vc-hg-log-view-mode log-view-mode "HG-Log-View" |
| 120 | (require 'add-log) ;; we need the faces add-log | 132 | (require 'add-log) ;; we need the faces add-log |
| 121 | ;; Don't have file markers, so use impossible regexp. | 133 | ;; Don't have file markers, so use impossible regexp. |
| 122 | (set (make-local-variable 'log-view-file-re) "\\'\\`") | 134 | (set (make-local-variable 'log-view-file-re) "^File:[ \t]+\\(.+\\)") |
| 123 | (set (make-local-variable 'log-view-message-re) | 135 | (set (make-local-variable 'log-view-message-re) |
| 124 | "^changeset:[ \t]*\\([0-9]+\\):\\(.+\\)") | 136 | "^changeset:[ \t]*\\([0-9]+\\):\\(.+\\)") |
| 125 | (set (make-local-variable 'log-view-font-lock-keywords) | 137 | (set (make-local-variable 'log-view-font-lock-keywords) |
| 126 | (append | 138 | (append |
| 127 | ;; XXX maybe use a different face for the version number | 139 | ;; XXX maybe use a different face for the version number |
| 128 | `((,log-view-message-re (1 'change-log-acknowledgement))) | 140 | `((,log-view-message-re (1 'change-log-acknowledgement)) |
| 141 | (,log-view-file-re (1 'change-log-file-face))) | ||
| 129 | ;; Handle the case: | 142 | ;; Handle the case: |
| 130 | ;; user: foo@bar | 143 | ;; user: foo@bar |
| 131 | '(("^user:[ \t]+\\([A-Za-z0-9_.+-]+@[A-Za-z0-9_.-]+\\)" | 144 | '(("^user:[ \t]+\\([A-Za-z0-9_.+-]+@[A-Za-z0-9_.-]+\\)" |
| @@ -226,7 +239,7 @@ and that it passes `vc-hg-global-switches' to it before FLAGS." | |||
| 226 | (append vc-hg-global-switches | 239 | (append vc-hg-global-switches |
| 227 | flags)))) | 240 | flags)))) |
| 228 | 241 | ||
| 229 | (defun vc-hg-internal-log (file) | 242 | (defun vc-hg-internal-log (file &optional buffer) |
| 230 | "Return log of FILE." | 243 | "Return log of FILE." |
| 231 | (with-output-to-string | 244 | (with-output-to-string |
| 232 | (with-current-buffer | 245 | (with-current-buffer |