From: PythonNut Date: Thu, 3 Sep 2015 19:09:18 +0000 (+0000) Subject: Ensure working revisions are never stale X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/2209370e6bfd0471f07d5198589102b3dbfe85a7?hp=15aa2b8ad5af74cc1033a34e025101d77b17d3a7 Ensure working revisions are never stale --- diff --git a/diff-hl-flydiff.el b/diff-hl-flydiff.el index c06583187..04bf1b9fa 100644 --- a/diff-hl-flydiff.el +++ b/diff-hl-flydiff.el @@ -66,6 +66,11 @@ (advice-add 'vc-git-mode-line-string :override #'diff-hl-flydiff/vc-git-mode-line-string))) +(defun diff-hl-flydiff/working-revision (file) + "Like vc-working-revision, but always up-to-date" + (vc-file-setprop file 'vc-working-revision + (vc-call-backend (vc-backend file) 'working-revision file))) + (defun diff-hl-flydiff-make-temp-file-name (file rev &optional manual) "Return a backup file name for REV or the current version of FILE. If MANUAL is non-nil it means that a name for backups created by @@ -114,14 +119,11 @@ This requires the external program `diff' to be in your `exec-path'." (if (file-directory-p "/dev/shm/") "/dev/shm/" temporary-file-directory)) - (rev (diff-hl-flydiff-create-revision - file - (vc-working-revision file - (vc-responsible-backend file))))) + (rev (diff-hl-flydiff-create-revision file + (diff-hl-flydiff/working-revision file)))) (diff-no-select rev (current-buffer) "-U 0" 'noasync (get-buffer-create " *diff-hl-diff*"))))) - (defun diff-hl-flydiff/update (old-fun &optional auto) (unless (and auto (or