Function: vc-svn-modify-change-comment

vc-svn-modify-change-comment is a byte-compiled function defined in vc-svn.el.gz.

Signature

(vc-svn-modify-change-comment FILES REV COMMENT)

Documentation

Modify the change comments for a specified REV.

You must have ssh access to the repository host, and the directory Emacs uses locally for temp files must also be writable by you on that host. This is only supported if the repository access method is either file:// or svn+ssh://.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc-svn.el.gz
(defun vc-svn-modify-change-comment (_files rev comment)
  "Modify the change comments for a specified REV.
You must have ssh access to the repository host, and the directory Emacs
uses locally for temp files must also be writable by you on that host.
This is only supported if the repository access method is either file://
or svn+ssh://."
  (let (tempfile host remotefile directory fileurl-p)
    (with-temp-buffer
      (vc-svn-command (current-buffer) 0 nil "info")
      (goto-char (point-min))
      (unless (re-search-forward "Repository Root: \\(file://\\(/.*\\)\\)\\|\\(svn\\+ssh://\\([^/]+\\)\\(/.*\\)\\)" nil t)
	(error "Repository information is unavailable"))
      (if (match-string 1)
	  (progn
	    (setq fileurl-p t)
	    (setq directory (match-string 2)))
	(setq host (match-string 4))
	(setq directory (match-string 5))
	(setq remotefile (concat host ":" tempfile))))
    (with-temp-file (setq tempfile (make-temp-file user-mail-address))
      (insert comment))
    (if fileurl-p
	;; Repository Root is a local file.
	(progn
	  (unless (vc-do-command
		   "*vc*" 0 "svnadmin" nil
		   "setlog" "--bypass-hooks" directory
		   "-r" rev (format "%s" tempfile))
	    (error "Log edit failed"))
	  (delete-file tempfile))

      ;; Remote repository, using svn+ssh.
      (unless (vc-do-command "*vc*" 0 "scp" nil "-q" tempfile remotefile)
	(error "Copy of comment to %s failed" remotefile))
      (unless (vc-do-command
	       "*vc*" 0 "ssh" nil "-q" host
	       (format "svnadmin setlog --bypass-hooks %s -r %s %s; rm %s"
		       directory rev tempfile tempfile))
	(error "Log edit failed")))))