diff options
| author | Dan Nicolaescu | 2008-04-09 03:38:39 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2008-04-09 03:38:39 +0000 |
| commit | fd0644516654b82dda26fea572917e6ad92423fd (patch) | |
| tree | b2f8cf30fd67f34b0f8e556f991aecc934817c9d | |
| parent | 32bae13cf74b826b6ec2bc35074a68bd3ab6e40c (diff) | |
| download | emacs-fd0644516654b82dda26fea572917e6ad92423fd.tar.gz emacs-fd0644516654b82dda26fea572917e6ad92423fd.zip | |
(vc-svn-modify-change-comment): Add support for the
file:// access method.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/vc-svn.el | 55 |
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 @@ | |||
| 1 | 2008-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 | |||
| 1 | 2008-04-09 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2008-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. |
| 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 |