Mercurial > emacs
comparison lisp/vc-svn.el @ 93886:ed131d081eab
(vc-svn-modify-change-comment): Add support for the
file:// access method.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Wed, 09 Apr 2008 03:38:39 +0000 |
parents | 3afeea9a48a3 |
children | bfc762f0b49c |
comparison
equal
deleted
inserted
replaced
93885:6c6216b3b878 | 93886:ed131d081eab |
---|---|
384 (message "Merging changes into %s...done" file)))) | 384 (message "Merging changes into %s...done" file)))) |
385 | 385 |
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. |
388 You must have ssh access to the repository host, and the directory Emacs | 388 You must have ssh access to the repository host, and the directory Emacs |
389 uses locally for temp files must also be writeable by you on that host." | 389 uses locally for temp files must also be writeable by you on that host. |
390 (vc-do-command nil 0 "svn" nil "info") | 390 This is only supported if the repository access method is either file:// |
391 (set-buffer "*vc*") | 391 or 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 |
413 ;;; | 428 ;;; |
414 | 429 |