aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2011-11-09 21:36:48 -0500
committerGlenn Morris2011-11-09 21:36:48 -0500
commit9a4de110224cc0ea32a9c680db3f4355484236a6 (patch)
treec9fe81a857ba5600b6d7439026838c2361f8f55c
parentb2621720c318257be0d4100d695b62986db88b4f (diff)
downloademacs-9a4de110224cc0ea32a9c680db3f4355484236a6.tar.gz
emacs-9a4de110224cc0ea32a9c680db3f4355484236a6.zip
Always use svn --non-interactive in vc-svn.el (bug#9993)
* lisp/vc/vc-svn.el (vc-svn-create-repo, vc-svn-modify-change-comment): Call svn via vc-svn-command rather than vc-do-command. (vc-svn-command): Add --non-interactive. (vc-svn-update, vc-svn-merge-news): No need for --non-interactive.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/vc/vc-svn.el26
2 files changed, 21 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1617736593b..0b1572f9bce 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
12011-11-10 Glenn Morris <rgm@gnu.org> 12011-11-10 Glenn Morris <rgm@gnu.org>
2 2
3 * vc/vc-svn.el (vc-svn-create-repo, vc-svn-modify-change-comment):
4 Call svn via vc-svn-command rather than vc-do-command.
5 (vc-svn-command): Add --non-interactive. (Bug#9993)
6 (vc-svn-update, vc-svn-merge-news): No need for --non-interactive.
7
3 * emacs-lisp/bytecomp.el (byte-compile-interactive-only-functions): 8 * emacs-lisp/bytecomp.el (byte-compile-interactive-only-functions):
4 Add toggle-read-only. (Bug#7292) 9 Add toggle-read-only. (Bug#7292)
5 * files.el (toggle-read-only): Mention that it should only 10 * files.el (toggle-read-only): Mention that it should only
diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el
index 7362258a42d..dc4e179e060 100644
--- a/lisp/vc/vc-svn.el
+++ b/lisp/vc/vc-svn.el
@@ -263,8 +263,8 @@ RESULT is a list of conses (FILE . STATE) for directory DIR."
263(defun vc-svn-create-repo () 263(defun vc-svn-create-repo ()
264 "Create a new SVN repository." 264 "Create a new SVN repository."
265 (vc-do-command "*vc*" 0 "svnadmin" '("create" "SVN")) 265 (vc-do-command "*vc*" 0 "svnadmin" '("create" "SVN"))
266 (vc-do-command "*vc*" 0 vc-svn-program '(".") 266 (vc-svn-command "*vc*" 0 "." "checkout"
267 "checkout" (concat "file://" default-directory "SVN"))) 267 (concat "file://" default-directory "SVN")))
268 268
269(defun vc-svn-register (files &optional rev comment) 269(defun vc-svn-register (files &optional rev comment)
270 "Register FILES into the SVN version-control system. 270 "Register FILES into the SVN version-control system.
@@ -334,7 +334,6 @@ This is only possible if SVN is responsible for FILE's directory.")
334 ;; Check out a particular version (or recreate the file). 334 ;; Check out a particular version (or recreate the file).
335 (vc-file-setprop file 'vc-working-revision nil) 335 (vc-file-setprop file 'vc-working-revision nil)
336 (apply 'vc-svn-command nil 0 file 336 (apply 'vc-svn-command nil 0 file
337 "--non-interactive" ; bug#4280
338 "update" 337 "update"
339 (cond 338 (cond
340 ((null rev) "-rBASE") 339 ((null rev) "-rBASE")
@@ -373,7 +372,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
373 (message "Merging changes into %s..." file) 372 (message "Merging changes into %s..." file)
374 ;; (vc-file-setprop file 'vc-working-revision nil) 373 ;; (vc-file-setprop file 'vc-working-revision nil)
375 (vc-file-setprop file 'vc-checkout-time 0) 374 (vc-file-setprop file 'vc-checkout-time 0)
376 (vc-svn-command nil 0 file "--non-interactive" "update") ; see bug#7152 375 (vc-svn-command nil 0 file "update")
377 ;; Analyze the merge result reported by SVN, and set 376 ;; Analyze the merge result reported by SVN, and set
378 ;; file properties accordingly. 377 ;; file properties accordingly.
379 (with-current-buffer (get-buffer "*vc*") 378 (with-current-buffer (get-buffer "*vc*")
@@ -425,7 +424,7 @@ This is only supported if the repository access method is either file://
425or svn+ssh://." 424or svn+ssh://."
426 (let (tempfile host remotefile directory fileurl-p) 425 (let (tempfile host remotefile directory fileurl-p)
427 (with-temp-buffer 426 (with-temp-buffer
428 (vc-do-command (current-buffer) 0 vc-svn-program nil "info") 427 (vc-svn-command (current-buffer) 0 nil "info")
429 (goto-char (point-min)) 428 (goto-char (point-min))
430 (unless (re-search-forward "Repository Root: \\(file://\\(/.*\\)\\)\\|\\(svn\\+ssh://\\([^/]+\\)\\(/.*\\)\\)" nil t) 429 (unless (re-search-forward "Repository Root: \\(file://\\(/.*\\)\\)\\|\\(svn\\+ssh://\\([^/]+\\)\\(/.*\\)\\)" nil t)
431 (error "Repository information is unavailable")) 430 (error "Repository information is unavailable"))
@@ -581,12 +580,19 @@ NAME is assumed to be a URL."
581(defun vc-svn-command (buffer okstatus file-or-list &rest flags) 580(defun vc-svn-command (buffer okstatus file-or-list &rest flags)
582 "A wrapper around `vc-do-command' for use in vc-svn.el. 581 "A wrapper around `vc-do-command' for use in vc-svn.el.
583The difference to vc-do-command is that this function always invokes `svn', 582The difference to vc-do-command is that this function always invokes `svn',
584and that it passes `vc-svn-global-switches' to it before FLAGS." 583and that it passes \"--non-interactive\" and `vc-svn-global-switches' to
585 (apply 'vc-do-command (or buffer "*vc*") okstatus vc-svn-program file-or-list 584it before FLAGS."
586 (if (stringp vc-svn-global-switches) 585 ;; Might be nice if svn defaulted to non-interactive if stdin not tty.
586 ;; http://svn.haxx.se/dev/archive-2008-05/0762.shtml
587 ;; http://svn.haxx.se/dev/archive-2009-04/0094.shtml
588 ;; Maybe newer ones do?
589 (or (member "--non-interactive"
590 (setq flags (if (stringp vc-svn-global-switches)
587 (cons vc-svn-global-switches flags) 591 (cons vc-svn-global-switches flags)
588 (append vc-svn-global-switches 592 (append vc-svn-global-switches flags))))
589 flags)))) 593 (setq flags (cons "--non-interactive" flags)))
594 (apply 'vc-do-command (or buffer "*vc*") okstatus vc-svn-program file-or-list
595 flags))
590 596
591(defun vc-svn-repository-hostname (dirname) 597(defun vc-svn-repository-hostname (dirname)
592 (with-temp-buffer 598 (with-temp-buffer