diff options
| author | Joakim Verona | 2013-02-12 00:04:05 +0100 |
|---|---|---|
| committer | Joakim Verona | 2013-02-12 00:04:05 +0100 |
| commit | e0444a0966fa001953bb97cfb60451c42220be8e (patch) | |
| tree | d5d10a2f99fa0c7b24eee310069e2677409e6802 /lisp/vc | |
| parent | 77f4834db1299b571b1fb3dfb120e5e50eec7cb1 (diff) | |
| parent | 6659b59ccb7909a07f71a0143fd9d85e60b8e414 (diff) | |
| download | emacs-e0444a0966fa001953bb97cfb60451c42220be8e.tar.gz emacs-e0444a0966fa001953bb97cfb60451c42220be8e.zip | |
auto upstream
Diffstat (limited to 'lisp/vc')
| -rw-r--r-- | lisp/vc/diff.el | 25 | ||||
| -rw-r--r-- | lisp/vc/vc-svn.el | 29 |
2 files changed, 34 insertions, 20 deletions
diff --git a/lisp/vc/diff.el b/lisp/vc/diff.el index 8b4ff792969..0fc0d2e3f73 100644 --- a/lisp/vc/diff.el +++ b/lisp/vc/diff.el | |||
| @@ -114,6 +114,13 @@ specified in the variable `diff-switches' are passed to the diff command." | |||
| 114 | tempfile)) | 114 | tempfile)) |
| 115 | (file-local-copy file-or-buf))) | 115 | (file-local-copy file-or-buf))) |
| 116 | 116 | ||
| 117 | (defvar diff-use-labels 'check | ||
| 118 | "Whether `diff-command' understands the \"--label\" option. | ||
| 119 | Possible values are: | ||
| 120 | t -- yes, it does | ||
| 121 | nil -- no, it does not | ||
| 122 | check -- try to probe whether it does") | ||
| 123 | |||
| 117 | (defun diff-no-select (old new &optional switches no-async buf) | 124 | (defun diff-no-select (old new &optional switches no-async buf) |
| 118 | ;; Noninteractive helper for creating and reverting diff buffers | 125 | ;; Noninteractive helper for creating and reverting diff buffers |
| 119 | (unless (bufferp new) (setq new (expand-file-name new))) | 126 | (unless (bufferp new) (setq new (expand-file-name new))) |
| @@ -121,6 +128,11 @@ specified in the variable `diff-switches' are passed to the diff command." | |||
| 121 | (or switches (setq switches diff-switches)) ; If not specified, use default. | 128 | (or switches (setq switches diff-switches)) ; If not specified, use default. |
| 122 | (unless (listp switches) (setq switches (list switches))) | 129 | (unless (listp switches) (setq switches (list switches))) |
| 123 | (or buf (setq buf (get-buffer-create "*Diff*"))) | 130 | (or buf (setq buf (get-buffer-create "*Diff*"))) |
| 131 | (when (eq 'check diff-use-labels) | ||
| 132 | (setq diff-use-labels | ||
| 133 | (with-temp-buffer | ||
| 134 | (when (ignore-errors (call-process diff-command nil t nil "--help")) | ||
| 135 | (if (search-backward "--label" nil t) t))))) | ||
| 124 | (let* ((old-alt (diff-file-local-copy old)) | 136 | (let* ((old-alt (diff-file-local-copy old)) |
| 125 | (new-alt (diff-file-local-copy new)) | 137 | (new-alt (diff-file-local-copy new)) |
| 126 | (command | 138 | (command |
| @@ -130,11 +142,14 @@ specified in the variable `diff-switches' are passed to the diff command." | |||
| 130 | ,@switches | 142 | ,@switches |
| 131 | ,@(mapcar #'shell-quote-argument | 143 | ,@(mapcar #'shell-quote-argument |
| 132 | (nconc | 144 | (nconc |
| 133 | (when (or old-alt new-alt) | 145 | (and (or old-alt new-alt) |
| 134 | (list "-L" (if (stringp old) | 146 | (eq diff-use-labels t) |
| 135 | old (prin1-to-string old)) | 147 | (list "--label" |
| 136 | "-L" (if (stringp new) | 148 | (if (stringp old) old |
| 137 | new (prin1-to-string new)))) | 149 | (prin1-to-string old)) |
| 150 | "--label" | ||
| 151 | (if (stringp new) new | ||
| 152 | (prin1-to-string new)))) | ||
| 138 | (list (or old-alt old) | 153 | (list (or old-alt old) |
| 139 | (or new-alt new))))) | 154 | (or new-alt new))))) |
| 140 | " ")) | 155 | " ")) |
diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index fcdd792a69b..923888b460b 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el | |||
| @@ -50,14 +50,21 @@ | |||
| 50 | :type 'string | 50 | :type 'string |
| 51 | :group 'vc-svn) | 51 | :group 'vc-svn) |
| 52 | 52 | ||
| 53 | (defcustom vc-svn-global-switches nil | 53 | ;; Might be nice if svn defaulted to non-interactive if stdin not tty. |
| 54 | "Global switches to pass to any SVN command." | 54 | ;; http://svn.haxx.se/dev/archive-2008-05/0762.shtml |
| 55 | ;; http://svn.haxx.se/dev/archive-2009-04/0094.shtml | ||
| 56 | ;; Maybe newer ones do? | ||
| 57 | (defcustom vc-svn-global-switches (unless (eq system-type 'darwin) ; bug#13513 | ||
| 58 | '("--non-interactive")) | ||
| 59 | "Global switches to pass to any SVN command. | ||
| 60 | The option \"--non-interactive\" is often needed to prevent SVN | ||
| 61 | hanging while prompting for authorization." | ||
| 55 | :type '(choice (const :tag "None" nil) | 62 | :type '(choice (const :tag "None" nil) |
| 56 | (string :tag "Argument String") | 63 | (string :tag "Argument String") |
| 57 | (repeat :tag "Argument List" | 64 | (repeat :tag "Argument List" |
| 58 | :value ("") | 65 | :value ("") |
| 59 | string)) | 66 | string)) |
| 60 | :version "22.1" | 67 | :version "24.4" |
| 61 | :group 'vc-svn) | 68 | :group 'vc-svn) |
| 62 | 69 | ||
| 63 | (defcustom vc-svn-register-switches nil | 70 | (defcustom vc-svn-register-switches nil |
| @@ -600,19 +607,11 @@ NAME is assumed to be a URL." | |||
| 600 | (defun vc-svn-command (buffer okstatus file-or-list &rest flags) | 607 | (defun vc-svn-command (buffer okstatus file-or-list &rest flags) |
| 601 | "A wrapper around `vc-do-command' for use in vc-svn.el. | 608 | "A wrapper around `vc-do-command' for use in vc-svn.el. |
| 602 | The difference to vc-do-command is that this function always invokes `svn', | 609 | The difference to vc-do-command is that this function always invokes `svn', |
| 603 | and that it passes \"--non-interactive\" and `vc-svn-global-switches' to | 610 | and that it passes `vc-svn-global-switches' to it before FLAGS." |
| 604 | it before FLAGS." | ||
| 605 | ;; Might be nice if svn defaulted to non-interactive if stdin not tty. | ||
| 606 | ;; http://svn.haxx.se/dev/archive-2008-05/0762.shtml | ||
| 607 | ;; http://svn.haxx.se/dev/archive-2009-04/0094.shtml | ||
| 608 | ;; Maybe newer ones do? | ||
| 609 | (or (member "--non-interactive" | ||
| 610 | (setq flags (if (stringp vc-svn-global-switches) | ||
| 611 | (cons vc-svn-global-switches flags) | ||
| 612 | (append vc-svn-global-switches flags)))) | ||
| 613 | (setq flags (cons "--non-interactive" flags))) | ||
| 614 | (apply 'vc-do-command (or buffer "*vc*") okstatus vc-svn-program file-or-list | 611 | (apply 'vc-do-command (or buffer "*vc*") okstatus vc-svn-program file-or-list |
| 615 | flags)) | 612 | (if (stringp vc-svn-global-switches) |
| 613 | (cons vc-svn-global-switches flags) | ||
| 614 | (append vc-svn-global-switches flags)))) | ||
| 616 | 615 | ||
| 617 | (defun vc-svn-repository-hostname (dirname) | 616 | (defun vc-svn-repository-hostname (dirname) |
| 618 | (with-temp-buffer | 617 | (with-temp-buffer |