Mercurial > emacs
comparison lisp/vc.el @ 3939:1b954eb0f249
(vc-update-change-log): Ensure that file names inserted into a ChangeLog
are relative to that ChangeLog.
author | Paul Eggert <eggert@twinsun.com> |
---|---|
date | Wed, 30 Jun 1993 21:35:59 +0000 |
parents | 5669887e3692 |
children | ef9f2cfb6703 |
comparison
equal
deleted
inserted
replaced
3938:83d870a52936 | 3939:1b954eb0f249 |
---|---|
1113 (defun vc-update-change-log (&rest args) | 1113 (defun vc-update-change-log (&rest args) |
1114 "Find change log file and add entries from recent RCS logs. | 1114 "Find change log file and add entries from recent RCS logs. |
1115 The mark is left at the end of the text prepended to the change log. | 1115 The mark is left at the end of the text prepended to the change log. |
1116 With prefix arg of C-u, only find log entries for the current buffer's file. | 1116 With prefix arg of C-u, only find log entries for the current buffer's file. |
1117 With any numeric prefix arg, find log entries for all files currently visited. | 1117 With any numeric prefix arg, find log entries for all files currently visited. |
1118 Otherwise, find log entries for all registered files in the default directory. | |
1118 From a program, any arguments are passed to the `rcs2log' script." | 1119 From a program, any arguments are passed to the `rcs2log' script." |
1119 (interactive | 1120 (interactive |
1120 (cond ((consp current-prefix-arg) ;C-u | 1121 (cond ((consp current-prefix-arg) ;C-u |
1121 (list buffer-file-name)) | 1122 (list buffer-file-name)) |
1122 (current-prefix-arg ;Numeric argument. | 1123 (current-prefix-arg ;Numeric argument. |
1124 (buffers (buffer-list)) | 1125 (buffers (buffer-list)) |
1125 file) | 1126 file) |
1126 (while buffers | 1127 (while buffers |
1127 (setq file (buffer-file-name (car buffers))) | 1128 (setq file (buffer-file-name (car buffers))) |
1128 (and file (vc-backend-deduce file) | 1129 (and file (vc-backend-deduce file) |
1129 (setq files (cons (file-relative-name file) files))) | 1130 (setq files (cons file files))) |
1130 (setq buffers (cdr buffers))) | 1131 (setq buffers (cdr buffers))) |
1131 files)))) | 1132 files)) |
1133 (t | |
1134 (let ((RCS (concat default-directory "RCS"))) | |
1135 (and (file-directory-p RCS) | |
1136 (mapcar (function | |
1137 (lambda (f) | |
1138 (if (string-match "\\(.*\\),v$" f) | |
1139 (substring f 0 (match-end 1)) | |
1140 f))) | |
1141 (directory-files RCS nil "...\\|^[^.]\\|^.[^.]"))))))) | |
1132 (let ((odefault default-directory)) | 1142 (let ((odefault default-directory)) |
1133 (find-file-other-window (find-change-log)) | 1143 (find-file-other-window (find-change-log)) |
1134 (barf-if-buffer-read-only) | 1144 (barf-if-buffer-read-only) |
1135 (vc-buffer-sync) | 1145 (vc-buffer-sync) |
1136 (undo-boundary) | 1146 (undo-boundary) |
1137 (goto-char (point-min)) | 1147 (goto-char (point-min)) |
1138 (push-mark) | 1148 (push-mark) |
1139 (message "Computing change log entries...") | 1149 (message "Computing change log entries...") |
1140 (let ((default-directory odefault)) | 1150 (message "Computing change log entries... %s" |
1141 (message "Computing change log entries... %s" | 1151 (if (or (null args) |
1142 (if (eq 0 (apply 'call-process "rcs2log" nil t nil args)) | 1152 (eq 0 (apply 'call-process "rcs2log" nil t nil |
1143 "done" "failed"))))) | 1153 (mapcar (function |
1154 (lambda (f) | |
1155 (file-relative-name | |
1156 (if (file-name-absolute-p f) | |
1157 f | |
1158 (concat odefault f))))) | |
1159 args)))) | |
1160 "done" "failed")))) | |
1144 | 1161 |
1145 ;; Functions for querying the master and lock files. | 1162 ;; Functions for querying the master and lock files. |
1146 | 1163 |
1147 (defun vc-match-substring (bn) | 1164 (defun vc-match-substring (bn) |
1148 (buffer-substring (match-beginning bn) (match-end bn))) | 1165 (buffer-substring (match-beginning bn) (match-end bn))) |