]> code.delx.au - gnu-emacs/commitdiff
(vc-svn-modify-change-comment): Add support for the
authorDan Nicolaescu <dann@ics.uci.edu>
Wed, 9 Apr 2008 03:38:39 +0000 (03:38 +0000)
committerDan Nicolaescu <dann@ics.uci.edu>
Wed, 9 Apr 2008 03:38:39 +0000 (03:38 +0000)
file:// access method.

lisp/ChangeLog
lisp/vc-svn.el

index 80f6f61f26a555e5011c03c75950284cf1d4dba8..a2a219479c7bcb242c91b8d65c2235225b1118ba 100644 (file)
@@ -1,3 +1,8 @@
+2008-04-09  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-svn.el (vc-svn-modify-change-comment): Add support for the
+       file:// access method.
+
 2008-04-09  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * minibuffer.el: New file.
index e36a16d775801733744225f5b55dbebe6b4afdd5..c2c665cb2755a6e9f56679d791b7ec3e40188400 100644 (file)
@@ -386,27 +386,42 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
 (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 writeable by you on that host."
-  (vc-do-command nil 0 "svn" nil "info")
-  (set-buffer "*vc*")
-  (goto-char (point-min))
-  (unless (re-search-forward "Repository Root: svn\\+ssh://\\([^/]+\\)\\(/.*\\)" nil t)
-    (error "Repository information is unavailable."))
-  (let* ((tempfile (make-temp-file user-mail-address))
-       (host (match-string 1))
-       (directory (match-string 2))
-       (remotefile (concat host ":" tempfile)))
+uses locally for temp files must also be writeable 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
-      (insert comment)
-      (write-region (point-min) (point-max) tempfile))
-    (unless (vc-do-command nil 0 "scp" nil "-q" tempfile remotefile)
-      (error "Copy of comment to %s failed" remotefile))
-    (unless (vc-do-command nil 0 "ssh" nil
-                          "-q" host
-                          (format "svnadmin setlog --bypass-hooks %s -r %s %s; rm %s"
-                                  directory rev tempfile tempfile))
-      (error "Log edit failed"))
-  ))
+      (vc-do-command (current-buffer) 0 "svn" 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
+                  nil 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 nil 0 "scp" nil "-q" tempfile remotefile)
+       (error "Copy of comment to %s failed" remotefile))
+      (unless (vc-do-command
+              nil 0 "ssh" nil "-q" host
+              (format "svnadmin setlog --bypass-hooks %s -r %s %s; rm %s"
+                      directory rev tempfile tempfile))
+       (error "Log edit failed")))))
 
 ;;;
 ;;; History functions