aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond2007-12-27 11:26:27 +0000
committerEric S. Raymond2007-12-27 11:26:27 +0000
commit9b64a7f0cf4d2fb716182d26046f645ec58210b3 (patch)
tree85caeda743cf28835e983261d5088e562c95d05f
parent86c3a9fbd94ebdd7c4c8ddc2e671290327eefe2c (diff)
downloademacs-9b64a7f0cf4d2fb716182d26046f645ec58210b3.tar.gz
emacs-9b64a7f0cf4d2fb716182d26046f645ec58210b3.zip
* (vc.el, vc-sccs.el, vc-rcs.el, vc-cs.el, vc-mcvs.el): Put
machinery in place to support editing of change comments with 'e' in a log-view buffer. Not documented yet as this only works for SCCS, RCS, and maybe CVS if you have admin privileges. When we have backend support for Subversion and more modern systems it will ve time to write this up.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/log-view.el27
-rw-r--r--lisp/vc-cvs.el4
-rw-r--r--lisp/vc-mcvs.el6
-rw-r--r--lisp/vc-rcs.el5
-rw-r--r--lisp/vc-sccs.el6
-rw-r--r--lisp/vc.el18
7 files changed, 74 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0de84114ed5..f9ae2f49158 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12007-12-27 Eric S. Raymond <esr@snark.thyrsus.com>
2
3 * (vc.el, vc-sccs.el, vc-rcs.el, vc-cs.el, vc-mcvs.el): Put
4 machinery in place to support editing of change comments
5 with 'e' in a log-view buffer. Not documented yet as this
6 only works for SCCS, RCS, and maybe CVS if you have admin
7 privileges. When we have backend support for Subversion and
8 more modern systems it will ve time to write this up.
9
12007-12-27 Kenichi Handa <handa@ni.aist.go.jp> 102007-12-27 Kenichi Handa <handa@ni.aist.go.jp>
2 11
3 * international/mule-cmds.el (select-safe-coding-system): When a 12 * international/mule-cmds.el (select-safe-coding-system): When a
diff --git a/lisp/log-view.el b/lisp/log-view.el
index ceda42eb687..d14b33262cc 100644
--- a/lisp/log-view.el
+++ b/lisp/log-view.el
@@ -128,7 +128,7 @@
128 '(("q" . quit-window) 128 '(("q" . quit-window)
129 ("z" . kill-this-buffer) 129 ("z" . kill-this-buffer)
130 ("m" . log-view-toggle-mark-entry) 130 ("m" . log-view-toggle-mark-entry)
131 ;; ("e" . cvs-mode-edit-log) 131 ("e" . log-view-modify-change-comment)
132 ("d" . log-view-diff) 132 ("d" . log-view-diff)
133 ("a" . log-view-annotate-version) 133 ("a" . log-view-annotate-version)
134 ("f" . log-view-find-revision) 134 ("f" . log-view-find-revision)
@@ -411,6 +411,31 @@ log entries."
411 (switch-to-buffer (vc-find-revision (log-view-current-file) 411 (switch-to-buffer (vc-find-revision (log-view-current-file)
412 (log-view-current-tag))))) 412 (log-view-current-tag)))))
413 413
414
415(defun log-view-extract-comment ()
416 "Parse comment from around the current point in the log."
417 (save-excursion
418 (let (st en (backend (vc-backend (log-view-current-file))))
419 (log-view-end-of-defun)
420 (cond ((eq backend 'SVN)
421 (forward-line -1)))
422 (setq en (point))
423 (log-view-beginning-of-defun)
424 (cond ((memq backend '(SCCS RCS CVS MCVS SVN))
425 (forward-line 2))
426 ((eq backend 'Hg)
427 (forward-line 4)
428 (re-search-forward "summary: *" nil t)))
429 (setq st (point))
430 (buffer-substring st en))))
431
432(defun log-view-modify-change-comment ()
433 "Edit the change comment displayed at point."
434 (interactive)
435 (vc-modify-change-comment (list (log-view-current-file))
436 (log-view-current-tag)
437 (log-view-extract-comment)))
438
414(defun log-view-annotate-version (pos) 439(defun log-view-annotate-version (pos)
415 "Annotate the version at point." 440 "Annotate the version at point."
416 (interactive "d") 441 (interactive "d")
diff --git a/lisp/vc-cvs.el b/lisp/vc-cvs.el
index 337170ab896..cdb3aae8020 100644
--- a/lisp/vc-cvs.el
+++ b/lisp/vc-cvs.el
@@ -494,6 +494,10 @@ The changes are between FIRST-REVISION and SECOND-REVISION."
494 (error "Couldn't analyze cvs update result"))) 494 (error "Couldn't analyze cvs update result")))
495 (message "Merging changes into %s...done" file)))) 495 (message "Merging changes into %s...done" file))))
496 496
497(defun vc-cvs-modify-change-comment (files rev comment)
498 "Modify the change comments for FILES on a specified REV.
499Will fail unless you have administrative privileges on the repo."
500 (vc-cvs-command nil 0 files "rcs" (concat "-m" comment ":" rev)))
497 501
498;;; 502;;;
499;;; History functions 503;;; History functions
diff --git a/lisp/vc-mcvs.el b/lisp/vc-mcvs.el
index 70d502c7670..ba0ccf47747 100644
--- a/lisp/vc-mcvs.el
+++ b/lisp/vc-mcvs.el
@@ -432,6 +432,12 @@ The changes are between FIRST-REVISION and SECOND-REVISION."
432 (error "Couldn't analyze mcvs update result"))) 432 (error "Couldn't analyze mcvs update result")))
433 (message "Merging changes into %s...done" file)))) 433 (message "Merging changes into %s...done" file))))
434 434
435(defun vc-mcvs-modify-change-comment (files rev comment)
436 "Modify the change comments for FILES on a specified REV.
437Will fail unless you have administrative privileges on the repo."
438 (vc-mcvs-command nil 0 files "rcs" (concat "-m" comment ":" rev)))
439
440
435;;; 441;;;
436;;; History functions 442;;; History functions
437;;; 443;;;
diff --git a/lisp/vc-rcs.el b/lisp/vc-rcs.el
index 35eba607bea..a092a91e918 100644
--- a/lisp/vc-rcs.el
+++ b/lisp/vc-rcs.el
@@ -510,6 +510,11 @@ Needs RCS 5.6.2 or later for -M."
510 ;; expanded headers. 510 ;; expanded headers.
511 (vc-do-command nil 0 "co" (vc-name file) "-f" (concat "-l" rev))) 511 (vc-do-command nil 0 "co" (vc-name file) "-f" (concat "-l" rev)))
512 512
513(defun vc-rcs-modify-change-comment (files rev comment)
514 "Modify the change comments change on FILES on a specified REV."
515 (dolist (file files)
516 (vc-do-command nil 0 "rcs" (vc-name file)
517 (concat "-m" comment ":" rev))))
513 518
514 519
515;;; 520;;;
diff --git a/lisp/vc-sccs.el b/lisp/vc-sccs.el
index 06fcff3ceb5..749ec83a196 100644
--- a/lisp/vc-sccs.el
+++ b/lisp/vc-sccs.el
@@ -285,6 +285,12 @@ locked. REV is the revision to check out."
285 (vc-do-command nil 0 "unget" (vc-name file) "-n" (if rev (concat "-r" rev))) 285 (vc-do-command nil 0 "unget" (vc-name file) "-n" (if rev (concat "-r" rev)))
286 (vc-do-command nil 0 "get" (vc-name file) "-g" (if rev (concat "-r" rev)))) 286 (vc-do-command nil 0 "get" (vc-name file) "-g" (if rev (concat "-r" rev))))
287 287
288(defun vc-sccs-modify-change-comment (files rev comment)
289 "Modify (actually, append to) the change comments for FILES on a specified REV."
290 (dolist (file files)
291 (vc-do-command nil 0 "cdc" (vc-name file)
292 (concat "-y" comment) (concat "-r" rev))))
293
288 294
289;;; 295;;;
290;;; History functions 296;;; History functions
diff --git a/lisp/vc.el b/lisp/vc.el
index d8c99b25108..3d1132aab77 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -318,6 +318,11 @@
318;; used for files under this backend, and if files can indeed be 318;; used for files under this backend, and if files can indeed be
319;; locked by other users. 319;; locked by other users.
320;; 320;;
321;; - modify-change-comment (files rev comment)
322;;
323;; Modify the change comments associated with the files at the
324;; given revision. This is optional, many backends do not support it.
325;;
321;; HISTORY FUNCTIONS 326;; HISTORY FUNCTIONS
322;; 327;;
323;; * print-log (files &optional buffer) 328;; * print-log (files &optional buffer)
@@ -2137,6 +2142,19 @@ The headers are reset to their non-expanded form."
2137 (vc-call-backend backend 'clear-headers) 2142 (vc-call-backend backend 'clear-headers)
2138 (kill-buffer filename))))) 2143 (kill-buffer filename)))))
2139 2144
2145(defun vc-modify-change-comment (files rev oldcomment)
2146 "Edit the comment associated with the given files and revision."
2147 (vc-start-entry
2148 files rev oldcomment t
2149 "Enter a replacement change comment."
2150 (lambda (files rev comment)
2151 (vc-call-backend
2152 ;; Less of a kluge than it looks like; log-view mode only passes
2153 ;; this function a singleton list. Arguments left in this form in
2154 ;; case the more general operation ever becomes meaningful.
2155 (vc-responsible-backend (car files))
2156 'modify-change-comment files rev comment))))
2157
2140;;;###autoload 2158;;;###autoload
2141(defun vc-merge () 2159(defun vc-merge ()
2142 "Merge changes between two revisions into the current buffer's file. 2160 "Merge changes between two revisions into the current buffer's file.