From 2a4362ba622a53683e9c6ea3e1b441d6f59af08f Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sun, 22 Nov 2015 06:59:50 +0200 Subject: [PATCH] Work around the asynchronous-empty-diff problem * lisp/vc/vc-rcs.el (vc-rcs-diff): * lisp/vc/vc-mtn.el (vc-mtn-diff): * lisp/vc/vc-hg.el (vc-hg-diff): * lisp/vc/vc-git.el (vc-git-diff): Ignore the ASYNC argument, do a synchronous process call (bug#21969). --- lisp/vc/vc-git.el | 4 ++-- lisp/vc/vc-hg.el | 6 +++--- lisp/vc/vc-mtn.el | 4 ++-- lisp/vc/vc-rcs.el | 5 +++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 8bf37f09dc..99084183a8 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1050,7 +1050,7 @@ or BRANCH^ (where \"^\" can be repeated)." (autoload 'vc-switches "vc") -(defun vc-git-diff (files &optional rev1 rev2 buffer async) +(defun vc-git-diff (files &optional rev1 rev2 buffer _async) "Get a difference report using Git between two revisions of FILES." (let (process-file-side-effects (command "diff-tree")) @@ -1061,7 +1061,7 @@ or BRANCH^ (where \"^\" can be repeated)." (unless rev1 (setq rev1 "HEAD"))) (if vc-git-diff-switches (apply #'vc-git-command (or buffer "*vc-diff*") - (if async 'async 1) + 1 ; bug#21969 files command "--exit-code" diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 92b0c3169c..dd897adc59 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -335,7 +335,7 @@ If LIMIT is non-nil, show no more than this many entries." (autoload 'vc-switches "vc") -(defun vc-hg-diff (files &optional oldvers newvers buffer async) +(defun vc-hg-diff (files &optional oldvers newvers buffer _async) "Get a difference report using hg between two revisions of FILES." (let* ((firstfile (car files)) (working (and firstfile (vc-working-revision firstfile)))) @@ -345,8 +345,8 @@ If LIMIT is non-nil, show no more than this many entries." (setq oldvers working)) (apply #'vc-hg-command (or buffer "*vc-diff*") - (if async 'async nil) - files "diff" + nil ; bug#21969 + files "diff" (append (vc-switches 'hg 'diff) (when oldvers diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el index b56a08f2a9..3b59c61eb7 100644 --- a/lisp/vc/vc-mtn.el +++ b/lisp/vc/vc-mtn.el @@ -253,10 +253,10 @@ If LIMIT is non-nil, show no more than this many entries." (autoload 'vc-switches "vc") -(defun vc-mtn-diff (files &optional rev1 rev2 buffer async) +(defun vc-mtn-diff (files &optional rev1 rev2 buffer _async) "Get a difference report using monotone between two revisions of FILES." (apply 'vc-mtn-command (or buffer "*vc-diff*") - (if async 'async 1) + 1 ; bug#21969 files "diff" (append (vc-switches 'mtn 'diff) diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el index ba1336424e..3e43546967 100644 --- a/lisp/vc/vc-rcs.el +++ b/lisp/vc/vc-rcs.el @@ -534,10 +534,11 @@ files beneath it." (vc-rcs-print-log-cleanup)) (when limit 'limit-unsupported)) -(defun vc-rcs-diff (files &optional oldvers newvers buffer async) +(defun vc-rcs-diff (files &optional oldvers newvers buffer _async) "Get a difference report using RCS between two sets of files." (apply #'vc-do-command (or buffer "*vc-diff*") - (if async 'async 1) + ;; The repo is local, so this is fast anyway. + 1 ; bug#21969 "rcsdiff" (vc-expand-dirs files 'RCS) (append (list "-q" (and oldvers (concat "-r" oldvers)) -- 2.39.2