From: Deniz Dogan Date: Thu, 27 Jan 2011 17:51:06 +0000 (+0100) Subject: * vc/vc-bzr.el (vc-bzr-diff): Don't pass --diff-options unless X-Git-Tag: emacs-pretest-24.0.90~104^2~618^2~1322^2~112 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=27bbeb296eff010bfa4262a1eca79362d3191070;p=emacs.git * vc/vc-bzr.el (vc-bzr-diff): Don't pass --diff-options unless there are some diff switches. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3f5bbd33f66..bcf3c67a8b2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-01-27 Deniz Dogan + + * vc/vc-bzr.el (vc-bzr-diff): Don't pass --diff-options unless + there are some diff switches. + 2011-01-27 Stefan Monnier * progmodes/ruby-mode.el (ruby-syntax-propertize-function): diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index 4c63c6e6776..9693fa745ce 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el @@ -674,18 +674,22 @@ REV non-nil gets an error." (defun vc-bzr-diff (files &optional rev1 rev2 buffer) "VC bzr backend for diff." - ;; `bzr diff' exits with code 1 if diff is non-empty. - (apply #'vc-bzr-command "diff" (or buffer "*vc-diff*") - (if vc-disable-async-diff 1 'async) files - "--diff-options" (mapconcat 'identity - (vc-switches 'bzr 'diff) - " ") - ;; This `when' is just an optimization because bzr-1.2 is *much* - ;; faster when the revision argument is not given. - (when (or rev1 rev2) - (list "-r" (format "%s..%s" - (or rev1 "revno:-1") - (or rev2 "")))))) + (let* ((switches (vc-switches 'bzr 'diff)) + (args + (append + ;; Only add --diff-options if there are any diff switches. + (unless (zerop (length switches)) + (list "--diff-options" (mapconcat 'identity switches " "))) + ;; This `when' is just an optimization because bzr-1.2 is *much* + ;; faster when the revision argument is not given. + (when (or rev1 rev2) + (list "-r" (format "%s..%s" + (or rev1 "revno:-1") + (or rev2 ""))))))) + ;; `bzr diff' exits with code 1 if diff is non-empty. + (apply #'vc-bzr-command "diff" (or buffer "*vc-diff*") + (if vc-disable-async-diff 1 'async) files + args))) ;; FIXME: vc-{next,previous}-revision need fixing in vc.el to deal with