aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu2008-04-09 03:38:39 +0000
committerDan Nicolaescu2008-04-09 03:38:39 +0000
commitfd0644516654b82dda26fea572917e6ad92423fd (patch)
treeb2f8cf30fd67f34b0f8e556f991aecc934817c9d
parent32bae13cf74b826b6ec2bc35074a68bd3ab6e40c (diff)
downloademacs-fd0644516654b82dda26fea572917e6ad92423fd.tar.gz
emacs-fd0644516654b82dda26fea572917e6ad92423fd.zip
(vc-svn-modify-change-comment): Add support for the
file:// access method.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/vc-svn.el55
2 files changed, 40 insertions, 20 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 80f6f61f26a..a2a219479c7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12008-04-09 Dan Nicolaescu <dann@ics.uci.edu>
2
3 * vc-svn.el (vc-svn-modify-change-comment): Add support for the
4 file:// access method.
5
12008-04-09 Stefan Monnier <monnier@iro.umontreal.ca> 62008-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * minibuffer.el: New file. 8 * minibuffer.el: New file.
diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el
index e36a16d7758..c2c665cb275 100644
--- a/lisp/vc-svn.el
+++ b/lisp/vc-svn.el
@@ -386,27 +386,42 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
386(defun vc-svn-modify-change-comment (files rev comment) 386(defun vc-svn-modify-change-comment (files rev comment)
387 "Modify the change comments for a specified REV. 387 "Modify the change comments for a specified REV.
388You must have ssh access to the repository host, and the directory Emacs 388You must have ssh access to the repository host, and the directory Emacs
389uses locally for temp files must also be writeable by you on that host." 389uses locally for temp files must also be writeable by you on that host.
390 (vc-do-command nil 0 "svn" nil "info") 390This is only supported if the repository access method is either file://
391 (set-buffer "*vc*") 391or svn+ssh://."
392 (goto-char (point-min)) 392 (let (tempfile host remotefile directory fileurl-p)
393 (unless (re-search-forward "Repository Root: svn\\+ssh://\\([^/]+\\)\\(/.*\\)" nil t)
394 (error "Repository information is unavailable."))
395 (let* ((tempfile (make-temp-file user-mail-address))
396 (host (match-string 1))
397 (directory (match-string 2))
398 (remotefile (concat host ":" tempfile)))
399 (with-temp-buffer 393 (with-temp-buffer
400 (insert comment) 394 (vc-do-command (current-buffer) 0 "svn" nil "info")
401 (write-region (point-min) (point-max) tempfile)) 395 (goto-char (point-min))
402 (unless (vc-do-command nil 0 "scp" nil "-q" tempfile remotefile) 396 (unless (re-search-forward "Repository Root: \\(file://\\(/.*\\)\\)\\|\\(svn\\+ssh://\\([^/]+\\)\\(/.*\\)\\)" nil t)
403 (error "Copy of comment to %s failed" remotefile)) 397 (error "Repository information is unavailable"))
404 (unless (vc-do-command nil 0 "ssh" nil 398 (if (match-string 1)
405 "-q" host 399 (progn
406 (format "svnadmin setlog --bypass-hooks %s -r %s %s; rm %s" 400 (setq fileurl-p t)
407 directory rev tempfile tempfile)) 401 (setq directory (match-string 2)))
408 (error "Log edit failed")) 402 (setq host (match-string 4))
409 )) 403 (setq directory (match-string 5))
404 (setq remotefile (concat host ":" tempfile))))
405 (with-temp-file (setq tempfile (make-temp-file user-mail-address))
406 (insert comment))
407 (if fileurl-p
408 ;; Repository Root is a local file.
409 (progn
410 (unless (vc-do-command
411 nil 0 "svnadmin" nil
412 "setlog" "--bypass-hooks" directory
413 "-r" rev (format "%s" tempfile))
414 (error "Log edit failed"))
415 (delete-file tempfile))
416
417 ;; Remote repository, using svn+ssh.
418 (unless (vc-do-command nil 0 "scp" nil "-q" tempfile remotefile)
419 (error "Copy of comment to %s failed" remotefile))
420 (unless (vc-do-command
421 nil 0 "ssh" nil "-q" host
422 (format "svnadmin setlog --bypass-hooks %s -r %s %s; rm %s"
423 directory rev tempfile tempfile))
424 (error "Log edit failed")))))
410 425
411;;; 426;;;
412;;; History functions 427;;; History functions